|
1 | 1 | {% extends 'staff_course_base.html' %} |
2 | 2 |
|
| 3 | +{% load static %} |
| 4 | + |
3 | 5 | {% block content %} |
4 | 6 | {{ block.super }} |
5 | 7 | <h3> |
@@ -47,8 +49,59 @@ <h5 class="card-title">{% translate 'Evaluations' %}</h5> |
47 | 49 | </div> |
48 | 50 | </div> |
49 | 51 | {% endif %} |
| 52 | + </form> |
50 | 53 |
|
51 | | - {% include 'log/logentries.html' with logged_object=course %} |
| 54 | + {% if course.ignored_evaluations.count > 0 %} |
| 55 | + <form id="ignored-evaluation-deletion-form" custom-success method="POST" action="{% url 'cms:ignored_evaluation_delete' %}"> |
| 56 | + {% csrf_token %} |
| 57 | + </form> |
52 | 58 |
|
53 | | - </form> |
| 59 | + <script type="module"> |
| 60 | + import { fadeOutThenRemove } from "{% static 'js/utils.js' %}"; |
| 61 | + document.getElementById("ignored-evaluation-deletion-form").addEventListener("submit-success", event => { |
| 62 | + fadeOutThenRemove(document.getElementById(`ignored-evaluation-row-${event.detail.body.get("ignored_evaluation_id")}`)) |
| 63 | + }); |
| 64 | + </script> |
| 65 | + <div class="card mb-3"> |
| 66 | + <div class="card-body"> |
| 67 | + <h5 class="card-title">{% translate 'Ignored evaluations' %}</h5> |
| 68 | + <table class="table table-vertically-aligned"> |
| 69 | + <thead> |
| 70 | + <tr> |
| 71 | + <th class="width-percent-35">{% translate 'Name' %}</th> |
| 72 | + <th class="width-percent-35">{% translate 'Notes' %}</th> |
| 73 | + <th class="width-percent-25">{% translate 'CMS ID' %}</th> |
| 74 | + <th class="width-percent-5"></th> |
| 75 | + </tr> |
| 76 | + </thead> |
| 77 | + <tbody> |
| 78 | + {% for ignored_evaluation in course.ignored_evaluations.all %} |
| 79 | + <tr id="ignored-evaluation-row-{{ ignored_evaluation.id }}"> |
| 80 | + <td>{{ ignored_evaluation }}</td> |
| 81 | + <td>{{ ignored_evaluation.notes|linebreaks }}</td> |
| 82 | + <td>{{ ignored_evaluation.cms_id }}</td> |
| 83 | + <td class="text-end"> |
| 84 | + <confirmation-modal type="submit" form="ignored-evaluation-deletion-form" name="ignored_evaluation_id" value="{{ ignored_evaluation.id }}" confirm-button-class="btn-danger"> |
| 85 | + <span slot="title">{% translate 'Delete ignored evaluation' %}</span> |
| 86 | + <span slot="action-text">{% translate 'Delete ignored evaluation' %}</span> |
| 87 | + <span slot="question"> |
| 88 | + {% blocktranslate trimmed %} |
| 89 | + Do you really want to delete the ignored evaluation <strong>{{ ignored_evaluation }}</strong>? It will then be imported again on the next CMS import. |
| 90 | + {% endblocktranslate %} |
| 91 | + </span> |
| 92 | + |
| 93 | + <button slot="show-button" type="button" class="btn btn-sm btn-danger" data-bs-toggle="tooltip" data-bs-placement="top" title="{% translate 'Delete' %}"> |
| 94 | + <span class="fas fa-fw fa-trash" aria-hidden="true"></span> |
| 95 | + </button> |
| 96 | + </confirmation-modal> |
| 97 | + </td> |
| 98 | + </tr> |
| 99 | + {% endfor %} |
| 100 | + </tbody> |
| 101 | + </table> |
| 102 | + </div> |
| 103 | + </div> |
| 104 | + {% endif %} |
| 105 | + |
| 106 | + {% include 'log/logentries.html' with logged_object=course %} |
54 | 107 | {% endblock %} |
0 commit comments