Commits

martin.v.loewis  committed 3ae0ca2

Display contrib_form_date unconditionally to coordinators.

  • Participants
  • Parent commits 6fe94d2

Comments (0)

Files changed (3)

File extensions/pydevutils.py

+def is_history_ok(request):
+    user = request.client.userid
+    db = request.client.db
+    classname = request.classname
+    nodeid = request.nodeid
+    # restrict display of user history to user itself only
+    if classname == 'user':
+        return user == nodeid or 'Coordinator' in db.user.get(user, 'roles')
+    # currently not used
+    return True
+
+def is_coordinator(request):
+    user = request.client.userid
+    db = request.client.db
+    return 'Coordinator' in db.user.get(user, 'roles')
+
+def init(instance):
+    instance.registerUtil('is_history_ok', is_history_ok)
+    instance.registerUtil('is_coordinator', is_coordinator)

File extensions/suppress_history.py

-def is_history_ok(request):
-    user = request.client.userid
-    db = request.client.db
-    classname = request.classname
-    nodeid = request.nodeid
-    # restrict display of user history to user itself only
-    if classname == 'user':
-        return user == nodeid or 'Coordinator' in db.user.get(user, 'roles')
-    # currently not used
-    return True
-
-def init(instance):
-    instance.registerUtil('is_history_ok', is_history_ok)

File html/user.item.html

  <tr>
    <th>Contributor Form Received</th>
    <td><span tal:replace="structure context/contrib_form/field"/>
-   <tal:if condition="context/contrib_form">
+   <tal:if condition="python:context.contrib_form or utils.is_coordinator(request)">
    on: <span tal:replace="structure context/contrib_form_date/field"/>
    </tal:if>
    </td>