diff options
| author | rubenwardy <rw@rubenwardy.com> | 2020-07-17 20:48:51 +0100 |
|---|---|---|
| committer | rubenwardy <rw@rubenwardy.com> | 2020-07-17 20:48:51 +0100 |
| commit | 6a674c3c79437c7b4829947c67dd7f14b32c1941 (patch) | |
| tree | 0830107ee78e80e61312c90c35a84c6154f6970a /app/templates/admin | |
| parent | 0ac2827468a5d18536a9066033e0ad4a4767edbb (diff) | |
| download | cheatdb-6a674c3c79437c7b4829947c67dd7f14b32c1941.tar.xz | |
Add Content Warnings
Diffstat (limited to 'app/templates/admin')
| -rw-r--r-- | app/templates/admin/list.html | 1 | ||||
| -rw-r--r-- | app/templates/admin/warnings/edit.html | 26 | ||||
| -rw-r--r-- | app/templates/admin/warnings/list.html | 52 |
3 files changed, 79 insertions, 0 deletions
diff --git a/app/templates/admin/list.html b/app/templates/admin/list.html index 75fb61e..211c86d 100644 --- a/app/templates/admin/list.html +++ b/app/templates/admin/list.html @@ -12,6 +12,7 @@ <a class="list-group-item list-group-item-action" href="{{ url_for('admin.tag_list') }}">Tag Editor</a> <a class="list-group-item list-group-item-action" href="{{ url_for('admin.license_list') }}">License Editor</a> <a class="list-group-item list-group-item-action" href="{{ url_for('admin.version_list') }}">Version Editor</a> + <a class="list-group-item list-group-item-action" href="{{ url_for('admin.warning_list') }}">Warning Editor</a> <a class="list-group-item list-group-item-action" href="{{ url_for('admin.switch_user') }}">Sign in as another user</a> </div> </div> diff --git a/app/templates/admin/warnings/edit.html b/app/templates/admin/warnings/edit.html new file mode 100644 index 0000000..2e6e71a --- /dev/null +++ b/app/templates/admin/warnings/edit.html @@ -0,0 +1,26 @@ +{% extends "base.html" %} + +{% block title %} + {% if warning %} + Edit {{ warning.title }} + {% else %} + New warning + {% endif %} +{% endblock %} + +{% block content %} + <a class="btn btn-primary float-right" href="{{ url_for('admin.create_edit_warning') }}">New Warning</a> + <a class="btn btn-secondary mb-4" href="{{ url_for('admin.warning_list') }}">Back to list</a> + + {% 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) }} + {{ render_field(form.description) }} + {% if warning %} + {{ render_field(form.name) }} + {% endif %} + {{ render_submit_field(form.submit) }} + </form> +{% endblock %} diff --git a/app/templates/admin/warnings/list.html b/app/templates/admin/warnings/list.html new file mode 100644 index 0000000..96a299c --- /dev/null +++ b/app/templates/admin/warnings/list.html @@ -0,0 +1,52 @@ +{% extends "base.html" %} + +{% block title %} +{{ _("Warnings") }} +{% endblock %} + +{% block content %} + <a class="btn btn-primary float-right" href="{{ url_for('admin.create_edit_warning') }}">{{ _("New Warning") }}</a> + + <h1>{{ _("Warnings") }}</h1> + + <p> + Also see <a href="/help/content_flags/">Package Flags</a>. + </p> + + <div class="list-group"> + <div class="list-group-item"> + <div class="row text-muted"> + <div class="col-sm-2"> + {{ _("Name") }} + </div> + + <div class="col-sm"> + {{ _("Description") }} + </div> + + <div class="col-sm-1 text-center"> + {{ _("Packages") }} + </div> + </div> + </div> + + {% for t in warnings %} + <a class="list-group-item list-group-item-action" + href="{{ url_for('admin.create_edit_warning', name=t.name) }}"> + <div class="row"> + <div class="col-sm-2"> + {{ t.title }} + </div> + + <div class="col-sm"> + {{ t.description }} + </div> + + <div class="col-sm-1 text-center"> + {{ t.packages | count }} + </div> + </div> + </a> + {% endfor %} + </div> +{% endblock %} |
