diff options
| author | rubenwardy <rw@rubenwardy.com> | 2018-05-27 17:11:02 +0100 |
|---|---|---|
| committer | rubenwardy <rw@rubenwardy.com> | 2018-05-27 17:12:44 +0100 |
| commit | 19848a154d10d27758ff37e41040e202c9dd2a42 (patch) | |
| tree | 9ff567e38eae1037f55baf85ef91718a75619e2c /app/templates | |
| parent | 6ce2eb71334ba4a203319a0bdf326e2823a636bd (diff) | |
| download | cheatdb-19848a154d10d27758ff37e41040e202c9dd2a42.tar.xz | |
Add tag editor
Diffstat (limited to 'app/templates')
| -rw-r--r-- | app/templates/admin/list.html | 1 | ||||
| -rw-r--r-- | app/templates/base.html | 3 | ||||
| -rw-r--r-- | app/templates/tags/edit.html | 27 | ||||
| -rw-r--r-- | app/templates/tags/list.html | 16 |
4 files changed, 47 insertions, 0 deletions
diff --git a/app/templates/admin/list.html b/app/templates/admin/list.html index 373f18b..3c15fa9 100644 --- a/app/templates/admin/list.html +++ b/app/templates/admin/list.html @@ -7,6 +7,7 @@ {% block content %} <ul> <li><a href="{{ url_for('user_list_page') }}">User list</a></li> + <li><a href="{{ url_for('tag_list_page') }}">Tag Editor</a></li> <li><a href="{{ url_for('switch_user_page') }}">Sign in as another user</a></li> </ul> diff --git a/app/templates/base.html b/app/templates/base.html index dc31624..7b9f361 100644 --- a/app/templates/base.html +++ b/app/templates/base.html @@ -63,6 +63,9 @@ {% if current_user.rank == current_user.rank.ADMIN %} <li><a href="{{ url_for('admin_page') }}">Admin</a></li> {% endif %} + {% if current_user.rank == current_user.rank.MODERATOR %} + <li><a href="{{ url_for('tag_list_page') }}">Tag Editor</a></li> + {% endif %} <li><a href="{{ url_for('user.logout') }}">Sign out</a></li> </ul> </li> diff --git a/app/templates/tags/edit.html b/app/templates/tags/edit.html new file mode 100644 index 0000000..ccffa7f --- /dev/null +++ b/app/templates/tags/edit.html @@ -0,0 +1,27 @@ +{% extends "base.html" %} + +{% block title %} + {% if tag %} + Edit {{ tag.title }} + {% else %} + New tag + {% endif %} +{% endblock %} + +{% block content %} + <p> + <a href="{{ url_for('tag_list_page') }}">Back to list</a> | + <a href="{{ url_for('createedit_tag_page') }}">New Tag</a> + </p> + + {% from "macros/forms.html" import render_field, render_submit_field %} + <form method="POST" action="" enctype="multipart/form-data"> + {{ form.hidden_tag() }} + + {{ render_field(form.title) }} + {% if tag %} + {{ render_field(form.name) }} + {% endif %} + {{ render_submit_field(form.submit) }} + </form> +{% endblock %} diff --git a/app/templates/tags/list.html b/app/templates/tags/list.html new file mode 100644 index 0000000..355f62d --- /dev/null +++ b/app/templates/tags/list.html @@ -0,0 +1,16 @@ +{% extends "base.html" %} + +{% block title %} +Tags +{% endblock %} + +{% block content %} + <p> + <a href="{{ url_for('createedit_tag_page') }}">New Tag</a> + </p> + <ul> + {% for t in tags %} + <li><a href="{{ url_for('createedit_tag_page', name=t.name) }}">{{ t.title }}</a> [{{ t.packages | count }} packages]</li> + {% endfor %} + </ul> +{% endblock %} |
