inital case selection widget

This commit is contained in:
Ross
2024-11-11 13:36:53 +00:00
parent a65ceffbfb
commit ed933c8104
5 changed files with 67 additions and 10 deletions
@@ -0,0 +1,19 @@
<details>
<summary>Cases</summary>
<ul>
{% for group_name, group_choices, group_index in widget.optgroups %}
{% for widget in group_choices %}
{% include widget.template_name %}
{{ widget.instance }}
{% endfor %}
{% endfor %}
</ul>
</detailS>
<select name="{{ widget.name }}"{% include "django/forms/widgets/attrs.html" %}>{% for group_name, group_choices, group_index in widget.optgroups %}{% if group_name %}
<optgroup label="{{ group_name }}">{% endif %}{% for widget in group_choices %}
{% include widget.template_name %}{% endfor %}{% if group_name %}
</optgroup>{% endif %}{% endfor %}
</select>
+30 -3
View File
@@ -18,10 +18,11 @@
{% for series, n, tags, date in series_list %}
<li>
<span _="
on click toggle .selected on me
on click toggle .selected on me.closest('li')
then set i to the first <input/> in me
then set i.checked to not i.checked" >
{{date}}: {{series}} [{{n}} images] <br/>
Uploaded: {{date}}<br/>
Series: {{series}} [{{n}} images] <br/>
{{tags}}
<input class="hidden" type="checkbox" name="selection" value="{{ series }}">
</span>
@@ -34,7 +35,7 @@
</ul>
{% if case %}
<p>Importing into case {{case}}</p>
<p>Importing into case: <a href='{% url "atlas:case_detail" case.pk %}'>{{case}}</a></p>
{% endif %}
<details><summary>Upload settings</summary>
<form>
@@ -93,3 +94,29 @@
<p><a href="{% url 'atlas:series_view' %}?case=null&sort=-modified_date">View orphan series</a></p>
{% endblock %}
{% block css %}
<style>
#series-list {
user-select: none;
cursor: pointer;
}
#series-list li {
}
#series-list .selected {
color: white;
border: 1px solid #52057b;
user-select: none;
margin: -1px;
}
.series-block-popup-link {
float: right;
}
</style>
{% endblock css %}