Add user widget and group widget, see # 379

This commit is contained in:
Norman Jäckel 2012-10-26 18:16:09 +02:00
parent 1063e7011a
commit 3f0c31d12b
3 changed files with 66 additions and 5 deletions

View File

@ -0,0 +1,26 @@
{% load i18n %}
{% load tags %}
<ul style="line-height: 180%">
{% for group in groups %}
{% if group.name != 'Anonymous' %}
<li class="{% if group.active %}activeline{% endif %}">
<a href="{% url projector_activate_slide group.sid %}" class="activate_link {% if group.active %}active{% endif %}">
<div></div>
</a>
<a href="{% model_url group 'delete' %}" title="{% trans 'Delete' %}" class="icon delete right">
<span></span>
</a>
<a href="{% model_url group 'edit' %}" title="{% trans 'Edit' %}" class="icon edit right">
<span></span>
</a>
<a href="{% url projctor_preview_slide group.sid %}" title="{% trans 'Preview' %}" class="icon preview right">
<span></span>
</a>
<a href="{% model_url group 'edit' %}">{{ group }}</a>
</li>
{% endif %}
{% empty %}
<li>{% trans 'No groups available.' %}</li>
{% endfor %}
</ul>

View File

@ -0,0 +1,24 @@
{% load i18n %}
{% load tags %}
<ul style="line-height: 180%">
{% for user in users %}
<li class="{% if user.active %}activeline{% endif %}">
<a href="{% url projector_activate_slide user.sid %}" class="activate_link {% if user.active %}active{% endif %}">
<div></div>
</a>
<a href="{% model_url user 'delete' %}" title="{% trans 'Delete' %}" class="icon delete right">
<span></span>
</a>
<a href="{% model_url user 'edit' %}" title="{% trans 'Edit' %}" class="icon edit right">
<span></span>
</a>
<a href="{% url projctor_preview_slide user.sid %}" title="{% trans 'Preview' %}" class="icon preview right">
<span></span>
</a>
<a href="{% model_url user 'edit' %}">{{ user }}</a>
</li>
{% empty %}
<li>{% trans 'No users available.' %}</li>
{% endfor %}
</ul>

View File

@ -517,9 +517,8 @@ def get_widgets(request):
""" """
return [ return [
get_personal_info_widget(request), get_personal_info_widget(request),
#get_user_widget(request), get_user_widget(request),
#get_group_widget(request) get_group_widget(request)]
]
def get_personal_info_widget(request): def get_personal_info_widget(request):
@ -548,7 +547,13 @@ def get_user_widget(request):
Provides a widget with all users. This is for short activation of Provides a widget with all users. This is for short activation of
user slides. user slides.
""" """
pass return Widget(
name='user',
display_name=_('Users'),
template='participant/user_widget.html',
context={'users': User.objects.all(),},
permission_required='projector.can_manage_projector',
default_column=1)
def get_group_widget(request): def get_group_widget(request):
@ -556,4 +561,10 @@ def get_group_widget(request):
Provides a widget with all groups. This is for short activation of Provides a widget with all groups. This is for short activation of
group slides. group slides.
""" """
pass return Widget(
name='group',
display_name=_('Groups'),
template='participant/group_widget.html',
context={'groups': Group.objects.all(),},
permission_required='projector.can_manage_projector',
default_column=1)