You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This removes our Django template `confirmation_modal.html` and instead provides the `confirmation-modal` custom element. The new modal is used like a submit button for HTML forms. Alternatively, if a modal does not have an associated form, it will dispatch a custom "confirmed" event on itself.
Additionally, I added "custom-success" forms. By specifying the `custom-success` tag on an HTML form, the form will not use the default behavior when a submit is requested, but instead submit the form data with `fetch` and dispatch a custom event afterwards. One common use case is making a form reload the current site on success - this way, we don't need the views to know what sites usually request it. I added the `reload-on-success` tag for this special case.
I changed all confirmation modals, except for the delegation modal on the contributor index site. This modal was already a special case before and we can port it later.
<spanslot="title">{% trans 'Approve evaluation' %}</span>
98
+
<spanslot="action-text">{% trans 'Approve evaluation' %}</span>
99
+
<spanslot="question">
100
+
{% blocktrans trimmed %}
101
+
Do you want to approve this evaluation? This will allow the evaluation team to proceed with the preparation, but you won't be able to make any further changes.
102
+
{% endblocktrans %}
103
+
</span>
104
+
105
+
<buttonslot="show-button" type="button" class="btn btn-success">{% trans 'Save and approve' %}</button>
106
+
</confirmation-modal>
98
107
{% endif %}
99
108
<ahref="{% url 'contributor:index' %}" class="btn btn-light">{% if edit %}{% trans 'Cancel' %}{% else %}{% trans 'Back' %}{% endif %}</a>
100
109
</div>
@@ -123,22 +132,6 @@ <h5 class="modal-title" id="previewModalLabel">{% trans 'Preview' %}</h5>
123
132
124
133
{% block modals %}
125
134
{{ block.super }}
126
-
{% trans 'Approve evaluation' as title %}
127
-
{% blocktrans asvar question%}Do you want to approve this evaluation? This will allow the evaluation team to proceed with the preparation, but you won't be able to make any further changes.{% endblocktrans %}
128
-
{% trans 'Approve evaluation' as action_text %}
129
-
{% include 'confirmation_modal.html' with modal_id='approveEvaluationModal' title=title question=question action_text=action_text btn_type='primary' %}
<ahref="{% url 'grades:upload_grades' course.id %}?final=true" class="btn btn-dark">{% trans 'Upload new final grades' %}</a>
50
70
{% endif %}
51
71
{% endblock %}
52
-
53
-
{% block modals %}
54
-
{{ block.super }}
55
-
{% trans 'Delete grade document' as title %}
56
-
{% trans 'Do you really want to delete the grade document <strongdata-label=""></strong>?' as question %}
57
-
{% trans 'Delete grade document' as action_text %}
58
-
{% include 'confirmation_modal.html' with modal_id='deleteGradedocumentModal' title=title question=question action_text=action_text btn_type='danger' %}
0 commit comments