Removed frontpage and redirect '/' to dashboard url (because there is already a new welcome widget with the content of the frontpage on dashboard)

This commit is contained in:
Emanuel Schuetze 2012-11-17 22:14:49 +01:00
parent e338529865
commit 27fa32b718
9 changed files with 17 additions and 76 deletions

View File

@ -56,13 +56,13 @@ class GeneralConfigForm(forms.Form, CssClassMixin):
required=False, required=False,
) )
frontpage_title = forms.CharField( welcome_title = forms.CharField(
widget=forms.TextInput(), widget=forms.TextInput(),
label=_("Title"), label=_("Title"),
required=False, required=False,
) )
frontpage_welcometext = forms.CharField( welcome_text = forms.CharField(
widget=forms.Textarea(), widget=forms.Textarea(),
label=_("Welcome text"), label=_("Welcome text"),
required=False, required=False,

View File

@ -86,8 +86,8 @@ def default_config(sender, key, **kwargs):
'event_location': '', 'event_location': '',
'event_organizer': '', 'event_organizer': '',
'presentation': '', 'presentation': '',
'frontpage_title': _('Welcome to OpenSlides'), 'welcome_title': _('Welcome to OpenSlides'),
'frontpage_welcometext': _('[Place for your welcome text.]'), 'welcome_text': _('[Place for your welcome text.]'),
'system_enable_anonymous': False, 'system_enable_anonymous': False,
}.get(key) }.get(key)

View File

@ -23,9 +23,9 @@
</fieldset> </fieldset>
<p></p> <p></p>
<fieldset> <fieldset>
<legend>{% trans "Frontpage" %}</legend> <legend>{% trans "Welcome Widget" %}</legend>
{% for field in form %} {% for field in form %}
{% if "id_frontpage" in field.label_tag %} {% if "id_welcome" in field.label_tag %}
<p> <p>
{{ field.errors }} {{ field.errors }}
{{ field.required }} {{ field.required }}

View File

@ -41,8 +41,8 @@ class GeneralConfig(FormView):
'event_date': config['event_date'], 'event_date': config['event_date'],
'event_location': config['event_location'], 'event_location': config['event_location'],
'event_organizer': config['event_organizer'], 'event_organizer': config['event_organizer'],
'frontpage_title': config['frontpage_title'], 'welcome_title': config['welcome_title'],
'frontpage_welcometext': config['frontpage_welcometext'], 'welcome_text': config['welcome_text'],
'system_enable_anonymous': config['system_enable_anonymous'], 'system_enable_anonymous': config['system_enable_anonymous'],
} }
@ -54,10 +54,9 @@ class GeneralConfig(FormView):
config['event_location'] = form.cleaned_data['event_location'] config['event_location'] = form.cleaned_data['event_location']
config['event_organizer'] = form.cleaned_data['event_organizer'] config['event_organizer'] = form.cleaned_data['event_organizer']
# frontpage # welcome widget
config['frontpage_title'] = form.cleaned_data['frontpage_title'] config['welcome_title'] = form.cleaned_data['welcome_title']
config['frontpage_welcometext'] = \ config['welcome_text'] = form.cleaned_data['welcome_text']
form.cleaned_data['frontpage_welcometext']
# system # system
if form.cleaned_data['system_enable_anonymous']: if form.cleaned_data['system_enable_anonymous']:

View File

@ -4,6 +4,5 @@
{% load i18n %} {% load i18n %}
{% block content %} {% block content %}
<h1>{% get_config 'frontpage_title' %}</h1> <div class="item_fullscreen">{% get_config 'welcome_title' %}</div>
{% get_config 'frontpage_welcometext' %}
{% endblock %} {% endblock %}

View File

@ -397,10 +397,10 @@ def get_widgets(request):
# welcome widget # welcome widget
context = { context = {
'welcometext': config['frontpage_welcometext']} 'welcometext': config['welcome_text']}
widgets.append(Widget( widgets.append(Widget(
name='welcome', name='welcome',
display_name=config['frontpage_title'], display_name=config['welcome_title'],
template='projector/welcome_widget.html', template='projector/welcome_widget.html',
context=context, context=context,
permission_required='projector.can_see_dashboard', permission_required='projector.can_see_dashboard',

View File

@ -1,29 +0,0 @@
{% extends "base.html" %}
{% load i18n %}
{% load staticfiles %}
{% block title %}{{ block.super }} {% trans "Home" %}{% endblock %}
{% block content %}
<h1>{{ title }}</h1>
<p>{{ welcometext|safe|linebreaks }}</p>
{% trans "You have access to the following pages:" %}
<ul>
{% for app in apps %}
<li><a href="{{ app.url }}">{{ app.title }}</a></li>
{% endfor %}
</ul>
{% endblock %}
{% block submenu %}
{% if perms.projector.can_see_projector %}
<h4 class="sectiontitle">{% trans "Home" %}</h4>
<ul>
<li>
<a href="{% url projector_show %}"><img src="{% static 'images/icons/projector.png' %}"> {% trans 'Projector view' %}</a>
</li>
</ul>
{% endif %}
{% endblock %}

View File

@ -15,15 +15,14 @@ from django.conf.urls.defaults import patterns, url, include
from django.contrib.staticfiles.urls import staticfiles_urlpatterns from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from django.shortcuts import redirect from django.shortcuts import redirect
from django.utils.importlib import import_module from django.utils.importlib import import_module
from django.views.generic import RedirectView
from openslides.utils.views import FrontPage
handler500 = 'openslides.utils.views.server_error' handler500 = 'openslides.utils.views.server_error'
urlpatterns = patterns('', urlpatterns = patterns('',
# frontpage # Redirect to dashboard URL
(r'^$', FrontPage.as_view()), (r'^$', RedirectView.as_view(url='/projector/dashboard/', permanent=False)),
(r'^agenda/', include('openslides.agenda.urls')), (r'^agenda/', include('openslides.agenda.urls')),
(r'^motion/', include('openslides.motion.urls')), (r'^motion/', include('openslides.motion.urls')),

View File

@ -358,33 +358,6 @@ class PDFView(PermissionMixin, View):
return self.render_to_response(self.get_filename()) 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'): def server_error(request, template_name='500.html'):
""" """
500 error handler. 500 error handler.