some visual improvements

This commit is contained in:
Ross
2023-12-11 10:23:37 +00:00
parent 976f57ac20
commit ee013b6dbd
4 changed files with 77 additions and 50 deletions
+10 -1
View File
@@ -25,11 +25,20 @@ from easy_thumbnails.exceptions import InvalidImageFormatError
class CaseTable(tables.Table):
def get_view_cell(record):
if record.open_access:
return format_html(f"""<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-opencollective" viewBox="0 0 16 16">
<path fill-opacity=".4" d="M12.995 8.195c0 .937-.312 1.912-.78 2.693l1.99 1.99c.976-1.327 1.6-2.966 1.6-4.683 0-1.795-.624-3.434-1.561-4.76l-2.068 2.028c.468.781.78 1.679.78 2.732h.04Z"/>
<path d="M8 13.151a4.995 4.995 0 1 1 0-9.99c1.015 0 1.951.273 2.732.82l1.95-2.03a7.805 7.805 0 1 0 .04 12.449l-1.951-2.03a5.072 5.072 0 0 1-2.732.781z"/>
</svg> View""")
else:
return f'View'
edit = tables.LinkColumn(
"atlas:case_update", text="Edit", args=[A("pk")], orderable=False
)
view = tables.LinkColumn(
"atlas:case_detail", text="View", args=[A("pk")], orderable=False
"atlas:case_detail", text=get_view_cell, args=[A("pk")], orderable=False
)
clone = tables.LinkColumn(
"atlas:case_clone", text="Clone", args=[A("pk")], orderable=False
+10 -3
View File
@@ -9,13 +9,13 @@
{% if not group %}
<a href="{% url 'generic:cid_group_detail' cidusergroup.pk %}">Group</a> /
<a href="{% url 'generic:cid_group_update' cidusergroup.pk %}">Edit Users</a> /
<a href="{% url 'generic:cid_group_update' cidusergroup.pk %}">Edit Group</a> /
<a href="{% url 'generic:cid_group_exams' cidusergroup.pk %}">Edit Exams</a> /
<a href="{% url 'generic:cid_group_delete' cidusergroup.pk %}">Delete</a>
{% else %}
<a href="{% url 'generic:cid_group_detail' group.pk %}">Group</a> /
<a href="{% url 'generic:cid_group_update' group.pk %}">Edit Users</a> /
<a href="{% url 'generic:cid_group_update' group.pk %}">Edit Group</a> /
<a href="{% url 'generic:cid_group_exams' group.pk %}">Edit Exams</a> /
<a href="{% url 'generic:cid_group_delete' group.pk %}">Delete</a>
{% endif %}
@@ -26,9 +26,16 @@
<br/>
Group: {{group.name}}->
<a href="{% url 'generic:user_group_detail' group.pk %}">Group</a> /
<a href="{% url 'generic:user_group_update' group.pk %}">Edit Users</a> /
<a href="{% url 'generic:user_group_update' group.pk %}">Edit Group</a> /
<a href="{% url 'generic:user_group_exams' group.pk %}">Edit Exams</a> /
<a href="{% url 'generic:user_group_delete' group.pk %}">Delete</a>
{% elif userusergroup %}
<br/>
Group: {{group.name}}->
<a href="{% url 'generic:user_group_detail' userusergroup.pk %}">Group</a> /
<a href="{% url 'generic:user_group_update' userusergroup.pk %}">Edit Group</a> /
<a href="{% url 'generic:user_group_exams' userusergroup.pk %}">Edit Exams</a> /
<a href="{% url 'generic:user_group_delete' userusergroup.pk %}">Delete</a>
{% endif %}
{% endif %}
@@ -1,4 +1,4 @@
{% extends "generic/base.html" %}
{% extends "generic/cid_group_base.html" %}
<!-- {% load static from static %} -->
{% load crispy_forms_tags %}
+56 -45
View File
@@ -8,10 +8,12 @@
{% for exam in exams %}
{% if exam.active %}
<li class="exam-item">
<a href="{% url app_name|add:':exam_overview' pk=exam.pk %}" class="flex-col-2 exam-name">{{exam.name}}</a>
<a href="{% url app_name|add:':exam_overview' pk=exam.pk %}" class="flex-col-2 exam-name">{{exam.name}}</a>
{% if marking %}<a href="{% url app_name|add:':mark_overview' pk=exam.pk %}" class="flex-col">Mark</a>{% endif %}
<a href="{% url app_name|add:':exam_cids' exam_id=exam.pk %}" class="flex-col">Candidates</a>
<a href="{% url app_name|add:':exam_scores_all' pk=exam.pk %}" class="flex-col">Scores</a>
<span class="flex-col">
<a href="{% url app_name|add:':exam_cids' exam_id=exam.pk %}">Candidates</a> <span class="candidate-counts">[{{exam.valid_cid_users.count}} / {{exam.valid_user_users.count}}]</span>
</span>
<a href="{% url app_name|add:':exam_scores_all' pk=exam.pk %}" class="flex-col">Scores</a>
<input type="checkbox" id="active-{{exam.pk}}" class="exam-active-switch" data-posturl="{% url app_name|add:':exam_toggle_active' pk=exam.pk %}" {% if exam.active %}checked{% endif %}>
<label for="active-{{exam.pk}}" class="flex-col icon-container active-icon" title="Click to toggle active state">Exam Active</label>
<input type="checkbox" id="published-{{exam.pk}}" class="exam-publish-results-switch" data-posturl="{% url app_name|add:':exam_toggle_results_published' pk=exam.pk %}" {% if exam.publish_results %}checked{% endif %}>
@@ -30,10 +32,10 @@
{% for exam in exams %}
{% if not exam.active %}
<li class="exam-item">
<a href="{% url app_name|add:':exam_overview' pk=exam.pk %}" class="flex-col-2 exam-name">{{exam.name}}</a>
<a href="{% url app_name|add:':exam_overview' pk=exam.pk %}" class="flex-col-2 exam-name">{{exam.name}}</a>
{% if marking %}<a href="{% url app_name|add:':mark_overview' pk=exam.pk %}" class="flex-col">Mark</a>{% endif %}
<a href="{% url app_name|add:':exam_cids' exam_id=exam.pk %}" class="flex-col">Candidates</a>
<a href="{% url app_name|add:':exam_scores_all' pk=exam.pk %}" class="flex-col">Scores</a>
<a href="{% url app_name|add:':exam_cids' exam_id=exam.pk %}" class="flex-col">Candidates</a>
<a href="{% url app_name|add:':exam_scores_all' pk=exam.pk %}" class="flex-col">Scores</a>
<input type="checkbox" id="active-{{exam.pk}}" class="exam-active-switch" data-posturl="{% url app_name|add:':exam_toggle_active' pk=exam.pk %}" {% if exam.active %}checked{% endif %}>
<label for="active-{{exam.pk}}" class="flex-col icon-container active-icon" title="Click to toggle active state">Exam Active</label>
<input type="checkbox" id="{{exam.pk}}-pub" class="exam-publish-results-switch" data-posturl="{% url app_name|add:':exam_toggle_results_published' pk=exam.pk %}" {% if exam.publish_results %}checked{% endif %}>
@@ -57,52 +59,61 @@
{% include 'exam_overview_js.html' %}
<style>
.candidate-counts {
font-size: small;
opacity: 50%;
}
.published-icon, .active-icon, .archived-icon {
border: 1px dotted gray;
opacity: 20%;
border-radius: 4px;
display: inline-block;
user-select: none;
-webkit-user-select: none;
-moz-user-select: none;
text-align: center;
}
.exam-list li:hover .candidate-counts {
opacity: 100%;
color: purple;
}
.published-icon:hover, .active-icon:hover, .archived-icon:hover {
opacity: 100%;
}
.published-icon, .active-icon, .archived-icon {
border: 1px dotted gray;
opacity: 20%;
border-radius: 4px;
display: inline-block;
user-select: none;
-webkit-user-select: none;
-moz-user-select: none;
text-align: center;
}
.exam-active-switch:checked + .active-icon {
border: 1px solid green;
color: green;
opacity: 100%;
display: inline-block;
}
.published-icon:hover, .active-icon:hover, .archived-icon:hover {
opacity: 100%;
}
.exam-publish-results-switch:checked + .published-icon {
border: 1px solid purple;
color: purple;
opacity: 100%;
display: inline-block;
}
.exam-active-switch:checked + .active-icon {
border: 1px solid green;
color: green;
opacity: 100%;
display: inline-block;
}
.exam-archived-switch:checked + .archived-icon {
border: 1px solid darkblue;
color: darkblue;
opacity: 100%;
display: inline-block;
}
.exam-publish-results-switch:checked + .published-icon {
border: 1px solid purple;
color: purple;
opacity: 100%;
display: inline-block;
}
.exam-publish-results-switch, .exam-active-switch, .exam-archived-switch {
display: none;
}
.exam-archived-switch:checked + .archived-icon {
border: 1px solid darkblue;
color: darkblue;
opacity: 100%;
display: inline-block;
}
.exam-list li:hover {
border: 1px dashed gray;
margin: -1px;
}
</style>
.exam-publish-results-switch, .exam-active-switch, .exam-archived-switch {
display: none;
}
.exam-list li:hover {
border: 1px dashed gray;
margin: -1px;
}
</style>
{% endblock %}