summaryrefslogtreecommitdiffstats
path: root/idp/extra/modules/identities_ui.ptl
diff options
context:
space:
mode:
authorFrederic Peters <fpeters@0d.be>2008-05-02 09:31:52 (GMT)
committerFrederic Peters <fpeters@0d.be>2008-05-02 09:31:52 (GMT)
commitfe5228171036efe4241de8fb5dae78d2ba946b0b (patch)
tree768cb86c8a71d87a8ec8d7a86aad110949f74577 /idp/extra/modules/identities_ui.ptl
parenta8858842c490a9d290220f432f16cfdc948318ef (diff)
downloadpratic-fe5228171036efe4241de8fb5dae78d2ba946b0b.zip
pratic-fe5228171036efe4241de8fb5dae78d2ba946b0b.tar.gz
pratic-fe5228171036efe4241de8fb5dae78d2ba946b0b.tar.bz2
use letter index also for authorizations
Diffstat (limited to 'idp/extra/modules/identities_ui.ptl')
-rw-r--r--idp/extra/modules/identities_ui.ptl25
1 files changed, 21 insertions, 4 deletions
diff --git a/idp/extra/modules/identities_ui.ptl b/idp/extra/modules/identities_ui.ptl
index 5c3e998..944c30c 100644
--- a/idp/extra/modules/identities_ui.ptl
+++ b/idp/extra/modules/identities_ui.ptl
@@ -292,8 +292,6 @@ class IdentitiesDirectory(Directory):
if last_col is not None:
'</ul>'
-
-
def authorizations [html] (self):
if not self.collectivity:
raise errors.TraversalError()
@@ -312,7 +310,23 @@ class IdentitiesDirectory(Directory):
services = directory.get_service_instances(self.collectivity)
+ current_letter = get_request().form.get('letter', 'A')
+ if str(current_letter) not in string.letters:
+ current_letter = 'A'
+ '<div class="letters-nav">'
+ for letter in string.uppercase:
+ if letter == current_letter:
+ '<span class="current-letter">%s</span>' % letter
+ else:
+ '<a href="?letter=%s">%s</a>' % (letter, letter)
+ if letter != string.uppercase[-1]:
+ '-'
+ '</div>'
+ agents = directory.get_agents(self.collectivity,
+ first_letter = current_letter, sorted = True)
+
'<form method="post">'
+ '<input type="hidden" name="letter" value="%s"/>' % current_letter
'<table>'
'<thead>'
'<tr>'
@@ -331,7 +345,7 @@ class IdentitiesDirectory(Directory):
'</tr>'
'</thead>'
'<tbody>'
- for agent in directory.get_agents(self.collectivity, sorted = True):
+ for agent in agents:
if agent.cdg59isDisabled:
'<tr class="disabled">'
else:
@@ -352,8 +366,11 @@ class IdentitiesDirectory(Directory):
'</form>'
def authorizations_submit(self):
+ current_letter = get_request().form.get('letter', 'A')
+ agents = directory.get_agents(self.collectivity, first_letter = current_letter)
+
form = get_request().form
- for agent in directory.get_agents(self.collectivity):
+ for agent in agents:
accesses = agent.cdg59serviceAccesses
new_value = form.get(agent.username, [])
if sorted(accesses) != sorted(new_value):