This commit is contained in:
Ross
2022-05-25 16:50:18 +01:00
parent 41a09ea30d
commit 5701c8d613
30 changed files with 402 additions and 226 deletions
+6
View File
@@ -846,4 +846,10 @@ summary h5 {
button a, button a:link, button a:visited, button a:hover {
text-decoration: none;
color: inherit;
}
details.filter {
border: 1px solid gray;
padding: 10px;
margin: 20px;
}
+9
View File
@@ -55,6 +55,15 @@ class AnatomyQuestionTable(tables.Table):
"author",
)
sequence = ("view", "image", "exams")
def __init__(self, data=None, *args, **kwargs):
super().__init__(
data.prefetch_related(
"answers", "question_type", "body_part", "modality", "region", "examination", "exams", "author"
),
*args,
**kwargs,
)
class AnatomyUserAnswerTable(tables.Table):
select = tables.CheckBoxColumn(accessor=("pk"))
delete = tables.LinkColumn(
@@ -1,18 +0,0 @@
{% extends 'anatomy/base.html' %}
{% load render_table from django_tables2 %}
{% block css %}
{% endblock %}
{% block content %}
<div id="view-filter-options">
<h3>Filter Anatomy Questions</h3>
<form action="" method="get">
{{ filter.form }}
<input class="btn btn-primary btn-sm mt-1 mb-1" type="submit" />
</form>
</div>
{% render_table table %}
{% endblock %}
-30
View File
@@ -1,30 +0,0 @@
{% extends 'anatomy/base.html' %}
{% block content %}
<h1>Examinations</h1>
<div class="anatomy">
Active exams:<br/>
<ul class="exam-list">
{% for exam in exams %}
{% if exam.active %}
<li>
<a href="{% url 'anatomy:exam_overview' pk=exam.pk %}" class="flex-col">{{exam.name}}</a> <a href="{% url 'anatomy:mark_overview' pk=exam.pk %}" class="flex-col">Mark</a><a href="{% url 'anatomy:exam_scores_cid' pk=exam.pk %}" class="flex-col">Scores</a> <span class="flex-col icon-container"><span class="published-icon {% if exam.publish_results %}published{% endif %}">Results Published</span></span>
</li>
{% endif %}
{% endfor %}
</ul>
Inactive exams:<br/>
<ul class="exam-list">
{% for exam in exams %}
{% if not exam.active %}
<li>
<a href="{% url 'anatomy:exam_overview' pk=exam.pk %}" class="flex-col">{{exam.name}}</a> <a href="{% url 'anatomy:mark_overview' pk=exam.pk %}" class="flex-col">Mark</a><a href="{% url 'anatomy:exam_scores_cid' pk=exam.pk %}" class="flex-col">Scores</a> <span class="flex-col icon-container"><span class="published-icon {% if exam.publish_results %}published{% endif %}">Results Published</span></span>
</li>
{% endif %}
{% endfor %}
</ul>
</div>
{% endblock %}
+6 -1
View File
@@ -902,10 +902,15 @@ def get_structure_id(request):
class AnatomyQuestionView(LoginRequiredMixin, SingleTableMixin, FilterView):
model = AnatomyQuestion
table_class = AnatomyQuestionTable
template_name = "anatomy/view.html"
template_name = "question_table_view.html"
filterset_class = AnatomyQuestionFilter
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
context["app_name"] = "anatomy"
return context
# def get_queryset(self):
# qs = super().get_queryset()