-
Notifications
You must be signed in to change notification settings - Fork 204
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement bulk moderation actions (#4654)
Co-authored-by: Krystle Salazar <[email protected]>
- Loading branch information
Showing
12 changed files
with
877 additions
and
48 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
68 changes: 68 additions & 0 deletions
68
api/api/templates/admin/api/bulk_moderation_confirmation.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
{% extends "admin/base_site.html" %} | ||
{% load admin_urls static %} | ||
|
||
{% block extrahead %} | ||
{{ block.super }} | ||
{{ media }} | ||
<script src="{% static 'admin/js/cancel.js' %}" async></script> | ||
{% endblock %} | ||
|
||
{% block bodyclass %}{{ block.super }} app-{{ opts.app_label }} model-{{ opts.model_name }} delete-confirmation delete-selected-confirmation{% endblock %} | ||
|
||
{% block breadcrumbs %} | ||
<div class="breadcrumbs"> | ||
<a href="{% url 'admin:index' %}">Home</a> | ||
› <a href="{% url 'admin:app_list' app_label=opts.app_label %}">{{ opts.app_config.verbose_name }}</a> | ||
› <a href="{% url opts|admin_urlname:'changelist' %}">{{ opts.verbose_name_plural|capfirst }}</a> | ||
› Bulk moderate | ||
</div> | ||
{% endblock %} | ||
|
||
{% block content %} | ||
<p>Are you sure you want the selected {{ objects_name }} to be {{ decision_action.verb }}?</p> | ||
|
||
{% if decision_action == "reversed_deindex" %} | ||
<div class="bg-warning p-10px"> | ||
This action does not immediately result in deindexed records being | ||
added back to the DB and Elasticsearch indices. When the records were | ||
originally deindexed, they were deleted from both, and there is no | ||
quick way to restore them without running a data refresh. | ||
</div> | ||
<style> | ||
.p-10px { | ||
padding: 10px; | ||
} | ||
.bg-warning { | ||
background-color: var(--message-warning-bg); | ||
} | ||
</style> | ||
{% endif %} | ||
|
||
<h2>Summary</h2> | ||
<ul> | ||
{% for stat_key, stat_value in stats %} | ||
<li>{{ stat_key|capfirst }}: {{ stat_value }}</li> | ||
{% endfor %} | ||
</ul> | ||
|
||
<h2>Objects</h2> | ||
{% for moderatable_object in moderatable_objects %} | ||
<ul>{{ moderatable_object|unordered_list }}</ul> | ||
{% endfor %} | ||
|
||
<form method="post"> | ||
{% csrf_token %} | ||
<div> | ||
<div> | ||
<textarea required name="notes" placeholder="Please provide an explanation." rows="4" cols="80"></textarea> | ||
</div> | ||
{% for obj in queryset %} | ||
<input type="hidden" name="{{ action_checkbox_name }}" value="{{ obj.pk }}"> | ||
{% endfor %} | ||
<input type="hidden" name="action" value="{{ decision_action }}"> | ||
<input type="hidden" name="post" value="yes"> | ||
<input type="submit" value="Yes, I’m sure"> | ||
<a href="#" class="button cancel-link">No, take me back</a> | ||
</div> | ||
</form> | ||
{% endblock %} |
Oops, something went wrong.