Refactor viewing case template: adjust HTML structure for improved readability and maintainability
This commit is contained in:
@@ -1,28 +1,55 @@
|
|||||||
|
<nav class="navbar navbar-expand-lg navbar-dark bg-dark mt-2 rounded">
|
||||||
<div class="floating-header">
|
<div class="container-fluid px-3">
|
||||||
<a href="{% url 'anatomy:anatomy_question_update' question.id %}" title="Edit the Question">Edit</a>
|
<span class="navbar-text me-3 text-white">
|
||||||
<a href="{% url 'anatomy:question_clone' question.id %}" title="Clone the Question">Clone</a>
|
<strong>Question:</strong>
|
||||||
<a href="{% url 'anatomy:question_delete' pk=question.pk %}" title="Delete the Question">Delete</a>
|
{% if question.stem %}
|
||||||
<a href="{% url 'anatomy:question_answer_update' pk=question.pk %}" title="Update the question answers">Edit Answers</a>
|
{{ question.stem|striptags|truncatechars:80 }}
|
||||||
<a href="#"
|
{% else %}
|
||||||
onclick="return window.create_popup_window('{% url 'feedback_create' question_type='anatomy' pk=question.pk %}')">
|
#{{ question.pk }}
|
||||||
Add Note</a>
|
|
||||||
|
|
||||||
{% if request.user.is_superuser %}
|
|
||||||
<a href="{% url 'admin:anatomy_anatomyquestion_change' question.id %}"
|
|
||||||
title="Edit the Question using the admin interface">Admin Edit</a>
|
|
||||||
<a href="{% url 'anatomy:question_user_answers' question.id %}" title="View user answers associated with this question">User answers</a>
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
</span>
|
||||||
|
|
||||||
|
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#questionNav" aria-controls="questionNav" aria-expanded="false" aria-label="Toggle navigation">
|
||||||
|
<span class="navbar-toggler-icon"></span>
|
||||||
|
</button>
|
||||||
|
|
||||||
|
<div class="collapse navbar-collapse" id="questionNav">
|
||||||
|
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
|
||||||
{% if exam %}
|
{% if exam %}
|
||||||
<div>
|
<li class="nav-item">
|
||||||
|
|
||||||
{% if previous > -1 %}
|
{% if previous > -1 %}
|
||||||
<a href="{% url 'anatomy:exam_question_detail' exam.id previous %}">Previous question</a>
|
<a class="nav-link" href="{% url 'anatomy:exam_question_detail' exam.id previous %}">Previous</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
Viewing question as part of exam: <a href="{% url 'anatomy:exam_overview' exam.id %}">{{exam}}</a> [{{pos}}/{{exam_length}}]
|
</li>
|
||||||
|
<li class="nav-item align-self-center">
|
||||||
|
Viewing in exam: <a class="nav-link d-inline p-0" href="{% url 'anatomy:exam_overview' exam.id %}">{{ exam }}</a>
|
||||||
|
<span class="navbar-text text-muted ms-2">[{{ pos }}/{{ exam_length }}]</span>
|
||||||
|
</li>
|
||||||
|
<li class="nav-item">
|
||||||
{% if next %}
|
{% if next %}
|
||||||
<a href="{% url 'anatomy:exam_question_detail' exam.id next %}">Next question</a>
|
<a class="nav-link" href="{% url 'anatomy:exam_question_detail' exam.id next %}">Next</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</li>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<ul class="navbar-nav ms-auto">
|
||||||
|
<li class="nav-item dropdown">
|
||||||
|
<a class="nav-link dropdown-toggle" href="#" id="questionActions" role="button" data-bs-toggle="dropdown" aria-expanded="false">Actions</a>
|
||||||
|
<ul class="dropdown-menu dropdown-menu-end dropdown-menu-dark" aria-labelledby="questionActions">
|
||||||
|
<li><a class="dropdown-item" href="{% url 'anatomy:anatomy_question_update' question.id %}">Edit</a></li>
|
||||||
|
<li><a class="dropdown-item" href="{% url 'anatomy:question_clone' question.id %}">Clone</a></li>
|
||||||
|
<li><a class="dropdown-item" href="{% url 'anatomy:question_delete' pk=question.pk %}">Delete</a></li>
|
||||||
|
<li><a class="dropdown-item" href="{% url 'anatomy:question_answer_update' pk=question.pk %}">Edit Answers</a></li>
|
||||||
|
<li><a class="dropdown-item" href="#" onclick="return window.create_popup_window('{% url 'feedback_create' question_type='anatomy' pk=question.pk %}')">Add Note</a></li>
|
||||||
|
{% if request.user.is_superuser %}
|
||||||
|
<li><hr class="dropdown-divider"></li>
|
||||||
|
<li><a class="dropdown-item" href="{% url 'admin:anatomy_anatomyquestion_change' question.id %}">Admin Edit</a></li>
|
||||||
|
<li><a class="dropdown-item" href="{% url 'anatomy:question_user_answers' question.id %}">User answers</a></li>
|
||||||
|
{% endif %}
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
</nav>
|
||||||
Reference in New Issue
Block a user