Skip to content
Snippets Groups Projects
Commit d304b8dc authored by Benjamin Hättasch's avatar Benjamin Hättasch
Browse files

Improve treatment of wishes

Add visualization to ak list and detail page
Add option to treat them as an own category on submission overview
parent 0ef613db
No related branches found
No related tags found
No related merge requests found
...@@ -137,3 +137,6 @@ BOOTSTRAP4 = { ...@@ -137,3 +137,6 @@ BOOTSTRAP4 = {
# Settings for FontAwesome # Settings for FontAwesome
FONTAWESOME_CSS_URL = "//cdnjs.cloudflare.com/ajax/libs/font-awesome/5.11.2/css/all.css" FONTAWESOME_CSS_URL = "//cdnjs.cloudflare.com/ajax/libs/font-awesome/5.11.2/css/all.css"
# Treat wishes as seperate category in submission views?
WISHES_AS_CATEGORY = True
...@@ -8,7 +8,7 @@ msgid "" ...@@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-10-18 22:22+0000\n" "POT-Creation-Date: 2019-10-21 22:38+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
...@@ -28,6 +28,11 @@ msgstr "" ...@@ -28,6 +28,11 @@ msgstr ""
msgid "AK Submission" msgid "AK Submission"
msgstr "AK-Eintragung" msgstr "AK-Eintragung"
#: templates/AKSubmission/ak_detail.html:27
#: templates/AKSubmission/ak_list_table.html:30
msgid "AK Wish"
msgstr "AK-Wunsch"
#: templates/AKSubmission/ak_detail.html:30 #: templates/AKSubmission/ak_detail.html:30
#: templates/AKSubmission/ak_list_table.html:10 #: templates/AKSubmission/ak_list_table.html:10
msgid "Who?" msgid "Who?"
...@@ -87,7 +92,9 @@ msgstr "Reso" ...@@ -87,7 +92,9 @@ msgstr "Reso"
#: templates/AKSubmission/submission_overview.html:17 #: templates/AKSubmission/submission_overview.html:17
msgid "" msgid ""
"On this page you can see a list of current AKs, change them and add new ones." "On this page you can see a list of current AKs, change them and add new ones."
msgstr "Auf dieser Seite kannst du eine Liste von aktuellen AKs sehen, diese bearbeiten und neue hinzufügen." msgstr ""
"Auf dieser Seite kannst du eine Liste von aktuellen AKs sehen, diese "
"bearbeiten und neue hinzufügen."
#: templates/AKSubmission/submission_overview.html:20 #: templates/AKSubmission/submission_overview.html:20
msgid "Submit" msgid "Submit"
...@@ -104,3 +111,13 @@ msgstr "Neuer AK-Wunsch" ...@@ -104,3 +111,13 @@ msgstr "Neuer AK-Wunsch"
#: templates/AKSubmission/submission_overview.html:26 #: templates/AKSubmission/submission_overview.html:26
msgid "Current AKs" msgid "Current AKs"
msgstr "Aktuelle AKs" msgstr "Aktuelle AKs"
#: views.py:33
msgid "Wishes"
msgstr "Wünsche"
#: views.py:33
msgid "AKs one would like to have"
msgstr ""
"AKs die sich gewünscht wurden, aber bei denen noch nicht klar ist, wer sie "
"macht. Falls du dir das vorstellen kannst, trag dich einfach ein"
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
<a href="#" class="btn btn-success">{% fontawesome_icon 'pencil-alt' %}</a> <a href="#" class="btn btn-success">{% fontawesome_icon 'pencil-alt' %}</a>
</div> </div>
<h2>{{ ak.name }}</h2> <h2>{% if ak.wish %}{% trans "AK Wish" %}: {% endif %}{{ ak.name }}</h2>
<table class="table table-borderless"> <table class="table table-borderless">
<tr><td>{% trans "Who?" %}</td><td>{{ ak.owners_list }}</td></tr> <tr><td>{% trans "Who?" %}</td><td>{{ ak.owners_list }}</td></tr>
......
...@@ -25,7 +25,13 @@ ...@@ -25,7 +25,13 @@
<span class="badge badge-dark badge-pill" title="{% trans 'Reso' %}">{% fontawesome_icon "scroll" %}</span> <span class="badge badge-dark badge-pill" title="{% trans 'Reso' %}">{% fontawesome_icon "scroll" %}</span>
{% endif %} {% endif %}
</td> </td>
<td>{{ ak.owners_list }}</td> <td>
{% if ak.wish %}
<span class="badge badge-dark badge-pill">{% trans "AK Wish" %}</span>
{% else %}
{{ ak.owners_list }}
{% endif %}
</td>
<td>{% category_linked_badge ak.category event.slug %}</td> <td>{% category_linked_badge ak.category event.slug %}</td>
<td>{% tag_list ak.tags.all event.slug %}</td> <td>{% tag_list ak.tags.all event.slug %}</td>
<td class="text-right"> <td class="text-right">
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
<ul class="nav nav-tabs" style="margin-bottom:15px"> <ul class="nav nav-tabs" style="margin-bottom:15px">
{% for category, _ in categories %} {% for category, _ in categories %}
<li class="nav-item"> <li class="nav-item">
<a class="nav-link {% if forloop.first %}active{% endif %}" data-toggle="tab" href="#category_{{ category.pk }}">{{ category }}</a> <a class="nav-link {% if forloop.first %}active{% endif %}" data-toggle="tab" href="#category_{{ category.pk }}">{{ category.name }}</a>
</li> </li>
{% endfor %} {% endfor %}
</ul> </ul>
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
<div id="akListTabbed" class="tab-content"> <div id="akListTabbed" class="tab-content">
{% for category, AKs in categories %} {% for category, AKs in categories %}
<div class="tab-pane fade {% if forloop.first %}show active{% endif %}" id="category_{{ category.pk }}"> <div class="tab-pane fade {% if forloop.first %}show active{% endif %}" id="category_{{ category.pk }}">
<p><b>{{ category }}:</b> {{ category.description }}</p> <p><b>{{ category.name }}:</b> {{ category.description }}</p>
{% include "AKSubmission/ak_list_table.html" %} {% include "AKSubmission/ak_list_table.html" %}
</div> </div>
{% endfor %} {% endfor %}
......
...@@ -4,6 +4,7 @@ from django.views.generic import ListView, DetailView ...@@ -4,6 +4,7 @@ from django.views.generic import ListView, DetailView
from AKModel.models import AK, AKCategory, AKTag from AKModel.models import AK, AKCategory, AKTag
from AKModel.views import FilterByEventSlugMixin from AKModel.views import FilterByEventSlugMixin
from django.conf import settings
class SubmissionOverviewView(FilterByEventSlugMixin, ListView): class SubmissionOverviewView(FilterByEventSlugMixin, ListView):
...@@ -18,13 +19,20 @@ class SubmissionOverviewView(FilterByEventSlugMixin, ListView): ...@@ -18,13 +19,20 @@ class SubmissionOverviewView(FilterByEventSlugMixin, ListView):
# Sort AKs into different lists (by their category) # Sort AKs into different lists (by their category)
categories = [] categories = []
aks_for_category = [] aks_for_category = []
ak_wishes = []
current_category = None current_category = None
for ak in context["AKs"]: for ak in context["AKs"]:
if ak.category != current_category: if ak.category != current_category:
current_category = ak.category current_category = ak.category
aks_for_category = [] aks_for_category = []
categories.append((current_category, aks_for_category)) categories.append((current_category, aks_for_category))
aks_for_category.append(ak) if settings.WISHES_AS_CATEGORY and ak.wish:
ak_wishes.append(ak)
else:
aks_for_category.append(ak)
if settings.WISHES_AS_CATEGORY:
categories.append(({"name":_("Wishes"), "pk": "wish", "description": _("AKs one would like to have")}, ak_wishes))
context["categories"] = categories context["categories"] = categories
return context return context
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment