some visual improvements
This commit is contained in:
+10
-1
@@ -25,11 +25,20 @@ from easy_thumbnails.exceptions import InvalidImageFormatError
|
|||||||
|
|
||||||
|
|
||||||
class CaseTable(tables.Table):
|
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(
|
edit = tables.LinkColumn(
|
||||||
"atlas:case_update", text="Edit", args=[A("pk")], orderable=False
|
"atlas:case_update", text="Edit", args=[A("pk")], orderable=False
|
||||||
)
|
)
|
||||||
view = tables.LinkColumn(
|
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(
|
clone = tables.LinkColumn(
|
||||||
"atlas:case_clone", text="Clone", args=[A("pk")], orderable=False
|
"atlas:case_clone", text="Clone", args=[A("pk")], orderable=False
|
||||||
|
|||||||
@@ -9,13 +9,13 @@
|
|||||||
|
|
||||||
{% if not group %}
|
{% if not group %}
|
||||||
<a href="{% url 'generic:cid_group_detail' cidusergroup.pk %}">Group</a> /
|
<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_exams' cidusergroup.pk %}">Edit Exams</a> /
|
||||||
<a href="{% url 'generic:cid_group_delete' cidusergroup.pk %}">Delete</a>
|
<a href="{% url 'generic:cid_group_delete' cidusergroup.pk %}">Delete</a>
|
||||||
|
|
||||||
{% else %}
|
{% else %}
|
||||||
<a href="{% url 'generic:cid_group_detail' group.pk %}">Group</a> /
|
<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_exams' group.pk %}">Edit Exams</a> /
|
||||||
<a href="{% url 'generic:cid_group_delete' group.pk %}">Delete</a>
|
<a href="{% url 'generic:cid_group_delete' group.pk %}">Delete</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@@ -26,9 +26,16 @@
|
|||||||
<br/>
|
<br/>
|
||||||
Group: {{group.name}}->
|
Group: {{group.name}}->
|
||||||
<a href="{% url 'generic:user_group_detail' group.pk %}">Group</a> /
|
<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_exams' group.pk %}">Edit Exams</a> /
|
||||||
<a href="{% url 'generic:user_group_delete' group.pk %}">Delete</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 %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
{% extends "generic/base.html" %}
|
{% extends "generic/cid_group_base.html" %}
|
||||||
<!-- {% load static from static %} -->
|
<!-- {% load static from static %} -->
|
||||||
{% load crispy_forms_tags %}
|
{% load crispy_forms_tags %}
|
||||||
|
|
||||||
|
|||||||
+56
-45
@@ -8,10 +8,12 @@
|
|||||||
{% for exam in exams %}
|
{% for exam in exams %}
|
||||||
{% if exam.active %}
|
{% if exam.active %}
|
||||||
<li class="exam-item">
|
<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 %}
|
{% 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>
|
<span class="flex-col">
|
||||||
<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 %}">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 %}>
|
<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>
|
<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 %}>
|
<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 %}
|
{% for exam in exams %}
|
||||||
{% if not exam.active %}
|
{% if not exam.active %}
|
||||||
<li class="exam-item">
|
<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 %}
|
{% 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_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_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 %}>
|
<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>
|
<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 %}>
|
<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' %}
|
{% include 'exam_overview_js.html' %}
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
.candidate-counts {
|
||||||
|
font-size: small;
|
||||||
|
opacity: 50%;
|
||||||
|
}
|
||||||
|
|
||||||
.published-icon, .active-icon, .archived-icon {
|
.exam-list li:hover .candidate-counts {
|
||||||
border: 1px dotted gray;
|
opacity: 100%;
|
||||||
opacity: 20%;
|
color: purple;
|
||||||
border-radius: 4px;
|
}
|
||||||
display: inline-block;
|
|
||||||
user-select: none;
|
|
||||||
-webkit-user-select: none;
|
|
||||||
-moz-user-select: none;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.published-icon:hover, .active-icon:hover, .archived-icon:hover {
|
.published-icon, .active-icon, .archived-icon {
|
||||||
opacity: 100%;
|
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 {
|
.published-icon:hover, .active-icon:hover, .archived-icon:hover {
|
||||||
border: 1px solid green;
|
opacity: 100%;
|
||||||
color: green;
|
}
|
||||||
opacity: 100%;
|
|
||||||
display: inline-block;
|
|
||||||
}
|
|
||||||
|
|
||||||
.exam-publish-results-switch:checked + .published-icon {
|
.exam-active-switch:checked + .active-icon {
|
||||||
border: 1px solid purple;
|
border: 1px solid green;
|
||||||
color: purple;
|
color: green;
|
||||||
opacity: 100%;
|
opacity: 100%;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
}
|
}
|
||||||
|
|
||||||
.exam-archived-switch:checked + .archived-icon {
|
.exam-publish-results-switch:checked + .published-icon {
|
||||||
border: 1px solid darkblue;
|
border: 1px solid purple;
|
||||||
color: darkblue;
|
color: purple;
|
||||||
opacity: 100%;
|
opacity: 100%;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
}
|
}
|
||||||
|
|
||||||
.exam-publish-results-switch, .exam-active-switch, .exam-archived-switch {
|
.exam-archived-switch:checked + .archived-icon {
|
||||||
display: none;
|
border: 1px solid darkblue;
|
||||||
}
|
color: darkblue;
|
||||||
|
opacity: 100%;
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
|
||||||
.exam-list li:hover {
|
.exam-publish-results-switch, .exam-active-switch, .exam-archived-switch {
|
||||||
border: 1px dashed gray;
|
display: none;
|
||||||
margin: -1px;
|
}
|
||||||
}
|
|
||||||
</style>
|
.exam-list li:hover {
|
||||||
|
border: 1px dashed gray;
|
||||||
|
margin: -1px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user