Skip to content
Snippets Groups Projects
Commit e1cebf37 authored by Nadja Geisler's avatar Nadja Geisler :sunny:
Browse files

Merge branch 'fix-doc-minor' into 'main'

Fix smaller issues

Closes #141, #142, #115, and #143

See merge request kif/akplanning!123
parents 50f75a8e d7c63bc0
No related branches found
No related tags found
No related merge requests found
...@@ -54,7 +54,7 @@ class DashboardEventView(DetailView): ...@@ -54,7 +54,7 @@ class DashboardEventView(DetailView):
# Changes in plan # Changes in plan
if apps.is_installed("AKPlan"): if apps.is_installed("AKPlan"):
if not context['event'].plan_hidden: if not context['event'].plan_hidden:
last_changed_slots = AKSlot.objects.filter(event=context['event']).order_by('-updated')[ last_changed_slots = AKSlot.objects.filter(event=context['event'], start__isnull=False).order_by('-updated')[
:int(settings.DASHBOARD_RECENT_MAX)] :int(settings.DASHBOARD_RECENT_MAX)]
for changed_slot in last_changed_slots: for changed_slot in last_changed_slots:
recent_changes.append({'icon': ('clock', 'far'), recent_changes.append({'icon': ('clock', 'far'),
......
...@@ -9,7 +9,10 @@ from AKModel.models import Event, AKCategory, AKRequirement ...@@ -9,7 +9,10 @@ from AKModel.models import Event, AKCategory, AKRequirement
class NewEventWizardStartForm(forms.ModelForm): class NewEventWizardStartForm(forms.ModelForm):
class Meta: class Meta:
model = Event model = Event
fields = ['name', 'slug', 'timezone'] fields = ['name', 'slug', 'timezone', 'plan_hidden']
widgets = {
'plan_hidden': forms.HiddenInput(),
}
is_init = forms.BooleanField(initial=True, widget=forms.HiddenInput) is_init = forms.BooleanField(initial=True, widget=forms.HiddenInput)
...@@ -23,7 +26,6 @@ class NewEventWizardSettingsForm(forms.ModelForm): ...@@ -23,7 +26,6 @@ class NewEventWizardSettingsForm(forms.ModelForm):
'slug': forms.HiddenInput(), 'slug': forms.HiddenInput(),
'timezone': forms.HiddenInput(), 'timezone': forms.HiddenInput(),
'active': forms.HiddenInput(), 'active': forms.HiddenInput(),
'plan_hidden': forms.HiddenInput(),
'start': DateTimePickerInput(options={"format": "YYYY-MM-DD HH:mm"}), 'start': DateTimePickerInput(options={"format": "YYYY-MM-DD HH:mm"}),
'end': DateTimePickerInput(options={"format": "YYYY-MM-DD HH:mm"}), 'end': DateTimePickerInput(options={"format": "YYYY-MM-DD HH:mm"}),
'reso_deadline': DateTimePickerInput(options={"format": "YYYY-MM-DD HH:mm"}), 'reso_deadline': DateTimePickerInput(options={"format": "YYYY-MM-DD HH:mm"}),
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
{% include "AKPlan/load_fullcalendar.html" %} {% include "AKPlan/load_fullcalendar.html" %}
<script> <script>
{% get_current_language as LANGUAGE_CODE %}
document.addEventListener('DOMContentLoaded', function () { document.addEventListener('DOMContentLoaded', function () {
var calendarEl = document.getElementById('akSlotCalendar'); var calendarEl = document.getElementById('akSlotCalendar');
......
...@@ -22,6 +22,8 @@ ...@@ -22,6 +22,8 @@
{% include "AKPlan/load_fullcalendar.html" %} {% include "AKPlan/load_fullcalendar.html" %}
{% get_current_language as LANGUAGE_CODE %}
<script> <script>
document.addEventListener('DOMContentLoaded', function () { document.addEventListener('DOMContentLoaded', function () {
var planEl = document.getElementById('planCalendar'); var planEl = document.getElementById('planCalendar');
......
...@@ -100,6 +100,12 @@ class AKForm(AvailabilitiesFormMixin, forms.ModelForm): ...@@ -100,6 +100,12 @@ class AKForm(AvailabilitiesFormMixin, forms.ModelForm):
short_name = '{}-{}'.format(short_name[:-(digits + 1)], i) short_name = '{}-{}'.format(short_name[:-(digits + 1)], i)
cleaned_data["short_name"] = short_name cleaned_data["short_name"] = short_name
# Generate wiki link
if self.cleaned_data["event"].base_url:
link = self.cleaned_data["event"].base_url + self.cleaned_data["name"].replace(" ", "_")
# Truncate links longer than 200 characters (default length of URL fields in django)
self.cleaned_data["link"] = link[:200]
# Get tag names from raw tags # Get tag names from raw tags
cleaned_data["tag_names"] = [name.strip().lower() for name cleaned_data["tag_names"] = [name.strip().lower() for name
in self.split_string.split(cleaned_data["tags_raw"]) in self.split_string.split(cleaned_data["tags_raw"])
......
...@@ -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: 2021-10-29 13:36+0000\n" "POT-Creation-Date: 2022-08-13 18:04+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"
...@@ -428,39 +428,45 @@ msgstr "Event inaktiv. Hinzufügen/Bearbeiten nicht möglich." ...@@ -428,39 +428,45 @@ msgstr "Event inaktiv. Hinzufügen/Bearbeiten nicht möglich."
msgid "AK successfully created" msgid "AK successfully created"
msgstr "AK erfolgreich angelegt" msgstr "AK erfolgreich angelegt"
#: AKSubmission/views.py:267 #: AKSubmission/views.py:227
msgid ""
"Due to technical reasons, the link you entered was truncated to a length of "
"200 characters"
msgstr "Aus technischen Gründen wurde der eingegebeneLink auf eine Länge von 200 Zeichen gekürzt"
#: AKSubmission/views.py:272
msgid "AK successfully updated" msgid "AK successfully updated"
msgstr "AK erfolgreich aktualisiert" msgstr "AK erfolgreich aktualisiert"
#: AKSubmission/views.py:334 #: AKSubmission/views.py:339
msgid "Person Info successfully updated" msgid "Person Info successfully updated"
msgstr "Personen-Info erfolgreich aktualisiert" msgstr "Personen-Info erfolgreich aktualisiert"
#: AKSubmission/views.py:354 #: AKSubmission/views.py:359
msgid "No user selected" msgid "No user selected"
msgstr "Keine Person ausgewählt" msgstr "Keine Person ausgewählt"
#: AKSubmission/views.py:380 #: AKSubmission/views.py:385
msgid "AK Slot successfully added" msgid "AK Slot successfully added"
msgstr "AK-Slot erfolgreich angelegt" msgstr "AK-Slot erfolgreich angelegt"
#: AKSubmission/views.py:394 #: AKSubmission/views.py:399
msgid "You cannot edit a slot that has already been scheduled" msgid "You cannot edit a slot that has already been scheduled"
msgstr "Bereits geplante AK-Slots können nicht mehr bearbeitet werden" msgstr "Bereits geplante AK-Slots können nicht mehr bearbeitet werden"
#: AKSubmission/views.py:404 #: AKSubmission/views.py:409
msgid "AK Slot successfully updated" msgid "AK Slot successfully updated"
msgstr "AK-Slot erfolgreich aktualisiert" msgstr "AK-Slot erfolgreich aktualisiert"
#: AKSubmission/views.py:417 #: AKSubmission/views.py:422
msgid "You cannot delete a slot that has already been scheduled" msgid "You cannot delete a slot that has already been scheduled"
msgstr "Bereits geplante AK-Slots können nicht mehr gelöscht werden" msgstr "Bereits geplante AK-Slots können nicht mehr gelöscht werden"
#: AKSubmission/views.py:427 #: AKSubmission/views.py:432
msgid "AK Slot successfully deleted" msgid "AK Slot successfully deleted"
msgstr "AK-Slot erfolgreich angelegt" msgstr "AK-Slot erfolgreich angelegt"
#: AKSubmission/views.py:448 #: AKSubmission/views.py:454
msgid "Message to organizers successfully saved" msgid "Message to organizers successfully saved"
msgstr "Nachricht an die Organisator*innen erfolgreich gespeichert" msgstr "Nachricht an die Organisator*innen erfolgreich gespeichert"
......
...@@ -215,16 +215,12 @@ class AKAndAKWishSubmissionView(EventSlugMixin, EventInactiveRedirectMixin, Crea ...@@ -215,16 +215,12 @@ class AKAndAKWishSubmissionView(EventSlugMixin, EventInactiveRedirectMixin, Crea
return redirect(reverse_lazy('submit:submission_overview', return redirect(reverse_lazy('submit:submission_overview',
kwargs={'event_slug': form.cleaned_data["event"].slug})) kwargs={'event_slug': form.cleaned_data["event"].slug}))
# Try to save AK and get redirect URL
super_form_valid = super().form_valid(form) super_form_valid = super().form_valid(form)
# Generate wiki link
if form.cleaned_data["event"].base_url:
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"]:
tag, _ = AKTag.objects.get_or_create(name=tag_name) tag, was_created = AKTag.objects.get_or_create(name=tag_name)
self.object.tags.add(tag) self.object.tags.add(tag)
# Generate slot(s) # Generate slot(s)
...@@ -280,7 +276,7 @@ class AKEditView(EventSlugMixin, EventInactiveRedirectMixin, UpdateView): ...@@ -280,7 +276,7 @@ class AKEditView(EventSlugMixin, EventInactiveRedirectMixin, UpdateView):
# 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"]:
tag, _ = AKTag.objects.get_or_create(name=tag_name) tag, was_created = AKTag.objects.get_or_create(name=tag_name)
self.object.tags.add(tag) self.object.tags.add(tag)
return super_form_valid return super_form_valid
......
...@@ -31,4 +31,4 @@ Afterwards, you may check your setup by executing ``Utils/check.sh`` or ``Utils/ ...@@ -31,4 +31,4 @@ Afterwards, you may check your setup by executing ``Utils/check.sh`` or ``Utils/
## Developer Notes ## Developer Notes
* to regenerate translations use ````python manage.py makemessages -l de_DE --ignore venv```` * to regenerate translations use ````python manage.py makemessages -l de_DE --ignore venv````
* to create a data backup use ````python manage.py dumpdata --indent=2 > db.json --traceback```` * to create a data backup use ````python manage.py dumpdata --indent=2 > db.json --traceback````
* to export all database items belonging to a certain event use ````.\Utils\json_export.sh <event_id> <export_prefix> [--prod]````. The results will be saved in ````backups/<export_prefix>.json```` * to export all database items belonging to a certain event use ````./Utils/json_export.sh <event_id> <export_prefix> [--prod]````. The results will be saved in ````backups/<export_prefix>.json````
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment