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

Merge branch 'master' into submission_form

Resolve conflicts (AKSubmission views and translations)
Add merge migration
Fix owner slug migration for existing entries
parents 5297e479 1dc17247
No related branches found
No related tags found
1 merge request!4Submission form
Showing
with 306 additions and 95 deletions
......@@ -2,7 +2,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-10-18 13:01+0000\n"
"POT-Creation-Date: 2019-10-20 17:51+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
......@@ -11,13 +11,13 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: availability.py:38 models.py:20 models.py:40 models.py:104 models.py:152
#: models.py:183 models.py:208
#: availability.py:38 models.py:20 models.py:40 models.py:105 models.py:153
#: models.py:184 models.py:209
msgid "Event"
msgstr "Event"
#: availability.py:39 models.py:41 models.py:105 models.py:153 models.py:184
#: models.py:209
#: availability.py:39 models.py:41 models.py:106 models.py:154 models.py:185
#: models.py:210
msgid "Associated event"
msgstr "Zugehöriges Event"
......@@ -29,7 +29,7 @@ msgstr "Person"
msgid "Person whose availability this is"
msgstr "Person deren Verfügbarkeit hier abgebildet wird"
#: availability.py:56 models.py:187 models.py:202
#: availability.py:56 models.py:188 models.py:203
msgid "Room"
msgstr "Raum"
......@@ -37,7 +37,7 @@ msgstr "Raum"
msgid "Room whose availability this is"
msgstr "Raum dessen Verfügbarkeit hier abgebildet wird"
#: availability.py:65 models.py:156 models.py:201
#: availability.py:65 models.py:157 models.py:202
msgid "AK"
msgstr "AK"
......@@ -47,7 +47,7 @@ msgstr "AK"
msgid "AK whose availability this is"
msgstr "Verfügbarkeiten"
#: availability.py:74 models.py:62
#: availability.py:74 models.py:63
msgid "AK Category"
msgstr "AK Kategorie"
......@@ -63,8 +63,8 @@ msgstr "Verfügbarkeit"
msgid "Availabilities"
msgstr "Verfügbarkeiten"
#: models.py:9 models.py:58 models.py:73 models.py:88 models.py:102
#: models.py:119 models.py:176
#: models.py:9 models.py:58 models.py:74 models.py:89 models.py:103
#: models.py:120 models.py:177
msgid "Name"
msgstr "Name"
......@@ -142,7 +142,7 @@ msgstr "Instutution"
msgid "Uni etc."
msgstr "Universität o.ä."
#: models.py:38 models.py:128
#: models.py:38 models.py:129
msgid "Web Link"
msgstr "Internet Link"
......@@ -162,231 +162,235 @@ msgstr "AK Leitungen"
msgid "Name of the AK Category"
msgstr "Name des AK Kategorie"
#: models.py:59 models.py:74
#: models.py:59 models.py:75
msgid "Color"
msgstr "Farbe"
#: models.py:59 models.py:74
#: models.py:59 models.py:75
msgid "Color for displaying"
msgstr "Farbe für die Anzeige"
#: models.py:63
#: models.py:60 models.py:123
msgid "Description"
msgstr "Beschreibung"
#: models.py:60
msgid "Short description of this AK Category"
msgstr "Beschreibung der AK-Kategorie"
#: models.py:64
msgid "AK Categories"
msgstr "AK Kategorien"
#: models.py:73
#: models.py:74
msgid "Name of the AK Track"
msgstr "Name des AK Tracks"
#: models.py:77
#: models.py:78
msgid "AK Track"
msgstr "AK Track"
#: models.py:78
#: models.py:79
msgid "AK Tracks"
msgstr "AK Tracks"
#: models.py:88
#: models.py:89
msgid "Name of the AK Tag"
msgstr "Name das AK Tags"
#: models.py:91
#: models.py:92
msgid "AK Tag"
msgstr "AK Tag"
#: models.py:92
#: models.py:93
msgid "AK Tags"
msgstr "AK Tags"
#: models.py:102
#: models.py:103
msgid "Name of the Requirement"
msgstr "Name der Anforderung"
#: models.py:108
#: models.py:109
msgid "AK Requirement"
msgstr "AK Anforderung"
#: models.py:109
#: models.py:110
msgid "AK Requirements"
msgstr "AK Anforderungen"
#: models.py:119
#: models.py:120
msgid "Name of the AK"
msgstr "Name des AKs"
#: models.py:120
#: models.py:121
msgid "Short Name"
msgstr "Kurzer Name"
#: models.py:121
#: models.py:122
msgid "Name displayed in the schedule"
msgstr "Name zur Anzeige im AK Plan"
#: models.py:122
msgid "Description"
msgstr "Beschreibung"
#: models.py:122
#: models.py:123
msgid "Description of the AK"
msgstr "Beschreibung des AKs"
#: models.py:124
#: models.py:125
msgid "Owners"
msgstr "Leitungen"
#: models.py:125
#: models.py:126
msgid "Those organizing the AK"
msgstr "Menschen, die den AK organisieren und halten"
#: models.py:128
#: models.py:129
msgid "Link to wiki page"
msgstr "Link zur Wiki Seite"
#: models.py:130
#: models.py:131
msgid "Category"
msgstr "Kategorie"
#: models.py:131
#: models.py:132
msgid "Category of the AK"
msgstr "Kategorie des AKs"
#: models.py:132
#: models.py:133
msgid "Tags"
msgstr "Tags"
#: models.py:132
#: models.py:133
msgid "Tags provided by owners"
msgstr "Tags, die durch die AK Leitung vergeben wurden"
#: models.py:133
#: models.py:134
msgid "Track"
msgstr "Track"
#: models.py:134
#: models.py:135
msgid "Track the AK belongs to"
msgstr "Track zu dem der AK gehört"
#: models.py:136
#: models.py:137
msgid "Resolution Intention"
msgstr "Resolutionsabsicht"
#: models.py:137
#: models.py:138
msgid "Intends to submit a resolution"
msgstr "Beabsichtigt eine Resolution einzureichen"
#: models.py:138
#: models.py:139
msgid "Present this AK"
msgstr "AK Präsentieren"
#: models.py:138
#: models.py:139
msgid "Present results of this AK"
msgstr "Die Ergebnisse dieses AKs vorstellen"
#: models.py:140
#: models.py:141
msgid "Requirements"
msgstr "Anforderungen"
#: models.py:141
#: models.py:142
msgid "AK's Requirements"
msgstr "Anforderungen des AKs"
#: models.py:143
#: models.py:144
msgid "Conflicting AKs"
msgstr "AK Konflikte"
#: models.py:144
#: models.py:145
msgid "AKs that conflict and thus must not take place at the same time"
msgstr ""
"AKs, die Konflikte haben und deshalb nicht gleichzeitig stattfinden dürfen"
#: models.py:145
#: models.py:146
msgid "Prerequisite AKs"
msgstr "Vorausgesetzte AKs"
#: models.py:146
#: models.py:147
msgid "AKs that should precede this AK in the schedule"
msgstr "AKS die im AK Plan vor diesem AK stattfinden müssen"
#: models.py:148
#: models.py:149
msgid "Internal Notes"
msgstr "Interne Notizen"
#: models.py:148
#: models.py:149
msgid "Notes to organizers"
msgstr "Notizen an die Organisator*innen"
#: models.py:150
#: models.py:151
msgid "Interest"
msgstr "Interesse"
#: models.py:150
#: models.py:151
msgid "Expected number of people"
msgstr "Erwartete Personenzahl"
#: models.py:157
#: models.py:158
msgid "AKs"
msgstr "AKs"
#: models.py:176
#: models.py:177
msgid "Name or number of the room"
msgstr "Name oder Nummer des Raums"
#: models.py:177
#: models.py:178
msgid "Building"
msgstr "Gebäude"
#: models.py:178
#: models.py:179
msgid "Name or number of the building"
msgstr "Name oder Nummer des Gebäudes"
#: models.py:179
#: models.py:180
msgid "Capacity"
msgstr "Kapazität"
#: models.py:179
#: models.py:180
msgid "Maximum number of people"
msgstr "Maximale Personenzahl"
#: models.py:180
#: models.py:181
msgid "Properties"
msgstr "Eigenschaften"
#: models.py:181
#: models.py:182
msgid "AK requirements fulfilled by the room"
msgstr "AK Anforderungen, die dieser Raum erfüllt"
#: models.py:188
#: models.py:189
msgid "Rooms"
msgstr "Räume"
#: models.py:201
#: models.py:202
msgid "AK being mapped"
msgstr "AK, der zugeordnet wird"
#: models.py:203
#: models.py:204
msgid "Room the AK will take place in"
msgstr "Raum in dem der AK stattfindet"
#: models.py:204
#: models.py:205
msgid "Slot Begin"
msgstr "Beginn des Slots"
#: models.py:204
#: models.py:205
msgid "Time and date the slot begins"
msgstr "Zeit und Datum zu der der AK beginnt"
#: models.py:205
#: models.py:206
msgid "Duration"
msgstr "Dauer"
#: models.py:206
#: models.py:207
msgid "Length in hours"
msgstr "Länge in Stunden"
#: models.py:212
#: models.py:213
msgid "AK Slot"
msgstr "AK Slot"
#: models.py:213
#: models.py:214
msgid "AK Slots"
msgstr "AK Slot"
# Generated by Django 2.2.6 on 2019-10-20 17:47
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('AKModel', '0015_ak_present_field'),
]
operations = [
migrations.AddField(
model_name='akcategory',
name='description',
field=models.TextField(blank=True, help_text='Short description of this AK Category', verbose_name='Description'),
),
]
......@@ -2,6 +2,15 @@
from django.db import migrations, models
from AKModel.models import AKOwner
def migrate_data_forward(apps, schema_editor):
for instance in AKOwner.objects.all():
if instance.slug == '':
instance.slug = instance._generate_slug()
instance.save() # Will trigger slug update
class Migration(migrations.Migration):
......@@ -13,11 +22,20 @@ class Migration(migrations.Migration):
migrations.AddField(
model_name='akowner',
name='slug',
field=models.SlugField(blank=True, help_text='Slug for URL generation', max_length=64, unique=True, verbose_name='Slug'),
field=models.SlugField(blank=True, help_text='Slug for URL generation', max_length=64, verbose_name='Slug'),
),
migrations.AlterField(
model_name='akowner',
name='name',
field=models.CharField(help_text='Name to identify an AK owner by', max_length=64, verbose_name='Nickname'),
),
migrations.RunPython(
migrate_data_forward,
migrations.RunPython.noop,
),
migrations.AlterField(
model_name='akowner',
name='slug',
field=models.SlugField(blank=True, help_text='Slug for URL generation', unique=True, max_length=64, verbose_name='Slug')
)
]
# Generated by Django 2.2.6 on 2019-10-23 22:27
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('AKModel', '0016_category_description'),
('AKModel', '0017_owner_slug'),
]
operations = [
]
......@@ -91,6 +91,7 @@ class AKCategory(models.Model):
"""
name = models.CharField(max_length=64, unique=True, verbose_name=_('Name'), help_text=_('Name of the AK Category'))
color = models.CharField(max_length=7, blank=True, verbose_name=_('Color'), help_text=_('Color for displaying'))
description = models.TextField(blank=True, verbose_name=_("Description"), help_text=_("Short description of this AK Category"))
class Meta:
verbose_name = _('AK Category')
......
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-10-20 08:43+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: settings.py:124
msgid "German"
msgstr "Deutsch"
#: settings.py:125
msgid "English"
msgstr "Englisch"
......@@ -11,6 +11,8 @@ https://docs.djangoproject.com/en/2.2/ref/settings/
"""
import os
from django.utils.translation import gettext_lazy as _
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
......@@ -108,7 +110,7 @@ AUTH_PASSWORD_VALIDATORS = [
# Internationalization
# https://docs.djangoproject.com/en/2.2/topics/i18n/
LANGUAGE_CODE = 'en-us'
LANGUAGE_CODE = 'en-US'
TIME_ZONE = 'UTC'
......@@ -118,6 +120,11 @@ USE_L10N = True
USE_TZ = True
LANGUAGES = [
('de', _('German')),
('en', _('English')),
]
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/2.2/howto/static-files/
......@@ -137,3 +144,6 @@ BOOTSTRAP4 = {
# Settings for FontAwesome
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
......@@ -19,4 +19,5 @@ from django.urls import path, include
urlpatterns = [
path('admin/', admin.site.urls),
path('', include('AKSubmission.urls', namespace='submit')),
path('i18n/', include('django.conf.urls.i18n')),
]
......@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-10-19 00:30+0000\n"
"POT-Creation-Date: 2019-10-23 22:25+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
......@@ -22,13 +22,20 @@ msgstr ""
#: templates/AKSubmission/ak_detail.html:18
#: templates/AKSubmission/ak_list.html:8 templates/AKSubmission/ak_list.html:13
#: templates/AKSubmission/ak_list.html:18
#: templates/AKSubmission/akowner_create_select.html:13
#: templates/AKSubmission/submission_overview.html:6
#: templates/AKSubmission/submission_overview.html:11
#: templates/AKSubmission/submission_overview.html:15
#: templates/AKSubmission/submit_new.html:12
#: templates/AKSubmission/submit_new.html:13
#: templates/AKSubmission/submit_new_wish.html:10
msgid "AK Submission"
msgstr "AK-Eintragung"
#: templates/AKSubmission/ak_detail.html:29
#: templates/AKSubmission/ak_list_table.html:30
msgid "AK Wish"
msgstr "AK-Wunsch"
#: templates/AKSubmission/ak_detail.html:32
#: templates/AKSubmission/ak_list_table.html:10
msgid "Who?"
......@@ -85,6 +92,26 @@ msgstr "Diesen AK vorstellen"
msgid "Reso"
msgstr "Reso"
#: templates/AKSubmission/akowner_create_select.html:7
#: templates/AKSubmission/akowner_create_select.html:19
msgid "AK Owner"
msgstr ""
#: templates/AKSubmission/akowner_create_select.html:25
#: templates/AKSubmission/submit_new.html:27
msgid "Reset"
msgstr "Zurücksetzen"
#: templates/AKSubmission/akowner_create_select.html:29
#: templates/AKSubmission/submit_new.html:31
msgid "Cancel"
msgstr "Abbrechen"
#: templates/AKSubmission/akowner_create_select.html:32
#: templates/AKSubmission/submit_new.html:34
msgid "Submit"
msgstr "Eintragen"
#: templates/AKSubmission/submission_overview.html:17
msgid ""
"On this page you can see a list of current AKs, change them and add new ones."
......@@ -93,33 +120,33 @@ msgstr ""
"bearbeiten und neue hinzufügen."
#: templates/AKSubmission/submission_overview.html:20
#: templates/AKSubmission/submit_new.html:29
msgid "Submit"
msgstr "Eintragen"
#: templates/AKSubmission/submission_overview.html:21
#: templates/AKSubmission/submit_new.html:7
#: templates/AKSubmission/submit_new.html:13
#: templates/AKSubmission/submit_new.html:18
#: templates/AKSubmission/submit_new.html:15
#: templates/AKSubmission/submit_new.html:21
msgid "New AK"
msgstr "Neuer AK"
#: templates/AKSubmission/submission_overview.html:22
#: templates/AKSubmission/submission_overview.html:21
#: templates/AKSubmission/submit_new_wish.html:5
#: templates/AKSubmission/submit_new_wish.html:12
#: templates/AKSubmission/submit_new_wish.html:16
msgid "New AK Wish"
msgstr "Neuer AK-Wunsch"
#: templates/AKSubmission/submission_overview.html:26
#: templates/AKSubmission/submission_overview.html:25
msgid "Current AKs"
msgstr "Aktuelle AKs"
#: templates/AKSubmission/submit_new.html:23
msgid "Reset"
msgstr "Zurücksetzen"
#: views.py:43
msgid "Wishes"
msgstr "Wünsche"
#: templates/AKSubmission/submit_new.html:26
msgid "Cancel"
msgstr "Abbrechen"
#: views.py:43
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"
#: views.py:71
#: views.py:106
msgid "AK successfully created"
msgstr "AK erfolgreich angelegt"
......@@ -26,7 +26,7 @@
<a href="#" class="btn btn-success">{% fontawesome_icon 'pencil-alt' %}</a>
</div>
<h2>{{ ak.name }}</h2>
<h2>{% if ak.wish %}{% trans "AK Wish" %}: {% endif %}{{ ak.name }}</h2>
<table class="table table-borderless">
<tr><td>{% trans "Who?" %}</td><td>{{ ak.owners_list }}</td></tr>
......
......@@ -25,7 +25,13 @@
<span class="badge badge-dark badge-pill" title="{% trans 'Reso' %}">{% fontawesome_icon "scroll" %}</span>
{% endif %}
</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>{% tag_list ak.tags.all event.slug %}</td>
<td class="text-right">
......
......@@ -24,6 +24,25 @@
<h2>{% trans "Current AKs" %}</h2>
{% include "AKSubmission/ak_list_table.html" %}
<noscript>
{% include "AKSubmission/ak_list_table.html" %}
</noscript>
<ul class="nav nav-tabs" style="margin-bottom:15px">
{% for category, _ in categories %}
<li class="nav-item">
<a class="nav-link {% if forloop.first %}active{% endif %}" data-toggle="tab" href="#category_{{ category.pk }}">{{ category.name }}</a>
</li>
{% endfor %}
</ul>
<div id="akListTabbed" class="tab-content">
{% for category, AKs in categories %}
<div class="tab-pane fade {% if forloop.first %}show active{% endif %}" id="category_{{ category.pk }}">
<p><b>{{ category.name }}:</b> {{ category.description }}</p>
{% include "AKSubmission/ak_list_table.html" %}
</div>
{% endfor %}
</div>
{% endblock %}
......@@ -8,8 +8,11 @@ from AKModel.models import AK, AKCategory, AKTag, AKOwner
from AKModel.models import Event
from AKModel.views import EventSlugMixin
from AKModel.views import FilterByEventSlugMixin
from AKSubmission.forms import AKForm, AKWishForm, AKOwnerForm
from django.conf import settings
class SubmissionOverviewView(FilterByEventSlugMixin, ListView):
model = AK
......@@ -17,6 +20,30 @@ class SubmissionOverviewView(FilterByEventSlugMixin, ListView):
template_name = "AKSubmission/submission_overview.html"
ordering = ['category']
def get_context_data(self, *, object_list=None, **kwargs):
context = super().get_context_data(object_list=object_list, **kwargs)
# Sort AKs into different lists (by their category)
categories = []
aks_for_category = []
ak_wishes = []
current_category = None
for ak in context["AKs"]:
if ak.category != current_category:
current_category = ak.category
aks_for_category = []
categories.append((current_category, aks_for_category))
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
return context
class AKDetailView(DetailView):
model = AK
......
......@@ -52,6 +52,8 @@ Python requirements are listed in ``requirements.txt``. They can be installed wi
1. activate virtualenv ``source env/bin/activate``
1. install python requirements ``pip install -r requirements.txt``
1. setup necessary database tables etc. ``python manage.py migrate``
1. prepare static files (can be omitted for dev setups) ``python manage.py collectstatic``
1. compile translations ``python manage.py compilemessages``
1. create a priviledged user, credentials are entered interactively on CLI ``python manage.py createsuperuser``
1. deactivate virtualenv ``deactivate``
......
......@@ -18,6 +18,10 @@ pip install -r requirements.txt
# Setup database
python manage.py migrate
# Prepare static files and translations
python manage.py collectstatic --noinput
python manage.py compilemessages
# Create superuser
# Credentials are entered interactively on CLI
python manage.py createsuperuser
......
......@@ -24,4 +24,6 @@ if [ "$1" = "--prod" ]; then
fi
./manage.py migrate
./manage.py collectstatic --noinput
./manage.py compilemessages
touch AKPlanning/wsgi.py
{% load static %}
{% load i18n %}
{% load bootstrap4 %}
{% load fontawesome %}
......@@ -15,8 +16,39 @@
</head>
<body>
{% block language-switcher %}
<!-- language switcher -->
<div class="container" style="margin-top:20px">
<form action="{% url 'set_language' %}"
method="post"
class="form-inline"
name="language-form"
style="flex-direction: column;">
{% csrf_token %}
<div class="container" style="margin-top:20px;margin-bottom: 30px;">
<input name="next" type="hidden" value="{{ request.path }}" />
{% get_current_language as LANGUAGE_CODE %}
{% get_available_languages as LANGUAGES %}
{% get_language_info_list for LANGUAGES as languages %}
<div style="align-self: end;">
{% for language in languages %}
&nbsp;&nbsp;
<button type="submit"
class="btn {% if language.code == LANGUAGE_CODE %}btn-info{% else %}btn-outline-info{% endif %}"
name="language"
value="{{ language.code }}"
style="align-self: end;">
{{ language.code | upper }}
</button>
{% endfor %}
</div>
</form>
</div>
{% endblock %}
<div class="container" style="margin-top:15px;margin-bottom: 30px;">
<ol class="breadcrumb">
{% block breadcrumbs %}
{% endblock %}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment