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:
parent
e338529865
commit
27fa32b718
@ -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,
|
||||
|
@ -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)
|
||||
|
||||
|
@ -23,9 +23,9 @@
|
||||
</fieldset>
|
||||
<p></p>
|
||||
<fieldset>
|
||||
<legend>{% trans "Frontpage" %}</legend>
|
||||
<legend>{% trans "Welcome Widget" %}</legend>
|
||||
{% for field in form %}
|
||||
{% if "id_frontpage" in field.label_tag %}
|
||||
{% if "id_welcome" in field.label_tag %}
|
||||
<p>
|
||||
{{ field.errors }}
|
||||
{{ field.required }}
|
||||
|
@ -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']:
|
||||
|
@ -4,6 +4,5 @@
|
||||
{% load i18n %}
|
||||
|
||||
{% block content %}
|
||||
<h1>{% get_config 'frontpage_title' %}</h1>
|
||||
{% get_config 'frontpage_welcometext' %}
|
||||
<div class="item_fullscreen">{% get_config 'welcome_title' %}</div>
|
||||
{% endblock %}
|
||||
|
@ -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',
|
||||
|
@ -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 %}
|
@ -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')),
|
||||
|
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user