Add Content Warnings
This commit is contained in:
@@ -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>
|
||||
|
||||
26
app/templates/admin/warnings/edit.html
Normal file
26
app/templates/admin/warnings/edit.html
Normal file
@@ -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 %}
|
||||
52
app/templates/admin/warnings/list.html
Normal file
52
app/templates/admin/warnings/list.html
Normal file
@@ -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 %}
|
||||
Reference in New Issue
Block a user