Changeset 11010 for main/waeup.kofa/branches
- Timestamp:
- 30 Jan 2014, 12:32:32 (11 years ago)
- Location:
- main/waeup.kofa/branches/uli-diazo-themed/src/waeup/kofa/applicants
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/branches/uli-diazo-themed/src/waeup/kofa/applicants/browser.py
r10845 r11010 51 51 from waeup.kofa.browser.pages import ( 52 52 add_local_role, del_local_roles, doll_up, ExportCSVView) 53 from waeup.kofa.browser.resources import datepicker, tabs, datatable,warning53 from waeup.kofa.browser.resources import datepicker, tabs, warning 54 54 from waeup.kofa.interfaces import ( 55 55 IKofaObject, ILocalRolesAssignable, IExtFileStore, IPDF, … … 116 116 117 117 def update(self, *args, **kw): 118 datatable.need()119 118 form = self.request.form 120 119 self.results = [] … … 127 126 else: 128 127 if 'search' in form: 129 self.flash(_('Empty search string') )128 self.flash(_('Empty search string'), type='warning') 130 129 return 131 130 self.results = search(query=self.searchterm, 132 131 searchtype=self.searchtype, view=self) 133 132 if not self.results: 134 self.flash(_('No applicant found.') )133 self.flash(_('No applicant found.'), type='warning') 135 134 return 136 135 … … 150 149 151 150 def update(self): 152 tabs.need()153 datatable.need()154 151 warning.need() 155 152 self.tab1 = self.tab2 = self.tab3 = '' … … 180 177 child_id = form['val_id'] 181 178 else: 182 self.flash(_('No container selected!') )183 self.redirect(self.url(self.context, '@@manage')+' ?tab2')179 self.flash(_('No container selected!'), type='warning') 180 self.redirect(self.url(self.context, '@@manage')+'#tab2') 184 181 return 185 182 if not isinstance(child_id, list): … … 192 189 except: 193 190 self.flash(_('Could not delete:') + ' %s: %s: %s' % ( 194 id, sys.exc_info()[0], sys.exc_info()[1]))191 id, sys.exc_info()[0], sys.exc_info()[1]), type='danger') 195 192 if len(deleted): 196 193 self.flash(_('Successfully removed: ${a}', 197 194 mapping = {'a':', '.join(deleted)})) 198 self.redirect(self.url(self.context, '@@manage')+' ?tab2')195 self.redirect(self.url(self.context, '@@manage')+'#tab2') 199 196 return 200 197 … … 249 246 if code in self.context.keys(): 250 247 self.flash( 251 _('An applicants container for the same application type and entrance year exists already in the database.')) 248 _('An applicants container for the same application ' 249 'type and entrance year exists already in the database.'), 250 type='warning') 252 251 return 253 252 # Add new applicants container... … … 380 379 def update(self): 381 380 datepicker.need() # Enable jQuery datepicker in date fields. 382 tabs.need()383 381 toggleall.need() 384 382 self.tab1 = self.tab2 = self.tab3 = '' … … 388 386 setattr(self, qs, 'active') 389 387 warning.need() 390 datatable.need() # Enable jQurey datatables for contents listing391 388 return super(ApplicantsContainerManageFormPage, self).update() 392 389 … … 436 433 child_id = form['val_id'] 437 434 else: 438 self.flash(_('No applicant selected!') )439 self.redirect(self.url(self.context, '@@manage')+' ?tab2')435 self.flash(_('No applicant selected!'), type='warning') 436 self.redirect(self.url(self.context, '@@manage')+'#tab2') 440 437 return 441 438 if not isinstance(child_id, list): … … 448 445 except: 449 446 self.flash(_('Could not delete:') + ' %s: %s: %s' % ( 450 id, sys.exc_info()[0], sys.exc_info()[1]))447 id, sys.exc_info()[0], sys.exc_info()[1]), type='danger') 451 448 if len(deleted): 452 449 self.flash(_('Successfully removed: ${a}', 453 450 mapping = {'a':', '.join(deleted)})) 454 self.redirect(self.url(self.context, u'@@manage')+' ?tab2')451 self.redirect(self.url(self.context, u'@@manage')+'#tab2') 455 452 return 456 453 … … 461 458 child_id = form['val_id'] 462 459 else: 463 self.flash(_('No applicant selected!') )464 self.redirect(self.url(self.context, '@@manage')+' ?tab2')460 self.flash(_('No applicant selected!'), type='warning') 461 self.redirect(self.url(self.context, '@@manage')+'#tab2') 465 462 return 466 463 if not isinstance(child_id, list): … … 475 472 mapping = {'a': len(created)})) 476 473 else: 477 self.flash(_('No student could be created.') )478 self.redirect(self.url(self.context, u'@@manage')+' ?tab2')474 self.flash(_('No student could be created.'), type='warning') 475 self.redirect(self.url(self.context, u'@@manage')+'#tab2') 479 476 return 480 477 … … 591 588 def update(self): 592 589 msg = self.context.createStudent(view=self)[1] 593 self.flash(msg )590 self.flash(msg, type='warning') 594 591 self.redirect(self.url(self.context)) 595 592 return … … 631 628 mapping = {'a': len(created)})) 632 629 else: 633 self.flash(_('No student could be created.') )630 self.flash(_('No student could be created.'), type='warning') 634 631 self.redirect(self.url(self.context)) 635 632 return … … 651 648 if ticket.p_state == 'paid': 652 649 self.flash( 653 _('This type of payment has already been made.')) 650 _('This type of payment has already been made.'), 651 type='warning') 654 652 self.redirect(self.url(self.context)) 655 653 return … … 660 658 container, payment, self.context) 661 659 if error is not None: 662 self.flash(error )660 self.flash(error, type='danger') 663 661 self.redirect(self.url(self.context)) 664 662 return … … 710 708 self.context.p_id, self.context.p_category, 711 709 self.context.amount_auth, self.context.r_code)) 712 self.flash(msg )710 self.flash(msg, type='warning') 713 711 return 714 712 … … 764 762 if self.context.state in ('initialized', 'started', 'paid'): 765 763 self.flash( 766 _('Please pay and submit before trying to download the application slip.')) 764 _('Please pay and submit before trying to download ' 765 'the application slip.'), type='warning') 767 766 return self.redirect(self.url(self.context)) 768 767 return … … 785 784 size = file_size(upload) 786 785 if size > MAX_UPLOAD_SIZE: 787 view.flash(_('Uploaded image is too big!') )786 view.flash(_('Uploaded image is too big!'), type='danger') 788 787 return False 789 788 dummy, ext = os.path.splitext(upload.filename) 790 789 ext.lower() 791 790 if ext != '.jpg': 792 view.flash(_('jpg file extension expected.') )791 view.flash(_('jpg file extension expected.'), type='danger') 793 792 return False 794 793 upload.seek(0) # file pointer moved when determining size … … 873 872 errors = validator.validate_password(password, password_ctl) 874 873 if errors: 875 self.flash( ' '.join(errors) )874 self.flash( ' '.join(errors), type='danger') 876 875 return 877 876 if self.upload_success is False: # False is not None! … … 906 905 child_id = form['val_id'] 907 906 else: 908 self.flash(_('No payment selected.') )907 self.flash(_('No payment selected.'), type='warning') 909 908 self.redirect(self.url(self.context)) 910 909 return … … 920 919 except: 921 920 self.flash(_('Could not delete:') + ' %s: %s: %s' % ( 922 id, sys.exc_info()[0], sys.exc_info()[1]))921 id, sys.exc_info()[0], sys.exc_info()[1]), type='danger') 923 922 if len(deleted): 924 923 self.flash(_('Successfully removed: ${a}', … … 992 991 993 992 def emit_lock_message(self): 994 self.flash(_('The requested form is locked (read-only).')) 993 self.flash(_('The requested form is locked (read-only).'), 994 type='warning') 995 995 self.redirect(self.url(self.context)) 996 996 return … … 1033 1033 return 1034 1034 if data.get('course1', 1) == data.get('course2', 2): 1035 self.flash(_('1st and 2nd choice must be different.')) 1035 self.flash(_('1st and 2nd choice must be different.'), 1036 type='warning') 1036 1037 return 1037 1038 self.applyData(self.context, **data) … … 1044 1045 return # error during image upload. Ignore other values 1045 1046 if self.dataNotComplete(): 1046 self.flash(self.dataNotComplete() )1047 self.flash(self.dataNotComplete(), type='danger') 1047 1048 return 1048 1049 self.applyData(self.context, **data) … … 1051 1052 # might have forgotten to lock the form after changing the state 1052 1053 if state != self.submit_state: 1053 self.flash(_('The form cannot be submitted. Wrong state!')) 1054 self.flash(_('The form cannot be submitted. Wrong state!'), 1055 type='danger') 1054 1056 return 1055 1057 IWorkflowInfo(self.context).fireTransition('submit') … … 1105 1107 def update(self): 1106 1108 if self.context.expired: 1107 self.flash(_('Outside application period.') )1109 self.flash(_('Outside application period.'), type='warning') 1108 1110 self.redirect(self.url(self.context)) 1109 1111 return … … 1143 1145 applicant = results[0] 1144 1146 if getattr(applicant,'firstname',None) is None: 1145 self.flash(_('An error occurred.') )1147 self.flash(_('An error occurred.'), type='danger') 1146 1148 return 1147 1149 elif applicant.firstname.lower() != firstname.lower(): … … 1149 1151 # know that a record was found and only the firstname 1150 1152 # verification failed. 1151 self.flash(_('No application record found.') )1153 self.flash(_('No application record found.'), type='warning') 1152 1154 return 1153 1155 elif applicant.password is not None and \ 1154 1156 applicant.state != INITIALIZED: 1155 1157 self.flash(_('Your password has already been set and used. ' 1156 'Please proceed to the login page.')) 1158 'Please proceed to the login page.'), 1159 type='warning') 1157 1160 return 1158 1161 # Store email address but nothing else. … … 1161 1164 else: 1162 1165 # No record found, this is the truth. 1163 self.flash(_('No application record found.') )1166 self.flash(_('No application record found.'), type='warning') 1164 1167 return 1165 1168 else: -
main/waeup.kofa/branches/uli-diazo-themed/src/waeup/kofa/applicants/browser_templates/applicantsrootmanagepage.pt
r8547 r11010 1 1 <form action="." tal:attributes="action request/URL" 2 2 i18n:domain="waeup.kofa" method="POST" enctype="multipart/form-data"> 3 <ul class="tabs " data-tabs="tabs">4 <li tal:attributes="class view/tab1">5 <a href="#tab -1">3 <ul class="tabs nav nav-tabs" data-tabs="tabs"> 4 <li class="active"> 5 <a href="#tab1" data-toggle="tab"> 6 6 <span i18n:translate="">Introduction 7 7 </span></a> 8 8 </li> 9 <li tal:attributes="class view/tab2">10 <a href="#tab -2">9 <li> 10 <a href="#tab2" data-toggle="tab"> 11 11 <span tal:content="view/subunits">Contents 12 12 </span></a> 13 13 </li> 14 <li tal:attributes="class view/tab3">15 <a href="#tab -3">14 <li> 15 <a href="#tab3" data-toggle="tab"> 16 16 <span i18n:translate="">Local Roles 17 17 </span></a> … … 19 19 </ul> 20 20 <div class="tab-content"> 21 <div id="tab-1" tal:attributes="class view/tab1"> 21 <div id="tab1" class="active tab-pane"> 22 <br /> 22 23 <table class="form-table"> 23 24 <tbody> … … 25 26 </tbody> 26 27 </table> 27 28 28 <div tal:condition="view/availableActions"> 29 29 <span tal:repeat="action view/actions" tal:omit-tag=""> … … 33 33 </div> 34 34 </div> 35 <div id="tab-2" tal:attributes="class view/tab2"> 36 <h3 tal:content="view/subunits">SUBUNITS</h3> 37 35 <div id="tab2" class="tab-pane"> 36 <br /> 38 37 <p i18n:translate="note_armp"> 39 38 Please note that containers will be opened in manage mode here. … … 42 41 Please be patient until all records have been loaded. 43 42 </p> 44 45 <table class="display dataTableManage"> 43 <table class="dataTableManage"> 46 44 <thead> 47 45 <tr> … … 59 57 </thead> 60 58 <tbody> 61 <tr tal:repeat="entry context/values" class="gradeC"> <td>59 <tr tal:repeat="entry context/values"> <td> 62 60 <input type="checkbox" name="val_id" 63 61 tal:attributes="value entry/__name__" /> </td> … … 78 76 </div> 79 77 </div> 80 <div id="tab -3" tal:attributes="class view/tab3">78 <div id="tab3" class="tab-pane"> 81 79 <br /> 82 <table class="d isplay dataTableManage">80 <table class="dataTableManage"> 83 81 <thead> 84 82 <tr> … … 94 92 </thead> 95 93 <tbody> 96 <tr tal:repeat="entry view/getUsersWithLocalRoles" class="gradeC">94 <tr tal:repeat="entry view/getUsersWithLocalRoles"> 97 95 <td> <input type="checkbox" name="role_id" 98 96 tal:attributes="value python: entry['user_name']+'|'+entry['local_role']" /> </td> … … 109 107 </span> 110 108 </div> <br /><br /> 111 <table class="form-table"> 112 <tr> <td> 113 <select id="user" name="user"> 114 <option tal:repeat="user view/getUsers" 115 tal:attributes="value user/name"> 116 <span tal:replace="user/val/title">USERTITLE 117 </span> 118 </option> 119 </select> </td> <td> 120 <select id="local_role" name="local_role"> 121 <option tal:repeat="localrole view/getLocalRoles" 122 tal:attributes="value localrole/name"> 123 <span tal:replace="localrole/title">LOCALROLETITLE 124 </span> 125 </option> 126 </select> </td> <td> 127 <div tal:condition="view/availableActions"> 128 <span tal:repeat="action view/actions" tal:omit-tag=""> 129 <input tal:condition="python:action.label in view.tabthreeactions2" 130 tal:replace="structure action/render"/> 131 </span> 132 </div> </td> 133 </tr> 134 </table> 109 <div class="form-inline"> 110 <br /> 111 <div class="form-group"> 112 <select id="user" name="user"> 113 <option tal:repeat="user view/getUsers" 114 tal:attributes="value user/name"> 115 <span tal:replace="user/val/title">USERTITLE 116 </span> 117 </option> 118 </select> 119 </div> 120 <div class="form-group"> 121 <select id="local_role" name="local_role"> 122 <option tal:repeat="localrole view/getLocalRoles" 123 tal:attributes="value localrole/name"> 124 <span tal:replace="localrole/title">LOCALROLETITLE 125 </span> 126 </option> 127 </select> 128 </div> 129 <div class="form-group" tal:condition="view/availableActions"> 130 <span tal:repeat="action view/actions" tal:omit-tag=""> 131 <input tal:condition="python:action.label in view.tabthreeactions2" 132 tal:replace="structure action/render"/> 133 </span> 134 </div> 135 </div> 135 136 </div> 136 137 </div> -
main/waeup.kofa/branches/uli-diazo-themed/src/waeup/kofa/applicants/browser_templates/applicantsrootpage.pt
r10097 r11010 4 4 </span> 5 5 6 <table i18n:domain="waeup.kofa" >6 <table i18n:domain="waeup.kofa" class="table table-hover"> 7 7 <thead> 8 8 <tr>
Note: See TracChangeset for help on using the changeset viewer.