Changeset 16529
- Timestamp:
- 7 Jul 2021, 06:51:05 (3 years ago)
- Location:
- main/waeup.kofa/trunk
- Files:
-
- 1 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/CHANGES.txt
r16526 r16529 4 4 1.7.2.dev0 (unreleased) 5 5 ======================= 6 7 * Show local roles on faculty, department, course and certificate pages 8 and provide 'Contact' button so that authenticated users can contact 9 officers via Kofa. 6 10 7 11 * Extend `IPayer` adapter. -
main/waeup.kofa/trunk/src/waeup/kofa/accesscodes/browser_templates/searchpage.pt
r11254 r16529 18 18 <p> </p> 19 19 <div tal:condition="view/hitlist"> 20 <h3 >Search Results</h3>20 <h3 i18n:translate="">Search Results</h3> 21 21 <input type="hidden" name="old_searchterm" 22 22 tal:attributes="value view/searchterm" /> -
main/waeup.kofa/trunk/src/waeup/kofa/browser/pages.py
r16525 r16529 2130 2130 label = _('Academic Section') 2131 2131 pnav = 1 2132 grok.template('facultypage') 2132 2133 2133 2134 2134 class FacultiesContainerManageFormPage(KofaEditFormPage): … … 2204 2204 # Faculty pages 2205 2205 # 2206 class FacultyPage(KofaPage ):2206 class FacultyPage(KofaPage, LocalRoleAssignmentUtilityView): 2207 2207 """Index page of faculties. 2208 2208 """ … … 2214 2214 @property 2215 2215 def label(self): 2216 return _('Departments')2216 return self.context.longtitle 2217 2217 2218 2218 class FacultyManageFormPage(KofaEditFormPage, … … 2355 2355 # Department pages 2356 2356 # 2357 class DepartmentPage(KofaPage ):2357 class DepartmentPage(KofaPage, LocalRoleAssignmentUtilityView): 2358 2358 """Department index page. 2359 2359 """ … … 2362 2362 grok.name('index') 2363 2363 pnav = 1 2364 label = _('Courses and Certificates') 2364 2365 @property 2366 def label(self): 2367 return self.context.longtitle 2365 2368 2366 2369 def update(self): … … 2549 2552 # Courses pages 2550 2553 # 2551 class CoursePage(KofaDisplayFormPage ):2554 class CoursePage(KofaDisplayFormPage, LocalRoleAssignmentUtilityView): 2552 2555 """Course index page. 2553 2556 """ … … 2632 2635 # Certificate pages 2633 2636 # 2634 class CertificatePage(KofaDisplayFormPage ):2637 class CertificatePage(KofaDisplayFormPage, LocalRoleAssignmentUtilityView): 2635 2638 """Index page for certificates. 2636 2639 """ -
main/waeup.kofa/trunk/src/waeup/kofa/browser/templates/departmentpage.pt
r11254 r16529 5 5 <li><a href="#tab2" data-toggle="tab"> 6 6 <span i18n:translate="">Certificates</span></a> 7 </li> 8 <li><a href="#tab3" data-toggle="tab"> 9 <span i18n:translate="">Local Roles</span></a> 7 10 </li> 8 11 </ul> … … 54 57 </table> 55 58 </div> 59 <div id="tab3" class="tab-pane"> 60 <br /> 61 <table class="table table-hover"> 62 <thead> 63 <tr> 64 <th i18n:translate="">Officer Name 65 </th> 66 <th i18n:translate="">Local Role 67 </th> 68 <th></th> 69 </tr> 70 </thead> 71 <tbody> 72 <tr tal:repeat="entry view/getUsersWithLocalRoles"> 73 <td tal:content="entry/public_name"> PUBLICNAME </td> 74 <td tal:content="entry/local_role_title"> LOCAL ROLE </td> 75 <td> 76 <a href="" 77 i18n:translate="" 78 tal:attributes="href python: view.url(entry['user'], 'contactuser')" 79 class="btn btn-success btn-xs">Contact</a> 80 </td> 81 </tr> 82 </tbody> 83 </table> 84 </div> 56 85 </div> -
main/waeup.kofa/trunk/src/waeup/kofa/browser/templates/facultypage.pt
r11254 r16529 1 <div i18n:domain="waeup.kofa" i18n:translate="" tal:condition="python: not len(context.keys())"> 2 There are no subobjects registered yet. 1 <ul i18n:domain="waeup.kofa" class="tabs nav nav-tabs" data-tabs="tabs"> 2 <li class="active"><a href="#tab1" data-toggle="tab"> 3 <span i18n:translate="">Departments</span></a> 4 </li> 5 <li><a href="#tab3" data-toggle="tab"> 6 <span i18n:translate="">Local Roles</span></a> 7 </li> 8 </ul> 9 <div i18n:domain="waeup.kofa" class="tab-content"> 10 <div id="tab1" class="active tab-pane"> 11 <br /> 12 <table class="table table-hover" i18n:domain="waeup.kofa"> 13 <thead> 14 <tr> 15 <th i18n:translate="">Code</th> 16 <th i18n:translate="">Title</th> 17 </tr> 18 </thead> 19 <tbody> 20 <tr tal:repeat="value context/values"> 21 <td> <a tal:attributes="href python: view.url(value)"> 22 <span tal:content="value/code">Name</span></a></td> 23 <td tal:content="value/longtitle">Title</td> 24 </tr> 25 </tbody> 26 </table> 27 </div> 28 <div id="tab3" class="tab-pane"> 29 <br /> 30 <table class="table table-hover"> 31 <thead> 32 <tr> 33 <th i18n:translate="">Officer Name 34 </th> 35 <th i18n:translate="">Local Role 36 </th> 37 <th></th> 38 </tr> 39 </thead> 40 <tbody> 41 <tr tal:repeat="entry view/getUsersWithLocalRoles"> 42 <td tal:content="entry/public_name"> PUBLICNAME </td> 43 <td tal:content="entry/local_role_title"> LOCAL ROLE </td> 44 <td> 45 <a href="" 46 i18n:translate="" 47 tal:attributes="href python: view.url(entry['user'], 'contactuser')" 48 class="btn btn-success btn-xs">Contact</a> 49 </td> 50 </tr> 51 </tbody> 52 </table> 53 </div> 3 54 </div> 4 55 5 <table class="table table-hover" i18n:domain="waeup.kofa"> 6 <thead> 7 <tr> 8 <th i18n:translate="">Code</th> 9 <th i18n:translate="">Title</th> 10 </tr> 11 </thead> 12 <tbody> 13 <tr tal:repeat="value context/values"> 14 <td> <a tal:attributes="href python: view.url(value)"> 15 <span tal:content="value/code">Name</span></a></td> 16 <td tal:content="value/longtitle">Title</td> 17 </tr> 18 </tbody> 19 </table> 56 57 58 59 60 61 62 -
main/waeup.kofa/trunk/src/waeup/kofa/doctests/pages.txt
r15818 r16529 470 470 >>> print browser.contents 471 471 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"... 472 ...<h1 class="kofa-content-label"> Departments</h1>472 ...<h1 class="kofa-content-label">Faculty of My renamed faculty (TF)</h1> 473 473 ...<td> <a href="http://localhost/myuniversity/faculties/TF/TD"> <span>TD</span></a></td> 474 474 ...<td>Department of TestDept (TD)</td> … … 503 503 >>> print browser.contents 504 504 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 505 ...<h1 class="kofa-content-label"> Departments</h1>505 ...<h1 class="kofa-content-label">Faculty of My renamed faculty (TF)</h1> 506 506 ...<td> <a href="http://localhost/myuniversity/faculties/TF/TD"> <span>TD</span></a></td> 507 507 ...<td>Department of My renamed dept (TD)</td> -
main/waeup.kofa/trunk/src/waeup/kofa/permissions.py
r16172 r16529 778 778 user = grok.getSite()['users'].get(user_name, None) 779 779 user_title = getattr(user, 'title', user_name) 780 public_name = getattr(user, 'public_name', None) 781 if not public_name: 782 public_name = user_title 780 783 local_role_title = getattr( 781 784 dict(get_all_roles()).get(local_role, None), 'title', None) 782 yield dict(user_name=user_name, 785 yield dict(user=user, 786 user_name=user_name, 783 787 user_title=user_title, 788 public_name=public_name, 784 789 local_role=local_role, 785 790 local_role_title=local_role_title, 786 setting=setting) 791 setting=setting, 792 ) 787 793 788 794
Note: See TracChangeset for help on using the changeset viewer.