diff --git a/openslides/config/forms.py b/openslides/config/forms.py index 24ee17a54..164e30685 100644 --- a/openslides/config/forms.py +++ b/openslides/config/forms.py @@ -24,3 +24,5 @@ class GeneralConfigForm(Form, CssClassMixin): event_location = CharField(widget=TextInput(), required=False, label=_("Event location")) event_organizer = CharField(widget=TextInput(), required=False, label=_("Event organizer")) system_enable_anonymous = BooleanField(required=False, label=_("Allow access for anonymous guest users") ) + frontpage_title = CharField(widget=TextInput(), required=False, label=_("Title") ) + frontpage_welcometext = CharField(widget=Textarea(), required=False, label=_("Welcome text") ) \ No newline at end of file diff --git a/openslides/config/models.py b/openslides/config/models.py index 0c59315e5..7d4dee1fd 100644 --- a/openslides/config/models.py +++ b/openslides/config/models.py @@ -81,6 +81,8 @@ def default_config(sender, key, **kwargs): return { 'event_name': 'OpenSlides', 'event_description': 'Presentation and voting system', + 'frontpage_title': 'Welcome', + 'frontpage_welcometext': 'Welcome to OpenSlides!', }.get(key) diff --git a/openslides/config/templates/config/general.html b/openslides/config/templates/config/general.html index 9a6c29132..27ba71ba5 100644 --- a/openslides/config/templates/config/general.html +++ b/openslides/config/templates/config/general.html @@ -22,6 +22,21 @@ {% endfor %}

+
+ {%trans "Frontpage" %} + {% for field in form %} + {% if "id_frontpage" in field.label_tag %} +

+ {{ field.errors }} + {{ field.required }} + {{ field.label_tag }} + {{ field }} + {{ field.help_text }} +

+ {% endif %} + {% endfor %} +
+

{%trans "System" %} {% for field in form %} diff --git a/openslides/config/views.py b/openslides/config/views.py index ca586c2ff..05770d7f0 100644 --- a/openslides/config/views.py +++ b/openslides/config/views.py @@ -41,15 +41,24 @@ class GeneralConfig(FormView): 'event_date': config['event_date'], 'event_location': config['event_location'], 'event_organizer': config['event_organizer'], + 'frontpage_title': config['frontpage_title'], + 'frontpage_welcometext': config['frontpage_welcometext'], 'system_enable_anonymous': config['system_enable_anonymous'], } def form_valid(self, form): + # event config['event_name'] = form.cleaned_data['event_name'] config['event_description'] = form.cleaned_data['event_description'] config['event_date'] = form.cleaned_data['event_date'] config['event_location'] = form.cleaned_data['event_location'] config['event_organizer'] = form.cleaned_data['event_organizer'] + + # frontpage + config['frontpage_welcometext'] = form.cleaned_data['frontpage_welcometext'] + config['frontpage_welcometext'] = form.cleaned_data['frontpage_welcometext'] + + # system if form.cleaned_data['system_enable_anonymous']: config['system_enable_anonymous'] = True # check for Anonymous group and (re)create it as needed @@ -65,6 +74,7 @@ class GeneralConfig(FormView): messages.success(self.request, _('Anonymous access enabled. Please modify the "Anonymous" group to fit your required permissions.')) else: config['system_enable_anonymous'] = False + messages.success(self.request, _('General settings successfully saved.')) return super(GeneralConfig, self).form_valid(form) diff --git a/openslides/templates/front_page.html b/openslides/templates/front_page.html index 063eebc94..6daa88762 100644 --- a/openslides/templates/front_page.html +++ b/openslides/templates/front_page.html @@ -2,15 +2,16 @@ {% load i18n %} -{% block title %}{{ block.super }} – {{ item.title }}{% endblock %} +{% block title %}{{ block.super }} – {% trans "Home" %}{% endblock %} {% block content %} -

{% trans 'Wellcome' %}

- {{ wellcome_text|safe }} +

{{ title }}

+

{{ welcometext|safe|linebreaks }}

+ + {% trans "You have access to the following pages:" %} - {% endblock %} diff --git a/openslides/utils/views.py b/openslides/utils/views.py index 41ae11990..a3eeff0ea 100644 --- a/openslides/utils/views.py +++ b/openslides/utils/views.py @@ -278,7 +278,11 @@ class FrontPage(TemplateView): continue if tab.permission: apps.append(tab) - context['apps'] = apps + context.update({ + 'apps': apps, + 'title': config['frontpage_title'], + 'welcometext': config['frontpage_welcometext'], + }) return context