diff --git a/tabellio/webviews/deputy.pt b/tabellio/webviews/deputy.pt
index ea28ec8..2dc4164 100644
--- a/tabellio/webviews/deputy.pt
+++ b/tabellio/webviews/deputy.pt
@@ -107,6 +107,8 @@
(en tant que participant)
+ (en tant que rapporteur)
+ (en tant qu'orateur)
diff --git a/tabellio/webviews/deputy.py b/tabellio/webviews/deputy.py
index 36e4fec..3dc21f7 100644
--- a/tabellio/webviews/deputy.py
+++ b/tabellio/webviews/deputy.py
@@ -136,6 +136,44 @@ class View(BrowserView, Cached):
self._activity_as_participant = activity
return activity
+ _activity_as_reporter = None
+ def get_activity_as_reporter(self):
+ if self._activity_as_reporter is not None:
+ return self._activity_as_reporter
+ intids = component.getUtility(IIntIds)
+ catalog = component.getUtility(ICatalog)
+ try:
+ reporter_intid = intids.getId(self.context)
+ except KeyError:
+ intids.register(self.context)
+ reporter_intid = initds.get(self.context)
+ reports = [x.from_object for x in catalog.findRelations({
+ 'to_id': reporter_intid,
+ 'from_attribute': 'reporters'})]
+ reports = [x for x in reports if hasattr(x, 'date')]
+ self._activity_as_reporter = reports
+
+ return reports
+
+ _activity_as_speaker = None
+ def get_activity_as_speaker(self):
+ if self._activity_as_speaker is not None:
+ return self._activity_as_speaker
+ intids = component.getUtility(IIntIds)
+ catalog = component.getUtility(ICatalog)
+ try:
+ speaker_intid = intids.getId(self.context)
+ except KeyError:
+ intids.register(self.context)
+ speaker_intid = intids.get(self.context)
+ speeches = [x.from_object for x in catalog.findRelations({
+ 'to_id': speaker_intid,
+ 'from_attribute': 'speakers'})]
+ speeches = [x for x in speeches if hasattr(x, 'date')]
+ self._activity_as_speaker = speeches
+
+ return speeches
+
def sessions_with_activity(self):
sessions_dict = {}
@@ -143,15 +181,22 @@ class View(BrowserView, Cached):
sessions_dict[activity.session] = True
for activity in self.get_activity_as_participant():
sessions_dict[activity.session] = True
+ for activity in self.get_activity_as_speaker():
+ sessions_dict[activity.session] = True
+ for activity in self.get_activity_as_reporter():
+ sessions_dict[activity.session] = True
sessions = []
for session in tabellio.config.utils.get_sessions():
if session in sessions_dict:
sessions.append(session)
+
return sessions
def activity(self, session=None):
activity = [(x, 'author') for x in self.get_activity_as_author()] + \
- [(x, 'participant') for x in self.get_activity_as_participant()]
+ [(x, 'participant') for x in self.get_activity_as_participant()] + \
+ [(x, 'reporter') for x in self.get_activity_as_reporter()] + \
+ [(x, 'speaker') for x in self.get_activity_as_speaker()]
if session:
activity = [x for x in activity if x[0].session == session]