|
@@ -61,13 +61,13 @@
|
|
|
</div>
|
|
|
<div class="media-footer">
|
|
|
{% if acl.warnings.can_cancel_warning(user, profile, item) and not warnings_tracker.is_warning_expired(item) %}
|
|
|
- <form action="{{ url('user_warnings_cancel', user=profile.pk, username=profile.username_slug, warning=item.pk) }}" method="post">
|
|
|
+ <form action="{{ url('user_warnings_cancel', user=profile.pk, username=profile.username_slug, warning=item.pk) }}" class="confirm-cancel" method="post">
|
|
|
<input type="hidden" name="{{ csrf_id }}" value="{{ csrf_token }}">
|
|
|
<button type="submit" class="btn btn-mini"><i class="icon-ban-circle"></i> {% trans %}Cancel{% endtrans %}</button>
|
|
|
</form>
|
|
|
{% endif %}
|
|
|
{% if acl.warnings.can_delete_warnings() %}
|
|
|
- <form action="{{ url('user_warnings_delete', user=profile.pk, username=profile.username_slug, warning=item.pk) }}" method="post">
|
|
|
+ <form action="{{ url('user_warnings_delete', user=profile.pk, username=profile.username_slug, warning=item.pk) }}" class="confirm-delete" method="post">
|
|
|
<input type="hidden" name="{{ csrf_id }}" value="{{ csrf_token }}">
|
|
|
<button type="submit" class="btn btn-mini"><i class="icon-remove"></i> {% trans %}Delete{% endtrans %}</button>
|
|
|
</form>
|
|
@@ -97,6 +97,22 @@
|
|
|
{% endblock %}
|
|
|
|
|
|
|
|
|
+{% block javascripts -%}{{ super() }}
|
|
|
+<script type="text/javascript">
|
|
|
+ $(function() {
|
|
|
+ $('.confirm-cancel').submit(function() {
|
|
|
+ var decision = confirm("{% trans %}Are you sure you want to cancel this warning?{% endtrans %}");
|
|
|
+ return decision;
|
|
|
+ });
|
|
|
+ $('.confirm-delete').submit(function() {
|
|
|
+ var decision = confirm("{% trans %}Are you sure you want to delete this warning?{% endtrans %}");
|
|
|
+ return decision;
|
|
|
+ });
|
|
|
+ });
|
|
|
+</script>
|
|
|
+{%- endblock %}
|
|
|
+
|
|
|
+
|
|
|
{% macro format_warning_expiration(expires) %}
|
|
|
<strong>{{ expires }}</strong>
|
|
|
{% endmacro %}
|