Ignore:
Timestamp:
30 Jan 2014, 12:32:32 (11 years ago)
Author:
Henrik Bettermann
Message:

Adjust applicantsrootmanagepage.pt.

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  
    5151from waeup.kofa.browser.pages import (
    5252    add_local_role, del_local_roles, doll_up, ExportCSVView)
    53 from waeup.kofa.browser.resources import datepicker, tabs, datatable, warning
     53from waeup.kofa.browser.resources import datepicker, tabs, warning
    5454from waeup.kofa.interfaces import (
    5555    IKofaObject, ILocalRolesAssignable, IExtFileStore, IPDF,
     
    116116
    117117    def update(self, *args, **kw):
    118         datatable.need()
    119118        form = self.request.form
    120119        self.results = []
     
    127126        else:
    128127            if 'search' in form:
    129                 self.flash(_('Empty search string'))
     128                self.flash(_('Empty search string'), type='warning')
    130129            return
    131130        self.results = search(query=self.searchterm,
    132131            searchtype=self.searchtype, view=self)
    133132        if not self.results:
    134             self.flash(_('No applicant found.'))
     133            self.flash(_('No applicant found.'), type='warning')
    135134        return
    136135
     
    150149
    151150    def update(self):
    152         tabs.need()
    153         datatable.need()
    154151        warning.need()
    155152        self.tab1 = self.tab2 = self.tab3 = ''
     
    180177            child_id = form['val_id']
    181178        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')
    184181            return
    185182        if not isinstance(child_id, list):
     
    192189            except:
    193190                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')
    195192        if len(deleted):
    196193            self.flash(_('Successfully removed: ${a}',
    197194                mapping = {'a':', '.join(deleted)}))
    198         self.redirect(self.url(self.context, '@@manage')+'?tab2')
     195        self.redirect(self.url(self.context, '@@manage')+'#tab2')
    199196        return
    200197
     
    249246        if code in self.context.keys():
    250247            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')
    252251            return
    253252        # Add new applicants container...
     
    380379    def update(self):
    381380        datepicker.need() # Enable jQuery datepicker in date fields.
    382         tabs.need()
    383381        toggleall.need()
    384382        self.tab1 = self.tab2 = self.tab3 = ''
     
    388386        setattr(self, qs, 'active')
    389387        warning.need()
    390         datatable.need()  # Enable jQurey datatables for contents listing
    391388        return super(ApplicantsContainerManageFormPage, self).update()
    392389
     
    436433            child_id = form['val_id']
    437434        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')
    440437            return
    441438        if not isinstance(child_id, list):
     
    448445            except:
    449446                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')
    451448        if len(deleted):
    452449            self.flash(_('Successfully removed: ${a}',
    453450                mapping = {'a':', '.join(deleted)}))
    454         self.redirect(self.url(self.context, u'@@manage')+'?tab2')
     451        self.redirect(self.url(self.context, u'@@manage')+'#tab2')
    455452        return
    456453
     
    461458            child_id = form['val_id']
    462459        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')
    465462            return
    466463        if not isinstance(child_id, list):
     
    475472                mapping = {'a': len(created)}))
    476473        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')
    479476        return
    480477
     
    591588    def update(self):
    592589        msg = self.context.createStudent(view=self)[1]
    593         self.flash(msg)
     590        self.flash(msg, type='warning')
    594591        self.redirect(self.url(self.context))
    595592        return
     
    631628                mapping = {'a': len(created)}))
    632629        else:
    633             self.flash(_('No student could be created.'))
     630            self.flash(_('No student could be created.'), type='warning')
    634631        self.redirect(self.url(self.context))
    635632        return
     
    651648            if ticket.p_state == 'paid':
    652649                  self.flash(
    653                       _('This type of payment has already been made.'))
     650                      _('This type of payment has already been made.'),
     651                      type='warning')
    654652                  self.redirect(self.url(self.context))
    655653                  return
     
    660658            container, payment, self.context)
    661659        if error is not None:
    662             self.flash(error)
     660            self.flash(error, type='danger')
    663661            self.redirect(self.url(self.context))
    664662            return
     
    710708                self.context.p_id, self.context.p_category,
    711709                self.context.amount_auth, self.context.r_code))
    712         self.flash(msg)
     710        self.flash(msg, type='warning')
    713711        return
    714712
     
    764762        if self.context.state in ('initialized', 'started', 'paid'):
    765763            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')
    767766            return self.redirect(self.url(self.context))
    768767        return
     
    785784    size = file_size(upload)
    786785    if size > MAX_UPLOAD_SIZE:
    787         view.flash(_('Uploaded image is too big!'))
     786        view.flash(_('Uploaded image is too big!'), type='danger')
    788787        return False
    789788    dummy, ext = os.path.splitext(upload.filename)
    790789    ext.lower()
    791790    if ext != '.jpg':
    792         view.flash(_('jpg file extension expected.'))
     791        view.flash(_('jpg file extension expected.'), type='danger')
    793792        return False
    794793    upload.seek(0) # file pointer moved when determining size
     
    873872            errors = validator.validate_password(password, password_ctl)
    874873            if errors:
    875                 self.flash( ' '.join(errors))
     874                self.flash( ' '.join(errors), type='danger')
    876875                return
    877876        if self.upload_success is False:  # False is not None!
     
    906905            child_id = form['val_id']
    907906        else:
    908             self.flash(_('No payment selected.'))
     907            self.flash(_('No payment selected.'), type='warning')
    909908            self.redirect(self.url(self.context))
    910909            return
     
    920919                except:
    921920                    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')
    923922        if len(deleted):
    924923            self.flash(_('Successfully removed: ${a}',
     
    992991
    993992    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')
    995995        self.redirect(self.url(self.context))
    996996        return
     
    10331033            return
    10341034        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')
    10361037            return
    10371038        self.applyData(self.context, **data)
     
    10441045            return # error during image upload. Ignore other values
    10451046        if self.dataNotComplete():
    1046             self.flash(self.dataNotComplete())
     1047            self.flash(self.dataNotComplete(), type='danger')
    10471048            return
    10481049        self.applyData(self.context, **data)
     
    10511052        # might have forgotten to lock the form after changing the state
    10521053        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')
    10541056            return
    10551057        IWorkflowInfo(self.context).fireTransition('submit')
     
    11051107    def update(self):
    11061108        if self.context.expired:
    1107             self.flash(_('Outside application period.'))
     1109            self.flash(_('Outside application period.'), type='warning')
    11081110            self.redirect(self.url(self.context))
    11091111            return
     
    11431145                applicant = results[0]
    11441146                if getattr(applicant,'firstname',None) is None:
    1145                     self.flash(_('An error occurred.'))
     1147                    self.flash(_('An error occurred.'), type='danger')
    11461148                    return
    11471149                elif applicant.firstname.lower() != firstname.lower():
     
    11491151                    # know that a record was found and only the firstname
    11501152                    # verification failed.
    1151                     self.flash(_('No application record found.'))
     1153                    self.flash(_('No application record found.'), type='warning')
    11521154                    return
    11531155                elif applicant.password is not None and \
    11541156                    applicant.state != INITIALIZED:
    11551157                    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')
    11571160                    return
    11581161                # Store email address but nothing else.
     
    11611164            else:
    11621165                # No record found, this is the truth.
    1163                 self.flash(_('No application record found.'))
     1166                self.flash(_('No application record found.'), type='warning')
    11641167                return
    11651168        else:
  • main/waeup.kofa/branches/uli-diazo-themed/src/waeup/kofa/applicants/browser_templates/applicantsrootmanagepage.pt

    r8547 r11010  
    11<form action="." tal:attributes="action request/URL"
    22  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">
    66      <span i18n:translate="">Introduction
    77      </span></a>
    88    </li>
    9     <li tal:attributes="class view/tab2">
    10     <a href="#tab-2">
     9    <li>
     10    <a href="#tab2" data-toggle="tab">
    1111      <span tal:content="view/subunits">Contents
    1212      </span></a>
    1313    </li>
    14     <li tal:attributes="class view/tab3">
    15     <a href="#tab-3">
     14    <li>
     15    <a href="#tab3" data-toggle="tab">
    1616      <span i18n:translate="">Local Roles
    1717      </span></a>
     
    1919  </ul>
    2020  <div class="tab-content">
    21     <div id="tab-1" tal:attributes="class view/tab1">
     21    <div id="tab1" class="active tab-pane">
     22     <br />
    2223      <table class="form-table">
    2324        <tbody>
     
    2526        </tbody>
    2627      </table>
    27 
    2828      <div tal:condition="view/availableActions">
    2929        <span tal:repeat="action view/actions" tal:omit-tag="">
     
    3333      </div>
    3434    </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 />
    3837      <p i18n:translate="note_armp">
    3938        Please note that containers will be opened in manage mode here.
     
    4241        Please be patient until all records have been loaded.
    4342      </p>
    44 
    45       <table class="display dataTableManage">
     43      <table class="dataTableManage">
    4644        <thead>
    4745          <tr>
     
    5957        </thead>
    6058        <tbody>
    61           <tr tal:repeat="entry context/values"         class="gradeC"> <td>
     59          <tr tal:repeat="entry context/values"> <td>
    6260              <input type="checkbox" name="val_id"
    6361                tal:attributes="value entry/__name__" /> </td>
     
    7876      </div>
    7977    </div>
    80     <div id="tab-3" tal:attributes="class view/tab3">
     78    <div id="tab3" class="tab-pane">
    8179      <br />
    82       <table class="display dataTableManage">
     80      <table class="dataTableManage">
    8381        <thead>
    8482          <tr>
     
    9492        </thead>
    9593        <tbody>
    96           <tr tal:repeat="entry view/getUsersWithLocalRoles" class="gradeC">
     94          <tr tal:repeat="entry view/getUsersWithLocalRoles">
    9795            <td> <input type="checkbox" name="role_id"
    9896                    tal:attributes="value python: entry['user_name']+'|'+entry['local_role']" />  </td>
     
    109107        </span>
    110108      </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>
    135136    </div>
    136137  </div>
  • main/waeup.kofa/branches/uli-diazo-themed/src/waeup/kofa/applicants/browser_templates/applicantsrootpage.pt

    r10097 r11010  
    44</span>
    55
    6 <table i18n:domain="waeup.kofa">
     6<table i18n:domain="waeup.kofa" class="table table-hover">
    77  <thead>
    88    <tr>
Note: See TracChangeset for help on using the changeset viewer.