diff --git a/openslides/account/templates/account/personal_info_widget.html b/openslides/account/templates/account/personal_info_widget.html
index 542f3f8df..8d7f3f0d2 100644
--- a/openslides/account/templates/account/personal_info_widget.html
+++ b/openslides/account/templates/account/personal_info_widget.html
@@ -1,6 +1,16 @@
{% load i18n %}
{% load tags %}
+
+ {% trans 'I am on the list of speakers of the following items:' %}
+ {% for item in items %}
+ - {{ item }}
+ {% empty %}
+ - {% trans 'None' %}
+ {% endfor %}
+
+
+
{% trans 'I submitted the following motions:' %}
{% for motion in submitted_motions %}
diff --git a/openslides/account/views.py b/openslides/account/views.py
index 0c67c83b3..cbe6af490 100644
--- a/openslides/account/views.py
+++ b/openslides/account/views.py
@@ -19,7 +19,7 @@ from openslides.projector.projector import Widget
def get_widgets(request):
"""
- Returns the widgets of the account app. It is only a personal_info_widget.
+ Returns the widgets of the account app. It is only the personal_info_widget.
"""
if not isinstance(request.user, AnonymousUser):
return [get_personal_info_widget(request)]
@@ -30,12 +30,21 @@ def get_widgets(request):
def get_personal_info_widget(request):
"""
Provides a widget for personal info. It shows your submitted and supported
- motions and where you are supporter or candidate. If one of the modules
- motion or assignment does not exist, it is not loaded. If both don't
- exist, the widget disapears.
+ motions, where you are on the list of speakers and where you are supporter
+ or candidate. If one of the modules agenda, motion or assignment does
+ not exist, it is not loaded. If all does not exist, the widget disapears.
"""
personal_info_context = {}
+ try:
+ from openslides.agenda.models import Item
+ except ImportError:
+ pass
+ else:
+ personal_info_context.update({
+ 'items': Item.objects.filter(
+ speaker__person=request.user,
+ speaker__begin_time=None)})
try:
from openslides.motion.models import Motion
except ImportError:
@@ -58,7 +67,7 @@ def get_personal_info_widget(request):
if personal_info_context:
return Widget(
name='personal_info',
- display_name=_('My motions and elections'),
+ display_name=_('My items, motions and elections'),
template='account/personal_info_widget.html',
context=personal_info_context,
permission_required=None,
diff --git a/tests/account/test_widgets.py b/tests/account/test_widgets.py
index 45b888942..5b22a3f40 100644
--- a/tests/account/test_widgets.py
+++ b/tests/account/test_widgets.py
@@ -19,6 +19,17 @@ class PersonalInfoWidget(TestCase):
"""
Tests the content of the personal info widget.
"""
+ def import_agenda(self):
+ """
+ Helper function to make the module agenda optional.
+ """
+ try:
+ from openslides import agenda
+ except ImportError:
+ return False
+ else:
+ return agenda
+
def import_motion(self):
"""
Helper function to make the module motion optional.
@@ -49,7 +60,19 @@ class PersonalInfoWidget(TestCase):
def test_widget_appearance(self):
response = self.client.get('/projector/dashboard/')
- self.assertContains(response, 'My motions and elections
', status_code=200)
+ self.assertContains(response, 'My items, motions and elections
', status_code=200)
+
+ def test_item_list(self):
+ agenda = self.import_agenda()
+ if agenda:
+ item_1 = agenda.models.Item.objects.create(title='My Item Title iw5ohNgee4eiYahb5Eiv')
+ speaker = agenda.models.Speaker.objects.add(item=item_1, person=self.user)
+ response = self.client.get('/projector/dashboard/')
+ self.assertContains(response, 'I am on the list of speakers of the following items:', status_code=200)
+ self.assertContains(response, 'My Item Title iw5ohNgee4eiYahb5Eiv', status_code=200)
+ speaker.begin_speach()
+ response = self.client.get('/projector/dashboard/')
+ self.assertNotContains(response, 'My Item Title iw5ohNgee4eiYahb5Eiv', status_code=200)
def test_submitter_list(self):
motion = self.import_motion()