diff --git a/app.py b/app.py index fd0fa55..0c5fecc 100644 --- a/app.py +++ b/app.py @@ -135,11 +135,18 @@ def admin_edit(link_id): @app.route('/admin/add') @auth.login_required def admin_add(): - add_form = EditForm() - add_form.folder.choices = [('', '')] + [(query.id, query.name) for query in AnimeFolder.query.all()] + edit_form = EditForm() + edit_form.folder.choices = [('', '')] + [(query.id, query.name) for query in AnimeFolder.query.all()] titles = AnimeTitle.query.all() + link = AnimeLink() + for attr in dir(link): + if not attr.startswith('_'): + try: + setattr(link, attr, '') + except: + pass - return render_template('admin/add.html', search_form=SearchForm(), titles=titles, add_form=add_form) + return render_template('admin/edit.html', search_form=SearchForm(), link=link, titles=titles, edit_form=edit_form) @app.route('/admin/save', methods=['POST']) diff --git a/templates/admin/add.html b/templates/admin/add.html deleted file mode 100644 index b2e1435..0000000 --- a/templates/admin/add.html +++ /dev/null @@ -1,91 +0,0 @@ -{% extends "layout.html" %} -{% block title %} - Admin Add{% endblock %} -{% block body %} -
-{% endblock %} diff --git a/templates/admin/edit.html b/templates/admin/edit.html index 21c728a..0e08acd 100644 --- a/templates/admin/edit.html +++ b/templates/admin/edit.html @@ -52,22 +52,22 @@