1
0
Fork 0
mirror of https://gitlab.com/SIGBUS/nyaa.git synced 2024-12-22 09:10:00 +00:00

Merge pull request #276 from CounterPillow/report-improvements

Frontend report improvements
This commit is contained in:
Anna-Maria Meriniemi 2017-06-30 00:49:11 +03:00 committed by GitHub
commit 1cee6cb647
3 changed files with 35 additions and 6 deletions

View file

@ -411,3 +411,11 @@ h6:hover .header-anchor {
margin-top: auto; margin-top: auto;
} }
} }
table.table > tbody > tr.reports-row > td {
vertical-align: middle;
}
td.report-action-column {
min-width: 150px;
}

View file

@ -2,8 +2,8 @@
{% block title %}Reports :: {{ config.SITE_NAME }}{% endblock %} {% block title %}Reports :: {{ config.SITE_NAME }}{% endblock %}
{% block body %} {% block body %}
{% from "_formhelpers.html" import render_field %} {% from "_formhelpers.html" import render_field %}
<div class="table-responsive"> <div class="table">
<table class="table table-bordered table-hover table-striped"> <table class="table table-bordered table-hover table-striped table-condensed">
<thead> <thead>
<tr> <tr>
<th>#</th> <th>#</th>
@ -16,23 +16,38 @@
</thead> </thead>
<tbody> <tbody>
{% for report in reports.items %} {% for report in reports.items %}
<tr> <tr class="reports-row">
<td>{{ report.id }}</td> <td>{{ report.id }}</td>
<td> <td>
<a href="{{ url_for('view_user', user_name=report.user.username) }}">{{ report.user.username }}</a> <a href="{{ url_for('view_user', user_name=report.user.username) }}">{{ report.user.username }}</a>
{% if report.user.is_trusted %}
<span class="label label-success pull-right">Trusted</span>
{% endif %}
</td> </td>
<td> <td>
<a href="{{ url_for('view_torrent', torrent_id=report.torrent.id) }}">{{ report.torrent.display_name }}</a> <a href="{{ url_for('view_torrent', torrent_id=report.torrent.id) }}">{{ report.torrent.display_name }}</a>
by <a href="{{ url_for('view_user', user_name=report.torrent.user.username) }}">
{{ report.torrent.user.username }}</a>
{% if g.user.is_superadmin and report.torrent.uploader_ip %}
({{ report.torrent.uploader_ip_string }})
{% endif %}
{% if report.torrent.user.is_trusted %}
<span class="label label-success pull-right">Trusted</span>
{% endif %}
</td> </td>
<td>{{ report.reason }}</td> <td>{{ report.reason }}</td>
<td>{{ report.created_time }}</td> <td>{{ report.created_time }}</td>
<td style="width: 15%"> <td class="report-action-column">
<form method="post"> <form method="post">
{{ report_action.csrf_token }} {{ report_action.csrf_token }}
{{ report_action.action }}
{{ report_action.torrent(value=report.torrent.id) }} {{ report_action.torrent(value=report.torrent.id) }}
{{ report_action.report(value=report.id) }} {{ report_action.report(value=report.id) }}
<button type="submit" class="btn btn-primary pull-right">Review</button> <div class="input-group input-group-sm">
{{ report_action.action(class_="form-control") }}
<div class="input-group-btn">
<button type="submit" class="btn btn-primary">Review</button>
</div>
</div>
</form> </form>
</td> </td>
</tr> </tr>

View file

@ -189,6 +189,12 @@
<h4 class="modal-title">Report torrent #{{ torrent.id }}</h4> <h4 class="modal-title">Report torrent #{{ torrent.id }}</h4>
</div> </div>
<div class="modal-body"> <div class="modal-body">
<div class="alert alert-warning" role="alert">
Before submitting a report, please check that the torrent
actually breaks <a href="{{ url_for('site_rules') }}">the
rules</a>. Useless reports like "download is slow" or
"thanks" can get you banned from the site.
</div>
<form method="POST" action="{{ request.url }}/submit_report"> <form method="POST" action="{{ request.url }}/submit_report">
{{ report_form.csrf_token }} {{ report_form.csrf_token }}
{{ render_field(report_form.reason, class_='form-control', maxlength=255) }} {{ render_field(report_form.reason, class_='form-control', maxlength=255) }}