New welcome widget.
This commit is contained in:
parent
05baced315
commit
fa9874038e
13
openslides/projector/templates/projector/welcome_widget.html
Normal file
13
openslides/projector/templates/projector/welcome_widget.html
Normal file
@ -0,0 +1,13 @@
|
||||
{% load i18n %}
|
||||
{% load tags %}
|
||||
|
||||
{% if welcometext %}
|
||||
<p>{{ welcometext|safe|linebreaks }}</p>
|
||||
{% endif %}
|
||||
|
||||
<p>{% trans "You have access to the following pages:" %}</p>
|
||||
<ul>
|
||||
{% for app in apps %}
|
||||
<li><a href="{{ app.url }}">{{ app.title }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
@ -371,6 +371,27 @@ def get_widgets(request):
|
||||
"""
|
||||
widgets = []
|
||||
|
||||
# welcome widget
|
||||
apps = []
|
||||
for app in settings.INSTALLED_APPS:
|
||||
try:
|
||||
mod = import_module(app + '.views')
|
||||
tab = mod.register_tab(request)
|
||||
except (ImportError, AttributeError):
|
||||
continue
|
||||
if tab.permission:
|
||||
apps.append(tab)
|
||||
context = {
|
||||
'apps': apps,
|
||||
'welcometext': config['frontpage_welcometext']}
|
||||
widgets.append(Widget(
|
||||
name='welcome',
|
||||
display_name=config['frontpage_title'],
|
||||
template='projector/welcome_widget.html',
|
||||
context=context,
|
||||
permission_required='projector.can_see_dashboard',
|
||||
default_column=1))
|
||||
|
||||
# Projector live view widget
|
||||
widgets.append(Widget(
|
||||
name='live_view',
|
||||
|
Loading…
Reference in New Issue
Block a user