eggification
[GroupUserFolder.git] / Products / GroupUserFolder / dtml / GRUF_groups.zpt
diff --git a/Products/GroupUserFolder/dtml/GRUF_groups.zpt b/Products/GroupUserFolder/dtml/GRUF_groups.zpt
new file mode 100644 (file)
index 0000000..64fe589
--- /dev/null
@@ -0,0 +1,267 @@
+<h1 tal:replace="structure here/manage_page_header">Header</h1>
+<h2 tal:define="manage_tabs_message options/manage_tabs_message | nothing"
+    tal:replace="structure here/manage_tabs">Tabs</h2>
+
+  <h4>Groups sources</h4>
+  <!-- Groups source row -->
+  <ol>
+    <table cellspacing="10" width="90%" tal:define="groups here/getGroups">
+      <tr>
+        <th class="list-header">Groups source</th>
+        <td bgcolor="#EEEEEE">
+          <img src="" tal:attributes="src here/Groups/acl_users/icon">&nbsp;
+            <a href="Groups/acl_users/manage_workspace" tal:content="here/Groups/acl_users/meta_type">Type</a>
+        </td>
+      </tr>
+    </table>
+  </ol>
+
+  <h4>Groups management</h4>
+  <form action="" method="POST" tal:attributes="action here/absolute_url">
+    <ol>
+      <table cellspacing="10" width="90%" tal:define="groups here/getGroups">
+        <tr>
+          <!-- Groups selection -->
+          <td valign="top">
+            <table bgcolor="#EEEEEE" width="100%">
+              <tr class="list-header" tal:condition="groups">
+                <th>&nbsp;</th>
+                <th>Group</th>
+                <th class="list-header">Member <br>of groups</th>
+                <th class="list-header">Implicitly <br>member of*</th>
+                <th class="list-header">Has roles</th>
+                <th class="list-header">Implicitly <br>has roles**</th>
+              </tr>
+              
+              <tr 
+                  tal:repeat="group groups" class="" tal:attributes="class python:test(path('repeat/group/odd'), 'row-hilite', 'row-normal')"
+                >
+                <div tal:define="
+                  label_groups python:group.getGroups();
+                  label_groups_no_recurse python:group.getImmediateGroups();
+                  label_groups_recurse python:filter(lambda x: x not in label_groups_no_recurse, label_groups);
+                  groups_no_recurse python:map(lambda x: here.getUser(x), label_groups_no_recurse);
+                  groups_recurse python:map(lambda x: here.getUser(x), label_groups_recurse);
+                  roles python:filter(lambda x: x not in ('Authenticated', 'Shared'), group.getRoles());
+                  roles_no_recurse python:filter(lambda x: x not in ('Authenticated', 'Shared'), group.getUserRoles());
+                  roles_recurse python:filter(lambda x: x not in roles_no_recurse, roles);"
+                  tal:omit-tag="">
+                  <td><div class="list-item"><input type="checkbox" name="groups:list" value="" tal:attributes="value group"></td>
+                  <td>
+                    <div class="list-item">
+                      <img src="img_group">
+                      <strong tal:content="structure group/asHTML">
+                      </strong>
+                    </td>
+                    <td class="list-item">
+                      <span tal:repeat="group groups_no_recurse" >
+                        <span tal:replace="structure group/asHTML"></span><span tal:condition="not:repeat/group/end">, </span>
+                      </span>
+                    </td>
+                    <td class="list-item">
+                      <span tal:repeat="group groups_recurse" >
+                        <span tal:replace="structure python:group.asHTML(implicit=1)"></span><span tal:condition="not:repeat/group/end">, </span>
+                      </span>
+                    </td>
+                    <td class="list-item">
+                      <div class="list-item">
+                        <span tal:repeat="role roles_no_recurse" >
+                          <font color=""
+                                tal:attributes="color here/role_color">
+                            <span tal:replace="role"></span><span tal:condition="not:repeat/role/end">, </span>
+                          </font>
+                        </span>
+                      </div>
+                    </td>
+                    <td class="list-item">
+                      <div class="list-item">
+                        <span tal:repeat="role roles_recurse" >
+                          <font color=""
+                                tal:attributes="color here/role_color">
+                            <i><span tal:replace="role"></span></i><span tal:condition="not:repeat/role/end">, </span>
+                          </font>
+                        </span>
+                      </div>
+                    </td>
+                </div>
+              </tr>
+
+              <!-- New user -->
+              <tr>
+                <td><div class="list-item">&nbsp;</div></td>
+                <td><div class="list-item">Create groups:<br /><textarea name="new_groups:lines" cols="20" rows="3"></textarea></div></td>
+                <td colspan="4">
+                  <div class="list-item">
+                    Newly created groups will be affected groups and roles according to the table below.
+                  </div>
+                </td>
+              </tr>
+              <tr>
+                <td colspan="2" align="center">
+                  <input type="submit" name="changeOrCreateGroups:method" value="Create" />
+                    &nbsp;
+                    <input type="submit" name="deleteGroups:method" value="Delete" />
+                </td>
+              </tr>
+            </table>
+          </td>
+        </tr>
+        <tr>
+          <td align="center">
+            <div class="list-item">
+              Select one or more users in the upper table, select one or more groups / roles in the table below
+              and click "Change" to affect groups / roles to these users.
+            </div>
+          </td>
+        </tr>
+        <tr>
+          <td valign="top" align="center" colspan="6">
+            <table  bgcolor="#EEEEEE">
+              <tr>
+                <td valign="top">
+                  <!-- Groups selection -->
+                  <table width="100%">
+                    <tr class="list-header">
+                      <th colspan="2">Affect groups</th>
+                    </tr>
+                    
+                    <tr tal:repeat="group here/getGroups">
+                      <td>
+                        <input type="checkbox" name="nested_groups:list" value="" tal:attributes="value group">
+                      </td>
+                      <td>
+                        <div class="list-item" tal:content="structure group/asHTML"></div>
+                      </td>
+                    </tr>
+                    
+                    <!-- "(None)" item -->
+                    <tr>
+                      <td><div class="list-item"><input type="checkbox" name="nested_groups:list" value="__None__"></div></td>
+                      <td><div class="list-item"><i>(None)</i></div></td>
+                    </tr>
+                  </table>
+                </td>
+                <td valign="top">
+                    <!-- Roles selection -->
+                    <table width="100%">
+                      <tr class="list-header">
+                        <th colspan="2">Affect roles</th>
+                      </tr>
+                      
+                      <tr tal:repeat="role here/valid_roles">
+                        <td tal:condition="python:role not in ('Authenticated', 'Anonymous', 'Shared')">
+                          <input type="checkbox" name="roles:list" value="" tal:attributes="value role">
+                        </td>
+                        <td tal:condition="python:role not in ('Authenticated', 'Anonymous', 'Shared')">
+                          <div class="list-item"><font color="" tal:attributes="color here/role_color" tal:content="role">Role</font></div>
+                        </td>
+                      </tr>
+                      
+                      <!-- "(None)" item -->
+                      <tr>
+                        <td><div class="list-item"><input type="checkbox" name="roles:list" value="__None__"></div></td>
+                        <td><div class="list-item"><i>(None)</i></div></td>
+                      </tr>
+                    </table>
+                </td>
+              </tr>
+              <tr>
+                <td colspan="2" align="middle"><input type="submit" name="changeOrCreateGroups:method" value="Change" /></td>
+            </table>
+          </td>
+        </tr>
+      </table>
+
+
+
+
+        <tr tal:replace="nothing">
+          <td valign="top" bgcolor="#EEEEEE">
+            <!-- Groups selection -->
+            <table width="100%">
+              <tr class="list-header">
+                <th colspan="2">Affect groups</th>
+              </tr>
+              
+              <tr tal:repeat="group here/getGroups">
+                <td>
+                  <input type="checkbox" name="nested_groups:list" value="" tal:attributes="value group">
+                </td>
+                <td>
+                  <div class="list-item" tal:content="structure group/asHTML"></div>
+                </td>
+              </tr>
+              
+              <!-- "(None)" item -->
+              <tr>
+                <td><div class="list-item"><input type="checkbox" name="nested_groups:list" value="__None__"></div></td>
+                <td><div class="list-item"><i>(None)</i></div></td>
+              </tr>
+            </table>
+            
+            <br>
+              
+              <!-- Roles selection -->
+              <table width="100%">
+              <tr class="list-header">
+                <th colspan="2">Affect roles</th>
+              </tr>
+              
+              <tr tal:repeat="role here/valid_roles">
+                <td tal:condition="python:role not in ('Authenticated', 'Anonymous', 'Shared')">
+                  <input type="checkbox" name="roles:list" value="" tal:attributes="value role">
+                </td>
+                <td tal:condition="python:role not in ('Authenticated', 'Anonymous', 'Shared')">
+                  <div class="list-item"><font color="" tal:attributes="color here/role_color" tal:content="role">Role</font></div>
+                </td>
+              </tr>
+                <!-- "(None)" item -->
+                <tr>
+                  <td><div class="list-item"><input type="checkbox" name="roles:list" value="__None__"></div></td>
+                  <td><div class="list-item"><i>(None)</i></div></td>
+                </tr>
+            </table>
+          </td>
+        </tr>
+
+      <p class="form-help">
+        * According to the groups inheritance, this group is also recursively member of these groups. <br />This is what we call nested groups.
+      </p>
+      <p class="form-help">
+        ** Accorded to the groups inheritance, this group also has these roles - even if they are not defined explicitly on it.
+      </p>
+
+    </ol>
+  </form>
+
+
+  <h4>Instructions</h4>
+  <ol>
+
+      <p class="form-help">
+        To change roles for one or several groups, select them in the left form, select the roles you want to give them in the form on the right and click "Change".<br />
+        You can also create one or several groups by filling the text area (one group per line). the "Change" button will create them with the roles you've selected.<br />
+        If you are fed up with some groups, you can delete them by selecting them and clicking the "Delete" button.
+      </p>
+      <p class="form-help">
+        If you do not select any role, roles won't be reseted for the selected groups.<br />
+        If you do not select any group, groups won't be reseted for the selected groups.<br />
+        To explicitly reset groups or roles, just click the "(None)" entry (and no other entry).
+      </p>
+  </ol>
+
+  <h4>Important notice / disclaimer</h4>
+  
+  <ol>
+    <p class="form-help">
+      This form uses the regular Zope Security API from the underlying user folders. However, you may experience problems with some
+      of them, especially if they are not tuned to allow user adding. For example, an LDAPUserFolder can be configured to disable
+      users management. In case this form doesn't work, you'll have to do things by hand within the 'Users' and 'Groups' GRUF folders.
+    </p>
+
+    <p class="form-help">
+      This is not a GRUF limitation ! :-)
+    </p>
+  </ol>
+
+<h1 tal:replace="structure here/manage_page_footer">Footer</h1>