Changeset 6183 for main/waeup.sirp/trunk/src/waeup/sirp/browser
- Timestamp:
- 21 May 2011, 17:04:59 (14 years ago)
- Location:
- main/waeup.sirp/trunk/src/waeup/sirp/browser
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/browser/pages.py
r6181 r6183 37 37 IWAeUPXMLImporter, IWAeUPXMLExporter, IBatchProcessor, 38 38 ILocalRolesAssignable) 39 from waeup.sirp.permissions import get_users_with_local_roles 39 from waeup.sirp.permissions import get_users_with_local_roles, getRoles 40 40 from waeup.sirp.university.catalog import search 41 41 from waeup.sirp.university.vocabularies import course_levels … … 262 262 self.flash('User %s successfully deleted.' % userid) 263 263 264 def getLocalRoles(self,account): 265 local_roles = account.getLocalRoles() 266 local_roles_string = '' 267 site_url = self.url(grok.getSite()) 268 for local_role in local_roles.keys(): 269 role_title = dict(getRoles())[local_role].title 270 objects_string = '' 271 for object in local_roles[local_role]: 272 objects_string += '<a href="%s">%s</a>, ' %(self.url(object), 273 self.url(object).replace(site_url,'')) 274 local_roles_string += '%s: %s <br />' %(role_title, 275 objects_string.rstrip(', ')) 276 return local_roles_string 277 264 278 class AddUserFormPage(WAeUPAddFormPage): 265 279 grok.require('waeup.manageUsers') -
main/waeup.sirp/trunk/src/waeup/sirp/browser/templates/usercontainerpage.pt
r6181 r6183 20 20 <td tal:content="account/title">Title</td> 21 21 <td tal:content="account/description">Description</td> 22 <td tal:content=" account/getLocalRoles">Local Roles</td>22 <td tal:content="structure python:view.getLocalRoles(account)">Local Roles</td> 23 23 <td class="text-right"> 24 24 <form method="post">
Note: See TracChangeset for help on using the changeset viewer.