Changeset 7176 for main/waeup.sirp/trunk/src/waeup/sirp/browser
- Timestamp:
- 23 Nov 2011, 07:21:03 (13 years ago)
- Location:
- main/waeup.sirp/trunk/src/waeup/sirp/browser
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/browser/layout.py
r7162 r7176 170 170 return 'waeup.Student' in roles 171 171 172 def getLocalRoles(self, account):173 """Return HTML tagged string with all local roles of a user account.174 """175 local_roles = account.getLocalRoles()176 local_roles_string = ''177 site_url = self.url(grok.getSite())178 for local_role in local_roles.keys():179 role_title = dict(getRoles())[local_role].title180 objects_string = ''181 for object in local_roles[local_role]:182 objects_string += '<a href="%s">%s</a>, ' %(self.url(object),183 self.url(object).replace(site_url,''))184 local_roles_string += '%s: <br />%s <br />' %(role_title,185 objects_string.rstrip(', '))186 return local_roles_string187 188 def getGlobalRoles(self, account):189 """Return HTML tagged string with all global roles of a user account.190 """191 global_roles = account.roles192 global_roles_string = ''193 for global_role in global_roles:194 role_title = dict(getRoles())[global_role].title195 global_roles_string += '%s <br />' % role_title196 return global_roles_string197 198 172 def update(self): 199 173 """Include the resources required by the chosen skin/theme. -
main/waeup.sirp/trunk/src/waeup/sirp/browser/pages.py
r7172 r7176 37 37 ISessionConfiguration, ISessionConfigurationAdd, academic_sessions_vocab, 38 38 IPasswordValidator) 39 from waeup.sirp.permissions import get_users_with_local_roles 39 from waeup.sirp.permissions import ( 40 get_users_with_local_roles, 41 getGlobalRolesForAccount, getLocalRolesForAccount) 40 42 from waeup.sirp.university.catalog import search 41 43 from waeup.sirp.university.vocabularies import course_levels … … 259 261 self.context.delUser(userid) 260 262 self.flash('User %s successfully deleted.' % userid) 263 264 def getLocalRoles(self, account): 265 return getLocalRolesForAccount(self, account) 266 267 def getGlobalRoles(self, account): 268 return getGlobalRolesForAccount(account) 261 269 262 270 class AddUserFormPage(WAeUPAddFormPage): -
main/waeup.sirp/trunk/src/waeup/sirp/browser/templates/userscontainerpage.pt
r7172 r7176 21 21 <td tal:content="account/title">Title</td> 22 22 <td tal:content="account/description">Description</td> 23 <td tal:content="structure python: layout.getGlobalRoles(account)">Global Roles</td>24 <td tal:content="structure python: layout.getLocalRoles(account)">Local Roles</td>23 <td tal:content="structure python:view.getGlobalRoles(account)">Global Roles</td> 24 <td tal:content="structure python:view.getLocalRoles(account)">Local Roles</td> 25 25 <td class="text-right"> 26 26 <form method="post">
Note: See TracChangeset for help on using the changeset viewer.