[Mpuls-commits] r2985 - in jmd/trunk: . jmdweb/templates/jmdstruktur

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Thu Jun 10 13:17:25 CEST 2010


Author: bh
Date: 2010-06-10 13:17:24 +0200 (Thu, 10 Jun 2010)
New Revision: 2985

Modified:
   jmd/trunk/ChangeLog
   jmd/trunk/jmdweb/templates/jmdstruktur/permission.mako
Log:
* jmdweb/templates/jmdstruktur/permission.mako: Refactor the user
list rendering into a separate function and render the list like
the list used for normal user group management.


Modified: jmd/trunk/ChangeLog
===================================================================
--- jmd/trunk/ChangeLog	2010-06-10 11:16:22 UTC (rev 2984)
+++ jmd/trunk/ChangeLog	2010-06-10 11:17:24 UTC (rev 2985)
@@ -1,5 +1,11 @@
 2010-06-10  Bernhard Herzog  <bh at intevation.de>
 
+	* jmdweb/templates/jmdstruktur/permission.mako: Refactor the user
+	list rendering into a separate function and render the list like
+	the list used for normal user group management.
+
+2010-06-10  Bernhard Herzog  <bh at intevation.de>
+
 	* jmdweb/controllers/jmdstruktur.py
 	(JmdstrukturController.permission)
 	(JmdstrukturController.permissionAction): Use

Modified: jmd/trunk/jmdweb/templates/jmdstruktur/permission.mako
===================================================================
--- jmd/trunk/jmdweb/templates/jmdstruktur/permission.mako	2010-06-10 11:16:22 UTC (rev 2984)
+++ jmd/trunk/jmdweb/templates/jmdstruktur/permission.mako	2010-06-10 11:17:24 UTC (rev 2985)
@@ -7,32 +7,34 @@
   <li><a href="${h.url_for(controller='/case')}">${_('cm_np_new')}</a></li>
 </%def>
 
+<%def name="showUserList(userlist)">
+  <table>
+    <tr>
+      <th class="table_header_h table_checkbox">&nbsp;</th>
+      <th class="table_header_h table_description">${_('cm_organisation_table_cm')}</th>
+    </tr>
+    % for num, user in enumerate(userlist):
+      <tr class="${num % 2 and 'table_row_v_12' or ''}">
+        <td><input type="checkbox" name="userid" value="${user.id}" 
+                   id="user-${user.id}"></td>
+        <td><label for="user-${user.id}">${user.last_name}, ${user.first_name}</label></td>
+      </tr>
+    % endfor
+  </table>
+</%def>
+
 <div class="waska_form">
   <form id="waska_form" 
-        action="${h.url_for(controller='/jmdstruktur', action='permissionAction')}"
+        action="${h.url_for(controller='/jmdstruktur', 
+                            action='permissionAction')}"
         accept-charset="UTF-8"
         name="waska_form" method="POST">
     <h1>Benutzerrechte</h1>
     <p>
-      Bitte wählen Sie aus der Liste die Benutzer aus, die berechtigt sein sollen, die JMD-Strukturfallakten zu lesen und zu bearbeiten.
+      Bitte wählen Sie aus der Liste die Benutzer aus, die berechtigt
+      sein sollen, die JMD-Strukturfallakten zu lesen und zu bearbeiten.
     </p>
-    <fieldset>
-      <legend>Benutzer</legend>
-    % if len(c.userlist) > 0:
-      <ul>
-      % for user in c.userlist:
-        <li>
-          <input type="checkbox" name="userid" value="${user.id}" id="user-${user.id}">
-          <label for="user-${user.id}">
-            ${user.last_name}, ${user.first_name}
-          </label>
-        </li>
-      % endfor
-      </ul>
-    % else:
-      Keine Benutzer gefunden
-    % endif
-    </fieldset>
+    ${showUserList(c.userlist)}
     <div class="input_space">
       <p>
         <input type="submit" value="Berechtigung setzen" name="save">



More information about the Mpuls-commits mailing list