diff --git a/openslides/config/forms.py b/openslides/config/forms.py index cf5fbf3c1..ef1a9b4d8 100644 --- a/openslides/config/forms.py +++ b/openslides/config/forms.py @@ -56,13 +56,13 @@ class GeneralConfigForm(forms.Form, CssClassMixin): required=False, ) - frontpage_title = forms.CharField( + welcome_title = forms.CharField( widget=forms.TextInput(), label=_("Title"), required=False, ) - frontpage_welcometext = forms.CharField( + welcome_text = forms.CharField( widget=forms.Textarea(), label=_("Welcome text"), required=False, diff --git a/openslides/config/models.py b/openslides/config/models.py index 4620a2d51..a816be865 100644 --- a/openslides/config/models.py +++ b/openslides/config/models.py @@ -86,8 +86,8 @@ def default_config(sender, key, **kwargs): 'event_location': '', 'event_organizer': '', 'presentation': '', - 'frontpage_title': _('Welcome to OpenSlides'), - 'frontpage_welcometext': _('[Place for your welcome text.]'), + 'welcome_title': _('Welcome to OpenSlides'), + 'welcome_text': _('[Place for your welcome text.]'), 'system_enable_anonymous': False, }.get(key) diff --git a/openslides/config/templates/config/general.html b/openslides/config/templates/config/general.html index 55fbae5b1..86912cc82 100644 --- a/openslides/config/templates/config/general.html +++ b/openslides/config/templates/config/general.html @@ -23,9 +23,9 @@

- {% trans "Frontpage" %} + {% trans "Welcome Widget" %} {% for field in form %} - {% if "id_frontpage" in field.label_tag %} + {% if "id_welcome" in field.label_tag %}

{{ field.errors }} {{ field.required }} diff --git a/openslides/config/views.py b/openslides/config/views.py index 908ac7db6..e93e08f18 100644 --- a/openslides/config/views.py +++ b/openslides/config/views.py @@ -41,8 +41,8 @@ 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'], + 'welcome_title': config['welcome_title'], + 'welcome_text': config['welcome_text'], 'system_enable_anonymous': config['system_enable_anonymous'], } @@ -54,10 +54,9 @@ class GeneralConfig(FormView): config['event_location'] = form.cleaned_data['event_location'] config['event_organizer'] = form.cleaned_data['event_organizer'] - # frontpage - config['frontpage_title'] = form.cleaned_data['frontpage_title'] - config['frontpage_welcometext'] = \ - form.cleaned_data['frontpage_welcometext'] + # welcome widget + config['welcome_title'] = form.cleaned_data['welcome_title'] + config['welcome_text'] = form.cleaned_data['welcome_text'] # system if form.cleaned_data['system_enable_anonymous']: diff --git a/openslides/projector/templates/projector/default.html b/openslides/projector/templates/projector/default.html index de88476f5..3ce29380c 100644 --- a/openslides/projector/templates/projector/default.html +++ b/openslides/projector/templates/projector/default.html @@ -4,6 +4,5 @@ {% load i18n %} {% block content %} -

{% get_config 'frontpage_title' %}

- {% get_config 'frontpage_welcometext' %} +
{% get_config 'welcome_title' %}
{% endblock %} diff --git a/openslides/projector/views.py b/openslides/projector/views.py index 2b117ce38..e9ab1b3ec 100644 --- a/openslides/projector/views.py +++ b/openslides/projector/views.py @@ -397,10 +397,10 @@ def get_widgets(request): # welcome widget context = { - 'welcometext': config['frontpage_welcometext']} + 'welcometext': config['welcome_text']} widgets.append(Widget( name='welcome', - display_name=config['frontpage_title'], + display_name=config['welcome_title'], template='projector/welcome_widget.html', context=context, permission_required='projector.can_see_dashboard', diff --git a/openslides/templates/front_page.html b/openslides/templates/front_page.html deleted file mode 100644 index 8dd40846c..000000000 --- a/openslides/templates/front_page.html +++ /dev/null @@ -1,29 +0,0 @@ -{% extends "base.html" %} - -{% load i18n %} -{% load staticfiles %} - -{% block title %}{{ block.super }} – {% trans "Home" %}{% endblock %} - -{% block content %} -

{{ title }}

-

{{ welcometext|safe|linebreaks }}

- - {% trans "You have access to the following pages:" %} - -{% endblock %} - -{% block submenu %} - {% if perms.projector.can_see_projector %} -

{% trans "Home" %}

- - {% endif %} -{% endblock %} diff --git a/openslides/urls.py b/openslides/urls.py index ce763b3f2..2c3465260 100644 --- a/openslides/urls.py +++ b/openslides/urls.py @@ -15,15 +15,14 @@ from django.conf.urls.defaults import patterns, url, include from django.contrib.staticfiles.urls import staticfiles_urlpatterns from django.shortcuts import redirect from django.utils.importlib import import_module - -from openslides.utils.views import FrontPage +from django.views.generic import RedirectView handler500 = 'openslides.utils.views.server_error' urlpatterns = patterns('', - # frontpage - (r'^$', FrontPage.as_view()), + # Redirect to dashboard URL + (r'^$', RedirectView.as_view(url='/projector/dashboard/', permanent=False)), (r'^agenda/', include('openslides.agenda.urls')), (r'^motion/', include('openslides.motion.urls')), diff --git a/openslides/utils/views.py b/openslides/utils/views.py index 5d9e1303d..5e814bf9d 100644 --- a/openslides/utils/views.py +++ b/openslides/utils/views.py @@ -358,33 +358,6 @@ class PDFView(PermissionMixin, View): return self.render_to_response(self.get_filename()) -class FrontPage(TemplateView): - template_name = 'front_page.html' - - def has_permission(self, request): - if request.user.is_authenticated() or config['system_enable_anonymous']: - return True - return False - - def get_context_data(self, **kwargs): - context = super(FrontPage, self).get_context_data(**kwargs) - apps = [] - for app in settings.INSTALLED_APPS: - try: - mod = import_module(app + '.views') - tab = mod.register_tab(self.request) - except (ImportError, AttributeError): - continue - if tab.permission: - apps.append(tab) - context.update({ - 'apps': apps, - 'title': config['frontpage_title'], - 'welcometext': config['frontpage_welcometext'], - }) - return context - - def server_error(request, template_name='500.html'): """ 500 error handler.