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

Introduce automated link generation for AK submission

Add base url field to event
Generate Wiki link from title and base url
parent 19ff8e5a
No related branches found
No related tags found
No related merge requests found
...@@ -2,7 +2,7 @@ msgid "" ...@@ -2,7 +2,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-24 21:00+0000\n" "POT-Creation-Date: 2019-10-24 22:48+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"
...@@ -11,13 +11,13 @@ msgstr "" ...@@ -11,13 +11,13 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
#: availability.py:38 models.py:23 models.py:45 models.py:139 models.py:188 #: availability.py:38 models.py:25 models.py:47 models.py:141 models.py:190
#: models.py:220 models.py:246 #: models.py:222 models.py:248
msgid "Event" msgid "Event"
msgstr "Event" msgstr "Event"
#: availability.py:39 models.py:46 models.py:140 models.py:189 models.py:221 #: availability.py:39 models.py:48 models.py:142 models.py:191 models.py:223
#: models.py:247 #: models.py:249
msgid "Associated event" msgid "Associated event"
msgstr "Zugehöriges Event" msgstr "Zugehöriges Event"
...@@ -29,7 +29,7 @@ msgstr "Person" ...@@ -29,7 +29,7 @@ msgstr "Person"
msgid "Person whose availability this is" msgid "Person whose availability this is"
msgstr "Person deren Verfügbarkeit hier abgebildet wird" msgstr "Person deren Verfügbarkeit hier abgebildet wird"
#: availability.py:56 models.py:224 models.py:239 #: availability.py:56 models.py:226 models.py:241
msgid "Room" msgid "Room"
msgstr "Raum" msgstr "Raum"
...@@ -37,7 +37,7 @@ msgstr "Raum" ...@@ -37,7 +37,7 @@ msgstr "Raum"
msgid "Room whose availability this is" msgid "Room whose availability this is"
msgstr "Raum dessen Verfügbarkeit hier abgebildet wird" msgstr "Raum dessen Verfügbarkeit hier abgebildet wird"
#: availability.py:65 models.py:192 models.py:238 #: availability.py:65 models.py:194 models.py:240
msgid "AK" msgid "AK"
msgstr "AK" msgstr "AK"
...@@ -47,7 +47,7 @@ msgstr "AK" ...@@ -47,7 +47,7 @@ msgstr "AK"
msgid "AK whose availability this is" msgid "AK whose availability this is"
msgstr "Verfügbarkeiten" msgstr "Verfügbarkeiten"
#: availability.py:74 models.py:97 #: availability.py:74 models.py:99
msgid "AK Category" msgid "AK Category"
msgstr "AK Kategorie" msgstr "AK Kategorie"
...@@ -63,8 +63,8 @@ msgstr "Verfügbarkeit" ...@@ -63,8 +63,8 @@ msgstr "Verfügbarkeit"
msgid "Availabilities" msgid "Availabilities"
msgstr "Verfügbarkeiten" msgstr "Verfügbarkeiten"
#: models.py:12 models.py:92 models.py:108 models.py:123 models.py:137 #: models.py:12 models.py:94 models.py:110 models.py:125 models.py:139
#: models.py:154 models.py:213 #: models.py:156 models.py:215
msgid "Name" msgid "Name"
msgstr "Name" msgstr "Name"
...@@ -114,295 +114,303 @@ msgstr "Aktiver Status" ...@@ -114,295 +114,303 @@ msgstr "Aktiver Status"
msgid "Marks currently active events" msgid "Marks currently active events"
msgstr "Markiert aktuell aktive Events" msgstr "Markiert aktuell aktive Events"
#: models.py:24 #: models.py:22
msgid "Base URL"
msgstr "URL-Prefix"
#: models.py:22
msgid "Prefix for wiki link construction"
msgstr "Prefix für die automatische Generierung von Wiki-Links"
#: models.py:26
msgid "Events" msgid "Events"
msgstr "Events" msgstr "Events"
#: models.py:38 #: models.py:40
msgid "Nickname" msgid "Nickname"
msgstr "Spitzname" msgstr "Spitzname"
#: models.py:38 #: models.py:40
msgid "Name to identify an AK owner by" msgid "Name to identify an AK owner by"
msgstr "Name durch den eine AK Leitung identifiziert wird" msgstr "Name durch den eine AK Leitung identifiziert wird"
#: models.py:39 #: models.py:41
msgid "Slug" msgid "Slug"
msgstr "Slug" msgstr "Slug"
#: models.py:40 #: models.py:42
msgid "Slug for URL generation" msgid "Slug for URL generation"
msgstr "Slug für URL-Generierung" msgstr "Slug für URL-Generierung"
#: models.py:41 #: models.py:43
msgid "E-Mail Address" msgid "E-Mail Address"
msgstr "E-Mail Adresse" msgstr "E-Mail Adresse"
#: models.py:41 #: models.py:43
msgid "Contact mail" msgid "Contact mail"
msgstr "Kontakt E-Mail" msgstr "Kontakt E-Mail"
#: models.py:42 #: models.py:44
msgid "Institution" msgid "Institution"
msgstr "Instutution" msgstr "Instutution"
#: models.py:42 #: models.py:44
msgid "Uni etc." msgid "Uni etc."
msgstr "Universität o.ä." msgstr "Universität o.ä."
#: models.py:43 models.py:163 #: models.py:45 models.py:165
msgid "Web Link" msgid "Web Link"
msgstr "Internet Link" msgstr "Internet Link"
#: models.py:43 #: models.py:45
msgid "Link to Homepage" msgid "Link to Homepage"
msgstr "Link zu Homepage oder Webseite" msgstr "Link zu Homepage oder Webseite"
#: models.py:49 #: models.py:51
msgid "AK Owner" msgid "AK Owner"
msgstr "AK Leitung" msgstr "AK Leitung"
#: models.py:50 #: models.py:52
msgid "AK Owners" msgid "AK Owners"
msgstr "AK Leitungen" msgstr "AK Leitungen"
#: models.py:92 #: models.py:94
msgid "Name of the AK Category" msgid "Name of the AK Category"
msgstr "Name des AK Kategorie" msgstr "Name des AK Kategorie"
#: models.py:93 models.py:109 #: models.py:95 models.py:111
msgid "Color" msgid "Color"
msgstr "Farbe" msgstr "Farbe"
#: models.py:93 models.py:109 #: models.py:95 models.py:111
msgid "Color for displaying" msgid "Color for displaying"
msgstr "Farbe für die Anzeige" msgstr "Farbe für die Anzeige"
#: models.py:94 models.py:157 #: models.py:96 models.py:159
msgid "Description" msgid "Description"
msgstr "Beschreibung" msgstr "Beschreibung"
#: models.py:94 #: models.py:96
msgid "Short description of this AK Category" msgid "Short description of this AK Category"
msgstr "Beschreibung der AK-Kategorie" msgstr "Beschreibung der AK-Kategorie"
#: models.py:98 #: models.py:100
msgid "AK Categories" msgid "AK Categories"
msgstr "AK Kategorien" msgstr "AK Kategorien"
#: models.py:108 #: models.py:110
msgid "Name of the AK Track" msgid "Name of the AK Track"
msgstr "Name des AK Tracks" msgstr "Name des AK Tracks"
#: models.py:112 #: models.py:114
msgid "AK Track" msgid "AK Track"
msgstr "AK Track" msgstr "AK Track"
#: models.py:113 #: models.py:115
msgid "AK Tracks" msgid "AK Tracks"
msgstr "AK Tracks" msgstr "AK Tracks"
#: models.py:123 #: models.py:125
msgid "Name of the AK Tag" msgid "Name of the AK Tag"
msgstr "Name das AK Tags" msgstr "Name das AK Tags"
#: models.py:126 #: models.py:128
msgid "AK Tag" msgid "AK Tag"
msgstr "AK Tag" msgstr "AK Tag"
#: models.py:127 #: models.py:129
msgid "AK Tags" msgid "AK Tags"
msgstr "AK Tags" msgstr "AK Tags"
#: models.py:137 #: models.py:139
msgid "Name of the Requirement" msgid "Name of the Requirement"
msgstr "Name der Anforderung" msgstr "Name der Anforderung"
#: models.py:143 #: models.py:145
msgid "AK Requirement" msgid "AK Requirement"
msgstr "AK Anforderung" msgstr "AK Anforderung"
#: models.py:144 #: models.py:146
msgid "AK Requirements" msgid "AK Requirements"
msgstr "AK Anforderungen" msgstr "AK Anforderungen"
#: models.py:154 #: models.py:156
msgid "Name of the AK" msgid "Name of the AK"
msgstr "Name des AKs" msgstr "Name des AKs"
#: models.py:155 #: models.py:157
msgid "Short Name" msgid "Short Name"
msgstr "Kurzer Name" msgstr "Kurzer Name"
#: models.py:156 #: models.py:158
msgid "Name displayed in the schedule" msgid "Name displayed in the schedule"
msgstr "Name zur Anzeige im AK Plan" msgstr "Name zur Anzeige im AK Plan"
#: models.py:157 #: models.py:159
msgid "Description of the AK" msgid "Description of the AK"
msgstr "Beschreibung des AKs" msgstr "Beschreibung des AKs"
#: models.py:159 #: models.py:161
msgid "Owners" msgid "Owners"
msgstr "Leitungen" msgstr "Leitungen"
#: models.py:160 #: models.py:162
msgid "Those organizing the AK" msgid "Those organizing the AK"
msgstr "Menschen, die den AK organisieren und halten" msgstr "Menschen, die den AK organisieren und halten"
#: models.py:163 #: models.py:165
msgid "Link to wiki page" msgid "Link to wiki page"
msgstr "Link zur Wiki Seite" msgstr "Link zur Wiki Seite"
#: models.py:165 #: models.py:167
msgid "Category" msgid "Category"
msgstr "Kategorie" msgstr "Kategorie"
#: models.py:166 #: models.py:168
msgid "Category of the AK" msgid "Category of the AK"
msgstr "Kategorie des AKs" msgstr "Kategorie des AKs"
#: models.py:167 #: models.py:169
msgid "Tags" msgid "Tags"
msgstr "Tags" msgstr "Tags"
#: models.py:167 #: models.py:169
msgid "Tags provided by owners" msgid "Tags provided by owners"
msgstr "Tags, die durch die AK Leitung vergeben wurden" msgstr "Tags, die durch die AK Leitung vergeben wurden"
#: models.py:168 #: models.py:170
msgid "Track" msgid "Track"
msgstr "Track" msgstr "Track"
#: models.py:169 #: models.py:171
msgid "Track the AK belongs to" msgid "Track the AK belongs to"
msgstr "Track zu dem der AK gehört" msgstr "Track zu dem der AK gehört"
#: models.py:171 #: models.py:173
msgid "Resolution Intention" msgid "Resolution Intention"
msgstr "Resolutionsabsicht" msgstr "Resolutionsabsicht"
#: models.py:172 #: models.py:174
msgid "Intends to submit a resolution" msgid "Intends to submit a resolution"
msgstr "Beabsichtigt eine Resolution einzureichen" msgstr "Beabsichtigt eine Resolution einzureichen"
#: models.py:173 #: models.py:175
msgid "Present this AK" msgid "Present this AK"
msgstr "AK Präsentieren" msgstr "AK Präsentieren"
#: models.py:174 #: models.py:176
msgid "Present results of this AK" msgid "Present results of this AK"
msgstr "Die Ergebnisse dieses AKs vorstellen" msgstr "Die Ergebnisse dieses AKs vorstellen"
#: models.py:176 #: models.py:178
msgid "Requirements" msgid "Requirements"
msgstr "Anforderungen" msgstr "Anforderungen"
#: models.py:177 #: models.py:179
msgid "AK's Requirements" msgid "AK's Requirements"
msgstr "Anforderungen des AKs" msgstr "Anforderungen des AKs"
#: models.py:179 #: models.py:181
msgid "Conflicting AKs" msgid "Conflicting AKs"
msgstr "AK Konflikte" msgstr "AK Konflikte"
#: models.py:180 #: models.py:182
msgid "AKs that conflict and thus must not take place at the same time" msgid "AKs that conflict and thus must not take place at the same time"
msgstr "" msgstr ""
"AKs, die Konflikte haben und deshalb nicht gleichzeitig stattfinden dürfen" "AKs, die Konflikte haben und deshalb nicht gleichzeitig stattfinden dürfen"
#: models.py:181 #: models.py:183
msgid "Prerequisite AKs" msgid "Prerequisite AKs"
msgstr "Vorausgesetzte AKs" msgstr "Vorausgesetzte AKs"
#: models.py:182 #: models.py:184
msgid "AKs that should precede this AK in the schedule" msgid "AKs that should precede this AK in the schedule"
msgstr "AKS die im AK Plan vor diesem AK stattfinden müssen" msgstr "AKS die im AK Plan vor diesem AK stattfinden müssen"
#: models.py:184 #: models.py:186
msgid "Internal Notes" msgid "Internal Notes"
msgstr "Interne Notizen" msgstr "Interne Notizen"
#: models.py:184 #: models.py:186
msgid "Notes to organizers" msgid "Notes to organizers"
msgstr "Notizen an die Organisator*innen" msgstr "Notizen an die Organisator*innen"
#: models.py:186 #: models.py:188
msgid "Interest" msgid "Interest"
msgstr "Interesse" msgstr "Interesse"
#: models.py:186 #: models.py:188
msgid "Expected number of people" msgid "Expected number of people"
msgstr "Erwartete Personenzahl" msgstr "Erwartete Personenzahl"
#: models.py:193 #: models.py:195
msgid "AKs" msgid "AKs"
msgstr "AKs" msgstr "AKs"
#: models.py:213 #: models.py:215
msgid "Name or number of the room" msgid "Name or number of the room"
msgstr "Name oder Nummer des Raums" msgstr "Name oder Nummer des Raums"
#: models.py:214 #: models.py:216
msgid "Building" msgid "Building"
msgstr "Gebäude" msgstr "Gebäude"
#: models.py:215 #: models.py:217
msgid "Name or number of the building" msgid "Name or number of the building"
msgstr "Name oder Nummer des Gebäudes" msgstr "Name oder Nummer des Gebäudes"
#: models.py:216 #: models.py:218
msgid "Capacity" msgid "Capacity"
msgstr "Kapazität" msgstr "Kapazität"
#: models.py:216 #: models.py:218
msgid "Maximum number of people" msgid "Maximum number of people"
msgstr "Maximale Personenzahl" msgstr "Maximale Personenzahl"
#: models.py:217 #: models.py:219
msgid "Properties" msgid "Properties"
msgstr "Eigenschaften" msgstr "Eigenschaften"
#: models.py:218 #: models.py:220
msgid "AK requirements fulfilled by the room" msgid "AK requirements fulfilled by the room"
msgstr "AK Anforderungen, die dieser Raum erfüllt" msgstr "AK Anforderungen, die dieser Raum erfüllt"
#: models.py:225 #: models.py:227
msgid "Rooms" msgid "Rooms"
msgstr "Räume" msgstr "Räume"
#: models.py:238 #: models.py:240
msgid "AK being mapped" msgid "AK being mapped"
msgstr "AK, der zugeordnet wird" msgstr "AK, der zugeordnet wird"
#: models.py:240 #: models.py:242
msgid "Room the AK will take place in" msgid "Room the AK will take place in"
msgstr "Raum in dem der AK stattfindet" msgstr "Raum in dem der AK stattfindet"
#: models.py:241 #: models.py:243
msgid "Slot Begin" msgid "Slot Begin"
msgstr "Beginn des Slots" msgstr "Beginn des Slots"
#: models.py:241 #: models.py:243
msgid "Time and date the slot begins" msgid "Time and date the slot begins"
msgstr "Zeit und Datum zu der der AK beginnt" msgstr "Zeit und Datum zu der der AK beginnt"
#: models.py:243 #: models.py:245
msgid "Duration" msgid "Duration"
msgstr "Dauer" msgstr "Dauer"
#: models.py:244 #: models.py:246
msgid "Length in hours" msgid "Length in hours"
msgstr "Länge in Stunden" msgstr "Länge in Stunden"
#: models.py:250 #: models.py:252
msgid "AK Slot" msgid "AK Slot"
msgstr "AK Slot" msgstr "AK Slot"
#: models.py:251 #: models.py:253
msgid "AK Slots" msgid "AK Slots"
msgstr "AK Slot" msgstr "AK Slot"
#: models.py:265 #: models.py:267
msgid "Not scheduled yet" msgid "Not scheduled yet"
msgstr "Noch nicht geplant" msgstr "Noch nicht geplant"
# Generated by Django 2.2.6 on 2019-10-24 22:46
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('AKModel', '0020_ak_unique'),
]
operations = [
migrations.AddField(
model_name='event',
name='base_url',
field=models.URLField(blank=True, help_text='Prefix for wiki link construction', verbose_name='Base URL'),
),
]
...@@ -19,6 +19,8 @@ class Event(models.Model): ...@@ -19,6 +19,8 @@ class Event(models.Model):
help_text=_('City etc. the event takes place in')) help_text=_('City etc. the event takes place in'))
active = models.BooleanField(verbose_name=_('Active State'), help_text=_('Marks currently active events')) active = models.BooleanField(verbose_name=_('Active State'), help_text=_('Marks currently active events'))
base_url = models.URLField(verbose_name=_("Base URL"), help_text=_("Prefix for wiki link construction"), blank=True)
class Meta: class Meta:
verbose_name = _('Event') verbose_name = _('Event')
verbose_name_plural = _('Events') verbose_name_plural = _('Events')
......
...@@ -72,6 +72,9 @@ class AKForm(forms.ModelForm): ...@@ -72,6 +72,9 @@ class AKForm(forms.ModelForm):
class AKSubmissionForm(AKForm): class AKSubmissionForm(AKForm):
class Meta(AKForm.Meta):
exclude = ['link']
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs) super().__init__(*args, **kwargs)
# Add field for durations # Add field for durations
......
...@@ -109,7 +109,8 @@ class AKAndAKWishSubmissionView(EventSlugMixin, CreateView): ...@@ -109,7 +109,8 @@ class AKAndAKWishSubmissionView(EventSlugMixin, CreateView):
super_form_valid = super().form_valid(form) super_form_valid = super().form_valid(form)
# Generate wiki link # Generate wiki link
# TODO self.object.link = form.cleaned_data["event"].base_url + form.cleaned_data["name"].replace(" ", "_")
self.object.save()
# Set tags (and generate them if necessary) # Set tags (and generate them if necessary)
for tag_name in form.cleaned_data["tag_names"]: for tag_name in form.cleaned_data["tag_names"]:
......
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