Remove the slightly un-intuitive "Resolve" button on the report handling page.

This button just uses JavaScript to reveal the subsequent actions. Better to
show these upfront.

Signed-off-by: Ben Sturmfels <ben@sturm.com.au>
This commit is contained in:
Rodrigo Martins 2021-04-10 15:24:11 +10:00 committed by Ben Sturmfels
parent 93084dfe28
commit 9bcebe68c7
No known key found for this signature in database
GPG Key ID: 023C05E2C9C068F0
2 changed files with 20 additions and 24 deletions

View File

@ -24,7 +24,6 @@ function init_report_resolution_form() {
}
init_user_banned_form();
$('form#resolution_form').hide()
$('#open_resolution_form').click(function() {
$('form#resolution_form').toggle();
$.each(hidden_input_names, function(key, list){
$.each(list, function(index, name){
@ -32,7 +31,6 @@ function init_report_resolution_form() {
$('#'+name).hide();
});
});
});
$('#action_to_resolve').change(function() {
$('ul#action_to_resolve li input:checked').each(function() {
$.each(hidden_input_names[$(this).val()], function(index, name){

View File

@ -128,21 +128,7 @@
{{ report.report_content }}
</div>
</div>
{% if not report.is_archived_report() and
not (report.reported_user.has_privilege('admin') and
not request.user.has_privilege('admin')) %}
<input type=button class="button_action" value="{% trans %}Resolve{% endtrans %}" id=open_resolution_form />
<form action="" method="POST" id=resolution_form>
{{ wtforms_util.render_divs(form) }}
{{ csrf_token }}
<input type=submit class="button_action_highlight" id="submit_this_report" value="{% trans %}Resolve This Report{% endtrans %}"/>
</form>
<script>
$(document).ready(function() {
init_report_resolution_form();
});
</script>
{% elif report.is_archived_report() %}
{% if report.is_archived_report() %}
<h2><img src="{{ request.staticdirect('/images/icon_clipboard.png') }}"
alt=""
title="Under a GNU LGPL v.3 or Creative Commons BY-SA 3.0 license.
@ -154,13 +140,25 @@
<pre>
<p>{{ report.result }}</p>
</pre>
{% else %}
{% elif report.reported_user.has_privilege('admin')
and not request.user.has_privilege('admin') %}
<input type=button disabled=disabled value="{% trans %}Resolve This Report{% endtrans %}"/>
<p>
{% trans -%}
You cannot take action against an administrator
{%- endtrans %}
</p>
{% else %}
<form action="" method="POST" id=resolution_form>
{{ wtforms_util.render_divs(form) }}
{{ csrf_token }}
<input type=submit class="button_action_highlight" id="submit_this_report" value="{% trans %}Resolve This Report{% endtrans %}"/>
</form>
<script>
$(document).ready(function() {
init_report_resolution_form();
});
</script>
{% endif %}
{% endif %}
{% endblock %}