Ignore:
Timestamp:
12 Jan 2012, 16:19:57 (13 years ago)
Author:
Henrik Bettermann
Message:

Merge Bootstrap branch into trunk.

Location:
main/waeup.sirp/trunk/src/waeup/sirp/students
Files:
29 edited
1 copied

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/trunk/src/waeup/sirp/students/browser.py

    r7424 r7459  
    3636    SIRPPage, SIRPEditFormPage, SIRPAddFormPage, SIRPDisplayFormPage,
    3737    ContactAdminForm, SIRPForm)
    38 from waeup.sirp.browser.interfaces import ICaptchaManager
     38from waeup.sirp.browser.interfaces import ICaptchaManager, IBreadcrumbIgnorable
    3939from waeup.sirp.browser.breadcrumbs import Breadcrumb
    4040from waeup.sirp.browser.resources import datepicker, datatable, tabs, warning
    4141from waeup.sirp.browser.viewlets import (
    4242    ManageActionButton, AddActionButton)
    43 from waeup.sirp.browser.layout import jsaction, JSAction
     43from waeup.sirp.browser.layout import jsaction, action, UtilityView
    4444from waeup.sirp.interfaces import (
    4545    ISIRPObject, IUserAccount, IExtFileStore, IPasswordValidator, IContactForm,
     
    6464from waeup.sirp.applicants.interfaces import IApplicantBaseData
    6565from waeup.sirp.hostels.hostel import NOT_OCCUPIED
     66from waeup.sirp.utils.helpers import get_current_principal
    6667
    6768def write_log_message(view, message):
     
    9697    grok.context(IStudentsContainer)
    9798    title = 'Students'
     99    #grok.implements(IBreadcrumbIgnorable)
     100
     101    @property
     102    def target(self):
     103        user = get_current_principal()
     104        #import pdb; pdb.set_trace()
     105        if getattr(user, 'user_type', None) == 'student':
     106            return None
     107        return self.viewname
    98108
    99109class StudentBreadcrumb(Breadcrumb):
     
    131141    grok.context(IStudentAccommodation)
    132142    title = 'Accommodation'
    133 
    134     #@property
    135     #def target(self):
    136     #    prm = get_principal_role_manager()
    137     #    principal = get_current_principal()
    138     #    roles = [x[0] for x in prm.getRolesForPrincipal(principal.id)]
    139     #    if 'waeup.Student' in roles:
    140     #        return 'index'
    141     #    else:
    142     #        return 'manage'
    143143
    144144class BedTicketBreadcrumb(Breadcrumb):
     
    293293            if not self.hitlist:
    294294                self.flash('No student found.')
     295            if 'remove' in form:
     296                self.flash('No item selected.')
    295297            return
    296298        entries = form['entries']
     
    328330    pnav = 4
    329331
    330     @grok.action('Create student record')
     332    @action('Create student record', style='primary')
    331333    def addStudent(self, **data):
    332334        student = createObject(u'waeup.Student')
     
    383385        return u'Send message to %s' % self.context.display_fullname
    384386
    385     @grok.action('Send message now')
     387    @action('Send message now', style='primary')
    386388    def send(self, *args, **data):
    387389        try:
     
    442444            dict(name=x, title=y) for x, y in allowed_transitions]
    443445
    444     @grok.action('Save')
     446    @action('Save', style='primary')
    445447    def save(self, **data):
    446448        form = self.request.form
     
    576578        return super(StudentClearanceManageFormPage, self).update()
    577579
    578     @grok.action('Save')
     580    @action('Save', style='primary')
    579581    def save(self, **data):
    580582        msave(self, **data)
    581583        return
    582584
    583 class StudentClearPage(grok.View):
     585class StudentClearPage(UtilityView, grok.View):
    584586    """ Clear student by clearance officer
    585587    """
     
    600602        return
    601603
    602 class StudentRejectClearancePage(grok.View):
     604class StudentRejectClearancePage(UtilityView, grok.View):
    603605    """ Reject clearance by clearance officers
    604606    """
     
    662664    pnav = 4
    663665
    664     @grok.action('Save')
     666    @action('Save', style='primary')
    665667    def save(self, **data):
    666668        msave(self, **data)
     
    732734        return
    733735
    734     @grok.action('Save')
     736    @action('Save', style='primary')
    735737    def save(self, **data):
    736738        msave(self, **data)
     
    744746            yield(dict(code=code, title=title))
    745747
    746     @grok.action('Add study level')
     748    @action('Add study level')
    747749    def addStudyLevel(self, **data):
    748750        level_code = self.request.form.get('addlevel', None)
     
    754756        except KeyError:
    755757            self.flash('This level exists.')
     758        self.flash('Study level has been added.')
    756759        self.redirect(self.url(self.context, u'@@manage')+'#tab-2')
    757760        return
     
    821824    target = 'course_registration.pdf'
    822825
    823 class ExportPDFCourseRegistrationSlipPage(grok.View):
     826class ExportPDFCourseRegistrationSlipPage(UtilityView, grok.View):
    824827    """Deliver a PDF slip of the context.
    825828    """
     
    921924        return 'Manage study level %s' % self.context.level_title
    922925
    923     @grok.action('Save')
     926    @action('Save', style='primary')
    924927    def save(self, **data):
    925928        msave(self, **data)
    926929        return
    927930
    928     @grok.action('Add course ticket')
     931    @action('Add course ticket')
    929932    def addCourseTicket(self, **data):
    930933        self.redirect(self.url(self.context, '@@add'))
     
    954957        return
    955958
    956 class ValidateCoursesPage(grok.View):
     959class ValidateCoursesPage(UtilityView, grok.View):
    957960    """ Validate course list by course adviser
    958961    """
     
    975978        return
    976979
    977 class RejectCoursesPage(grok.View):
     980class RejectCoursesPage(UtilityView, grok.View):
    978981    """ Reject course list by course adviser
    979982    """
     
    10221025        return 'Study Level %s' % self.context.level_title
    10231026
    1024     @grok.action('Add course ticket')
     1027    @action('Add course ticket')
    10251028    def addCourseTicket(self, **data):
    10261029        ticket = CourseTicket()
     
    10461049        return
    10471050
    1048     @grok.action('Cancel')
     1051    @action('Cancel')
    10491052    def cancel(self, **data):
    10501053        self.redirect(self.url(self.context))
     
    10951098        return 'Manage course ticket %s' % self.context.code
    10961099
    1097     @grok.action('Save')
     1100    @action('Save', style='primary')
    10981101    def save(self, **data):
    10991102        msave(self, **data)
     
    11761179        return
    11771180
    1178     @grok.action('Add online payment ticket')
     1181    @action('Add online payment ticket')
    11791182    def addPaymentTicket(self, **data):
    11801183        self.redirect(self.url(self.context, '@@addop'))
     
    12001203    pnav = 4
    12011204   
    1202     @grok.action('Create ticket')
     1205    @action('Create ticket', style='primary')
    12031206    def createTicket(self, **data):
    12041207        p_category = data['p_category']
     
    12961299        return self.view.url(self.view.context, self.target)
    12971300
    1298 class OnlinePaymentCallbackPage(grok.View):
     1301class OnlinePaymentCallbackPage(UtilityView, grok.View):
    12991302    """ Callback view
    13001303    """
     
    13451348        return
    13461349
    1347 class ExportPDFPaymentSlipPage(grok.View):
     1350class ExportPDFPaymentSlipPage(UtilityView, grok.View):
    13481351    """Deliver a PDF slip of the context.
    13491352    """
     
    15761579    target = 'bed_allocation.pdf'
    15771580
    1578 class ExportPDFBedTicketSlipPage(grok.View):
     1581class ExportPDFBedTicketSlipPage(UtilityView, grok.View):
    15791582    """Deliver a PDF slip of the context.
    15801583    """
     
    16081611    target = 'relocate'
    16091612
    1610 class BedTicketRelocationPage(grok.View):
     1613class BedTicketRelocationPage(UtilityView, grok.View):
    16111614    """ Callback view
    16121615    """
     
    17351738    pnav = 4
    17361739
    1737     @grok.action('Save')
     1740    @action('Save', style='primary')
    17381741    def save(self, **data):
    17391742        msave(self, **data)
     
    17511754    pnav = 4
    17521755
    1753     @grok.action('Save')
     1756    @action('Save', style='primary')
    17541757    def save(self, **data):
    17551758        form = self.request.form
     
    18981901        return super(StudentClearanceEditFormPage, self).update()
    18991902
    1900     @grok.action('Save')
     1903    @action('Save', style='primary')
    19011904    def save(self, **data):
    19021905        self.applyData(self.context, **data)
     
    19111914        return False
    19121915
    1913     @grok.action('Save and request clearance')
     1916    @action('Save and request clearance', style='primary')
    19141917    def requestClearance(self, **data):
    19151918        self.applyData(self.context, **data)
     
    20632066        return
    20642067
    2065     @grok.action('Create course list now')
     2068    @action('Create course list now', style='primary')
    20662069    def addStudyLevel(self, **data):
    20672070        studylevel = StudentStudyLevel()
     
    21272130        return total_credits
    21282131
    2129     @grok.action('Add course ticket')
     2132    @action('Add course ticket')
    21302133    def addCourseTicket(self, **data):
    21312134        self.redirect(self.url(self.context, 'ctadd'))
     
    21572160        return
    21582161
    2159     @grok.action('Register course list')
     2162    @action('Register course list', style='primary')
    21602163    def RegisterCourses(self, **data):
    21612164        IWorkflowInfo(self.context.getStudent()).fireTransition('register_courses')
     
    21722175        'grade', 'score', 'core_or_elective', 'automatic')
    21732176
    2174     @grok.action('Add course ticket')
     2177    @action('Add course ticket')
    21752178    def addCourseTicket(self, **data):
    21762179        ticket = CourseTicket()
     
    22112214        return
    22122215
    2213     @grok.action('Get login credentials')
     2216    @action('Get login credentials', style='primary')
    22142217    def request(self, **data):
    22152218        if not self.captcha_result.is_valid:
  • main/waeup.sirp/trunk/src/waeup/sirp/students/browser_templates/accommodationmanagepage.pt

    r7254 r7459  
    33tal:content="view/label">Label</h2>
    44
    5 <div class="form-status"
     5<div class="alert-message error"
    66    tal:define="status view/status"
    77    tal:condition="status">
     
    1313
    1414<form action="." tal:attributes="action request/URL" method="POST"
    15       class="edit-form" enctype="multipart/form-data">
     15      enctype="multipart/form-data">
    1616
    1717  <table class="display dataTableManage">
     
    4141  </table>
    4242
    43   <div class="actionButtons" tal:condition="view/availableActions">
     43  <div tal:condition="view/availableActions">
    4444    <span tal:repeat="action view/selected_actions"
    4545          tal:omit-tag="">
  • main/waeup.sirp/trunk/src/waeup/sirp/students/browser_templates/basemanagepage.pt

    r7134 r7459  
    44
    55<form action="." tal:attributes="action request/URL" method="post"
    6       class="edit-form" enctype="multipart/form-data">
     6      enctype="multipart/form-data">
    77
    8   <div class="form-status"
     8  <div class="alert-message error"
    99    tal:define="status view/status"
    1010    tal:condition="status">
     
    1515  </div>
    1616
    17   <div id="tabs">
    18     <ul>
    19       <li><a href="#tab-1"><span>Base Data</span></a></li>
    20       <li><a href="#tab-2"><span>Passport Picture</span></a></li>
    21     </ul>
     17  <ul class="tabs" data-tabs="tabs">
     18    <li class="active"><a href="#tab-1"><span>Base Data</span></a></li>
     19    <li><a href="#tab-2"><span>Passport Picture</span></a></li>
     20  </ul>
    2221
    23     <div id="tab-1">
    24       <table class="form-fields zebra">
     22  <div class="tab-content">
     23    <div id="tab-1" class="active">
     24      <table class="form-table">
    2525        <tbody>
    2626          <tal:block repeat="widget view/widgets">
    2727            <tr>
    28               <td class="label">
    29                 <label tal:attributes="for widget/name">
    30                   <span class="required" tal:condition="widget/required">*</span>
    31                   <span i18n:translate="" tal:content="widget/label">label</span>:
    32                 </label>
     28              <td class="fieldname">
     29                <span tal:condition="widget/required">*</span>
     30                <span i18n:translate="" tal:content="widget/label">label</span>:
    3331              </td>
    34               <td class="field">
    35                 <span class="widget" tal:content="structure widget">
     32              <td>
     33                <span tal:content="structure widget">
    3634                  <input type="text" />
    3735                </span>
     
    4038                </tal:error>
    4139                <tal:hint tal:condition="widget/hint">
    42                   <span class="hint" tal:content="structure widget/hint">hint</span>
     40                  <span tal:content="structure widget/hint">hint</span>
    4341                </tal:hint>
    4442              </td>
     
    4644          </tal:block>
    4745          <tr>
    48             <td class="label"><label>Password:</label></td>
     46            <td class="fieldname">Password:</td>
    4947            <td>
    5048              <input name="password" type="password"  />
     
    5250          </tr>
    5351          <tr>
    54             <td class="label"><label>Retype password:</label></td>
     52            <td class="fieldname">Retype password:</td>
    5553            <td>
    5654              <input name="control_password" type="password" />
     
    5856          </tr>
    5957          <tr>
    60             <td class="label"><label>Registration Transition:</label></td>
     58            <td class="fieldname">Registration Transition:</td>
    6159            <td>
    6260              <select id="transition" name="transition">
     
    7270      </table>
    7371
    74       <div class="actionButtons" tal:condition="view/availableActions">
     72      <div tal:condition="view/availableActions">
    7573        <input tal:repeat="action view/actions"
    7674               tal:replace="structure action/render"
     
    8078
    8179    <div id="tab-2">
    82       <h2>Upload passport picture</h2>
    83       <table class="form-fields zebra">
     80      <table class="form-table">
    8481        <tbody>
    8582          <tal:files content="structure provider:files" />
  • main/waeup.sirp/trunk/src/waeup/sirp/students/browser_templates/basepage.pt

    r7384 r7459  
    33    tal:content="view/label">Label</h2>
    44
    5 <table class="zebra">
     5<table class="form-table">
    66  <tbody>
    77    <tal:block repeat="widget view/widgets">
     
    1616    </tal:block>
    1717    <tr>
    18       <td class="fieldname" width="33%">
     18      <td class="fieldname">
    1919          Password:
    2020      </td>
     
    2626  </tbody>
    2727  <tfoot>
    28     <tr class="controls">
    29       <td colspan="2" class="align-right">
     28    <tr>
     29      <td>
    3030        <input tal:repeat="action view/actions"
    3131               tal:replace="structure action/render" />
  • main/waeup.sirp/trunk/src/waeup/sirp/students/browser_templates/change_password.pt

    r7144 r7459  
    44
    55<form action="." tal:attributes="action request/URL" method="post"
    6       class="edit-form" enctype="multipart/form-data">
     6      enctype="multipart/form-data">
    77
    88  <input type="hidden" name="student_id" value=""
    99         tal:attributes="value context/student_id" />
    1010
    11   <table class="form-fields zebra">
     11  <table class="form-table">
    1212    <tbody>
    1313      <tr>
    14         <td class="label"><label>Password:</label></td>
     14        <td class="fieldname">Password:</td>
    1515        <td>
    1616          <input name="change_password" type="password"  />
     
    1818      </tr>
    1919      <tr>
    20         <td class="label"><label>Retype password:</label></td>
     20        <td class="fieldname">Retype password:</td>
    2121        <td>
    2222          <input name="change_password_repeat" type="password" />
     
    2626  </table>
    2727
    28   <div class="actionButtons" tal:condition="view/availableActions">
     28  <div tal:condition="view/availableActions">
    2929    <input tal:repeat="action view/actions"
    3030           tal:replace="structure action/render"
  • main/waeup.sirp/trunk/src/waeup/sirp/students/browser_templates/changepw.pt

    r7369 r7459  
    11<form action="." tal:attributes="action request/URL" method="post"
    2       class="edit-form" enctype="multipart/form-data">
     2      enctype="multipart/form-data">
    33
    44  <h2 i18n:translate=""
     
    66    tal:content="view/label">Label</h2>
    77
    8   <div class="form-status"
     8  <div class="alert-message error"
    99    tal:define="status view/status"
    1010    tal:condition="status">
     
    1515  </div>
    1616
    17   <table class="zebra">
     17  <table class="form-table">
    1818    <tbody>
    1919      <tal:block repeat="widget view/widgets">
    2020        <tr>
    21           <td class="label">
    22             <label tal:attributes="for widget/name">
    23               <span class="required" tal:condition="widget/required">*</span>
     21          <td class="fieldname">
     22              <span tal:condition="widget/required">*</span>
    2423              <span i18n:translate="" tal:content="widget/label">label</span>:
    25             </label>
    2624          </td>
    27           <td class="field">
    28             <span class="widget" tal:content="structure widget">
     25          <td>
     26            <span tal:content="structure widget">
    2927              <input type="text" />
    3028            </span>
     
    3331            </tal:error>
    3432            <tal:hint tal:condition="widget/hint">
    35               <span class="hint" tal:content="structure widget/hint">hint</span>
     33              <span tal:content="structure widget/hint">hint</span>
    3634            </tal:hint>
    3735          </td>
     
    5149  </table>
    5250
    53   <div class="actionButtons" tal:condition="view/availableActions">
     51  <div tal:condition="view/availableActions">
    5452    <input tal:repeat="action view/actions"
    5553           tal:replace="structure action/render"
  • main/waeup.sirp/trunk/src/waeup/sirp/students/browser_templates/clearanceeditpage.pt

    r7134 r7459  
    44
    55<form action="." tal:attributes="action request/URL" method="post"
    6       class="edit-form" enctype="multipart/form-data">
     6      enctype="multipart/form-data">
    77
    8   <div class="form-status"
     8  <div class="alert-message error"
    99    tal:define="status view/status"
    1010    tal:condition="status">
     
    1515  </div>
    1616
    17   <div id="tabs">
    18     <ul>
    19       <li><a href="#tab-1"><span>Clearance Data</span></a></li>
    20       <li><a href="#tab-2"><span>Scans</span></a></li>
    21     </ul>
    22 
    23     <div id="tab-1">
    24       <table class="form-fields zebra">
     17  <ul class="tabs" data-tabs="tabs">
     18    <li class="active"><a href="#tab-1"><span>Clearance Data</span></a></li>
     19    <li><a href="#tab-2"><span>Scans</span></a></li>
     20  </ul>
     21  <div class="tab-content">
     22    <div id="tab-1" class="active">
     23      <table class="form-table">
    2524        <tbody>
    2625          <tal:block repeat="widget view/widgets">
    2726            <tr>
    28               <td class="label">
    29                 <label tal:attributes="for widget/name">
    30                   <span class="required" tal:condition="widget/required">*</span>
     27              <td class="fieldname">
     28                  <span tal:condition="widget/required">*</span>
    3129                  <span i18n:translate="" tal:content="widget/label">label</span>:
    32                 </label>
    3330              </td>
    34               <td class="field">
    35                 <span class="widget" tal:content="structure widget">
     31              <td>
     32                <span tal:content="structure widget">
    3633                  <input type="text" />
    3734                </span>
     
    4037                </tal:error>
    4138                <tal:hint tal:condition="widget/hint">
    42                   <span class="hint" tal:content="structure widget/hint">hint</span>
     39                  <span tal:content="structure widget/hint">hint</span>
    4340                </tal:hint>
    4441              </td>
     
    4845      </table>
    4946
    50       <div class="actionButtons" tal:condition="view/availableActions">
     47      <div tal:condition="view/availableActions">
    5148        <input tal:repeat="action view/actions"
    5249               tal:replace="structure action/render"
     
    5653
    5754    <div id="tab-2">
    58       <h2>Upload scans</h2>
    59       <table class="form-fields zebra">
     55      <table class="form-table">
    6056        <tbody>
    6157          <tal:files content="structure provider:files" />
  • main/waeup.sirp/trunk/src/waeup/sirp/students/browser_templates/containermanagepage.pt

    r7364 r7459  
    44<br />
    55
    6   <input type="submit" name="search" value="Search" />
     6  <input class="btn primary" type="submit" name="search" value="Search" />
    77  for students
    88
     
    4848    </table>
    4949   
    50     <div class="actionButtons">
    51         <input type="submit" name="remove" value="Remove selected"
    52                onclick="return confirmPost('Are you sure?')"/>
    53     </div>
     50    <input type="submit" name="remove" value="Remove selected" class="btn"
     51           onclick="return confirmPost('Are you sure?')"/>
    5452
    5553  </div>
  • main/waeup.sirp/trunk/src/waeup/sirp/students/browser_templates/containerpage.pt

    r7364 r7459  
    44<br />
    55
    6   <input type="submit" name="search" value="Search" />
     6  <input class="btn primary" type="submit" name="search" value="Search" />
    77  for students
    88
  • main/waeup.sirp/trunk/src/waeup/sirp/students/browser_templates/courseticketmanagepage.pt

    r6796 r7459  
    11<form action="." tal:attributes="action request/URL" method="post"
    2       class="edit-form" enctype="multipart/form-data">
     2      enctype="multipart/form-data">
    33
    44  <h2 i18n:translate=""
     
    66    tal:content="view/label">Label</h2>
    77
    8   <div class="form-status"
     8  <div class="alert-message error"
    99    tal:define="status view/status"
    1010    tal:condition="status">
     
    1515  </div>
    1616
    17 
    18   <table class="zebra">
     17  <table class="form-table">
    1918    <tbody>
    2019      <tr>
     
    6867      <tal:block repeat="widget view/widgets">
    6968        <tr>
    70           <td class="label">
    71             <label tal:attributes="for widget/name">
    72               <span class="required" tal:condition="widget/required">*</span>
     69          <td class="fieldname">
     70              <span tal:condition="widget/required">*</span>
    7371              <span i18n:translate="" tal:content="widget/label">label</span>:
    74             </label>
    7572          </td>
    76           <td class="field">
    77             <span class="widget" tal:content="structure widget">
     73          <td>
     74            <span tal:content="structure widget">
    7875              <input type="text" />
    7976            </span>
     
    8279            </tal:error>
    8380            <tal:hint tal:condition="widget/hint">
    84               <span class="hint" tal:content="structure widget/hint">hint</span>
     81              <span tal:content="structure widget/hint">hint</span>
    8582            </tal:hint>
    8683          </td>
     
    8986    </tbody>
    9087  </table>
    91   <div class="actionButtons" tal:condition="view/availableActions">
     88  <div tal:condition="view/availableActions">
    9289    <input tal:repeat="action view/actions"
    9390           tal:replace="structure action/render"
  • main/waeup.sirp/trunk/src/waeup/sirp/students/browser_templates/courseticketpage.pt

    r6804 r7459  
    33    tal:content="view/label">Label</h2>
    44
    5 <table class="zebra">
     5<table class="form-table">
    66  <tbody>
    77    <tr>
  • main/waeup.sirp/trunk/src/waeup/sirp/students/browser_templates/enterpin.pt

    r6935 r7459  
    22    tal:content="view/label">Label</h2>
    33<form method="POST">
    4   <table>
     4  <table class="form-table">
    55    <tbody>
    66      <tr><td>
    7         <label for="ac_series">Activation Code:</label>
     7        Activation Code:
    88        </td><td>
    99        <span tal:replace="view/ac_prefix">PIN Prefix</span> -
     
    1818      <tr>
    1919        <td colspan="2">
    20           <input type="submit" name="SUBMIT"
     20          <input type="submit" name="SUBMIT" class="btn primary"
    2121                 tal:attributes="value view/buttonname" />
    22                  </td>
     22        </td>
    2323      </tr>
    2424    </tbody>
  • main/waeup.sirp/trunk/src/waeup/sirp/students/browser_templates/filedisplay.pt

    r7319 r7459  
    11<tr tal:condition = "viewlet/file_exists">
    2   <td class="label">
    3     <label i18n:translate="">
    4         <span tal:replace="viewlet/label">FILENAME</span>:
    5     </label>
     2  <td class="fieldname">
     3    <span tal:replace="viewlet/label">FILENAME</span>:
    64  </td>
    7   <td class="field">
     5  <td>
    86    <span class="widget">
    97      <a tal:attributes="href viewlet/download_name"
  • main/waeup.sirp/trunk/src/waeup/sirp/students/browser_templates/filesuploadpage.pt

    r7127 r7459  
    44
    55<form action="." tal:attributes="action request/URL" method="post"
    6       class="edit-form" enctype="multipart/form-data">
    7   <table class="zebra">
     6      enctype="multipart/form-data">
     7  <table class="form-table">
    88    <tbody>
    99      <tal:files content="structure provider:files" />
  • main/waeup.sirp/trunk/src/waeup/sirp/students/browser_templates/fileupload.pt

    r7319 r7459  
    11<tr>
    2   <td class="label">
    3     <label i18n:translate="" tal:attributes="for viewlet/input_name">
    4         <span tal:replace="viewlet/label">FILENAME</span>:
    5     </label>
     2  <td class="fieldname">
     3    <span tal:replace="viewlet/label">FILENAME</span>:
    64  </td>
    7   <td class="field">
     5  <td>
    86    <span class="widget">
    97
     
    1715      <br />
    1816      <input type="file" tal:attributes="name viewlet/input_name"/>
    19       <br />
     17      <br /><br />
    2018      <input type="submit" tal:condition="viewlet/file_exists"
    2119             tal:attributes="id python:('delete_%s' % viewlet.input_name);
    2220                name python:('delete_%s' % viewlet.input_name)"
    23              value="Delete attachment" class="button" />
     21             value="Delete attachment" class="btn error" />
    2422      <input type="submit"
    2523               tal:attributes="id python:('upload_%s' % viewlet.input_name);
    2624                  name python:('upload_%s' % viewlet.input_name)"
    27                value="Upload new file" class="button" />
     25               value="Upload new file" class="btn primary" />
    2826      <span i18n:translate="">
    2927        Max. file size:
  • main/waeup.sirp/trunk/src/waeup/sirp/students/browser_templates/imagedisplay.pt

    r7414 r7459  
    11<tr>
    2   <td class="label">
    3     <label i18n:translate="">
     2  <td class="fieldname">
    43        <span tal:replace="viewlet/label">FILENAME</span>:
    5     </label>
    64  </td>
    7   <td class="field">
    8     <span class="widget">
     5  <td>
    96      <img height="125px" tal:attributes="src viewlet/download_name" />
    107      <br />
    11     </span>
    128  </td>
    139</tr>
  • main/waeup.sirp/trunk/src/waeup/sirp/students/browser_templates/imageupload.pt

    r7414 r7459  
    11<tr>
    2   <td class="label">
    3     <label i18n:translate="" tal:attributes="for viewlet/input_name">
    4         <span tal:replace="viewlet/label">FILENAME</span>:
    5     </label>
     2  <td class="fieldname">
     3    <span tal:replace="viewlet/label">FILENAME</span>:
    64  </td>
    7   <td class="field">
     5  <td>
    86    <span class="widget">
    97      <img align="middle" height="125px"
     
    1210       tal:attributes="id python:('delete_%s' % viewlet.input_name);
    1311          name python:('delete_%s' % viewlet.input_name)"
    14        value="Delete" class="button" />
     12       value="Delete" class="btn error" />
    1513      <br /><br />
    1614      <input type="file" tal:attributes="name viewlet/input_name"/>
     15      <br /><br />
    1716      <input type="submit"
    1817               tal:attributes="id python:('upload_%s' % viewlet.input_name);
    1918                  name python:('upload_%s' % viewlet.input_name)"
    20                value="Upload" class="button" />
     19               value="Upload" class="btn primary" />
    2120      <span i18n:translate="">
    2221        Max. file size:
  • main/waeup.sirp/trunk/src/waeup/sirp/students/browser_templates/paymentsmanagepage.pt

    r7254 r7459  
    33tal:content="view/label">Label</h2>
    44
    5 <div class="form-status"
     5<div class="alert-message error"
    66    tal:define="status view/status"
    77    tal:condition="status">
     
    1313
    1414<form action="." tal:attributes="action request/URL" method="POST"
    15       class="edit-form" enctype="multipart/form-data">
     15      enctype="multipart/form-data">
    1616
    1717  <table class="display dataTableManage">
     
    4646  </table>
    4747
    48   <div class="actionButtons" tal:condition="view/availableActions">
     48  <div tal:condition="view/availableActions">
    4949    <span tal:repeat="action view/actions"
    5050          tal:omit-tag="">
  • main/waeup.sirp/trunk/src/waeup/sirp/students/browser_templates/paymentspage.pt

    r7254 r7459  
    11<h2 tal:content="view/label">TITLE</h2>
    22
    3 <table class="zebra">
    4 <thead>
    5 </thead>
    63<table class="display dataTable">
    74  <thead>
  • main/waeup.sirp/trunk/src/waeup/sirp/students/browser_templates/setpassword.pt

    r6758 r7459  
    22    tal:content="view/label">Label</h2>
    33<form method="POST">
    4   <table>
     4  <table class="form-table">
    55    <tbody>
    6       <tr><td>
    7           <label for="reg_number">Registration Number:
    8           </label></td> <td>
     6      <tr>
     7      <td>
     8          Registration Number:
     9      </td>
     10      <td>
    911          <input name="reg_number" type="text" size="15" maxlength="15"
    1012                 value="" tal:attributes="value view/reg_number"/>
    11       </td></tr>
     13      </td>
     14      </tr>
    1215      <tr>
    1316        <td>
    14           <label for="ac_series">Access Code:
    15           </label></td> <td>
     17          Access Code:
     18        </td>
     19        <td>
    1620          <span tal:replace="view/ac_prefix">PIN Prefix
    1721          </span> -
     
    2327      <tr>
    2428        <td colspan="2">
    25         <input type="submit" name="SUBMIT"
     29        <input type="submit" name="SUBMIT" class="btn primary"
    2630               value="Show Student Id and set password" /> </td>
    2731      </tr>
  • main/waeup.sirp/trunk/src/waeup/sirp/students/browser_templates/studentpage.pt

    r6635 r7459  
    33    tal:content="view/label">Label</h2>
    44
    5 <table class="zebra">
     5<table class="form-table">
    66  <tbody>
    77    <tal:block repeat="widget view/widgets">
     
    1717  </tbody>
    1818  <tfoot>
    19     <tr class="controls">
     19    <tr>
    2020      <td colspan="2" class="align-right">
    2121        <input tal:repeat="action view/actions"
     
    2424    </tr>
    2525  </tfoot>
    26 
    2726</table>
    2827
  • main/waeup.sirp/trunk/src/waeup/sirp/students/browser_templates/studycoursemanagepage.pt

    r6794 r7459  
    33tal:content="view/label">Label</h2>
    44
    5 <div class="form-status"
     5<div class="alert-message error"
    66    tal:define="status view/status"
    77    tal:condition="status">
     
    1313
    1414<form action="." tal:attributes="action request/URL" method="POST"
    15       class="edit-form" enctype="multipart/form-data">
     15      enctype="multipart/form-data">
    1616
    17 <div id="tabs">
    18 <ul>
    19   <li><a href="#tab-1"><span>Study Course Data</span></a></li>
    20   <li><a href="#tab-2"><span>Study Levels</span></a></li>
    21 </ul>
    22    
    23 <div id="tab-1">       
    24   <table class="zebra">
    25   <tbody>
    26   <tal:block repeat="widget view/widgets">
    27     <tr>
    28       <td class="label">
    29         <label tal:attributes="for widget/name">
    30           <span class="required" tal:condition="widget/required">*</span>
    31           <span i18n:translate="" tal:content="widget/label">label</span>:
    32         </label>
    33       </td>
    34       <td class="field">
    35         <span class="widget" tal:content="structure widget">
    36           <input type="text" />
     17  <ul class="tabs" data-tabs="tabs">
     18    <li class="active"><a href="#tab-1"><span>Study Course Data</span></a></li>
     19    <li><a href="#tab-2"><span>Study Levels</span></a></li>
     20  </ul>
     21
     22  <div class="tab-content">
     23    <div id="tab-1" class="active">
     24      <table class="form-table">
     25      <tbody>
     26      <tal:block repeat="widget view/widgets">
     27        <tr>
     28          <td class="fieldname">
     29            <span class="required" tal:condition="widget/required">*</span>
     30            <span i18n:translate="" tal:content="widget/label">label</span>:
     31          </td>
     32          <td>
     33            <span tal:content="structure widget">
     34              <input type="text" />
     35            </span>
     36            <tal:error tal:condition="widget/error">
     37              <span tal:replace="structure widget/error">error</span>
     38            </tal:error>
     39            <tal:hint tal:condition="widget/hint">
     40              <span tal:content="structure widget/hint">hint</span>
     41            </tal:hint>
     42          </td>
     43        </tr>
     44      </tal:block>
     45      </tbody>
     46      </table>
     47      <div tal:condition="view/availableActions">
     48        <span tal:repeat="action view/actions"
     49              tal:omit-tag="">
     50          <input tal:condition="python:action.label in view.taboneactions"
     51                 tal:replace="structure action/render"/>
    3752        </span>
    38         <tal:error tal:condition="widget/error">
    39           <span tal:replace="structure widget/error">error</span>
    40         </tal:error>
    41         <tal:hint tal:condition="widget/hint">
    42           <span class="hint" tal:content="structure widget/hint">hint</span>
    43         </tal:hint>
    44       </td>
    45     </tr>
    46   </tal:block>
    47   </tbody>
    48   </table>
    49   <div class="actionButtons" tal:condition="view/availableActions">
    50     <span tal:repeat="action view/actions"
    51           tal:omit-tag="">
    52       <input tal:condition="python:action.label in view.taboneactions"
    53              tal:replace="structure action/render"/>
    54     </span>
     53      </div>
     54    </div>
     55
     56    <div id="tab-2">
     57      <h3>Study Levels (Course Lists)</h3>
     58      <table class="display dataTableManage">
     59        <thead>
     60          <tr>
     61            <th>&nbsp;</th><th>Level Code</th><th>Level Title</th>
     62          </tr>
     63        </thead>
     64        <tbody>
     65          <tr tal:repeat="cl context/values">
     66             <td>
     67              <input type="checkbox"
     68                         name="val_id"
     69                         tal:attributes="value cl/__name__" />
     70            </td>
     71            <td> <a tal:attributes="href cl/__name__">
     72              <span tal:content="cl/level">CODE</span></a>
     73            </td>
     74            <td>
     75              <span tal:content="cl/level_title">TITLE</span>
     76            </td>
     77          </tr>
     78        </tbody>
     79      </table>
     80
     81      <div tal:condition="view/availableActions">
     82        <span tal:repeat="action view/actions"
     83              tal:omit-tag="">
     84          <input tal:condition="python:action.label in view.tabtwoactions"
     85                 tal:replace="structure action/render"/>
     86        </span>
     87      </div>
     88      <br /><br /><br />
     89      <div>
     90        <span tal:condition="view/availableActions">
     91          <span tal:repeat="action view/actions"
     92                tal:omit-tag="">
     93            <input tal:condition="python:action.label in view.tabthreeactions"
     94                   tal:replace="structure action/render"/>
     95          </span>
     96        </span>
     97        <select id="addlevel" name="addlevel">
     98          <option tal:attributes="value level/code" tal:repeat="level view/level_dict">
     99            <span tal:replace="level/title">LEVELTITLE
     100          </span>
     101          </option>
     102        </select>
     103      </div>
     104    </div>
    55105  </div>
    56 </div>   
    57    
    58 <div id="tab-2">
    59   <h3>Study Levels (Course Lists)</h3>
    60   <table class="display dataTableManage">
    61     <thead>
    62       <tr>
    63         <th>&nbsp;</th><th>Level Code</th><th>Level Title</th>
    64       </tr>
    65     </thead>
    66     <tbody>
    67       <tr tal:repeat="cl context/values">
    68          <td>
    69           <input type="checkbox"
    70                  name="val_id"
    71                  tal:attributes="value cl/__name__" />
    72         </td>
    73         <td> <a tal:attributes="href cl/__name__">
    74           <span tal:content="cl/level">CODE</span></a>
    75         </td>
    76         <td>
    77           <span tal:content="cl/level_title">TITLE</span>
    78         </td>
    79       </tr>
    80     </tbody>
    81   </table>
    82 
    83   <div class="actionButtons" tal:condition="view/availableActions">
    84     <span tal:repeat="action view/actions"
    85           tal:omit-tag="">
    86       <input tal:condition="python:action.label in view.tabtwoactions"
    87              tal:replace="structure action/render"/>
    88     </span>
    89   </div>
    90   <br /><br /><br />
    91   <div>
    92     <span class="actionButtons" tal:condition="view/availableActions">
    93       <span tal:repeat="action view/actions"
    94             tal:omit-tag="">
    95         <input tal:condition="python:action.label in view.tabthreeactions"
    96                tal:replace="structure action/render"/>
    97       </span>
    98     </span>
    99     <select id="addlevel" name="addlevel">
    100       <option tal:attributes="value level/code" tal:repeat="level view/level_dict">
    101         <span tal:replace="level/title">LEVELTITLE
    102       </span>
    103       </option>
    104     </select>
    105   </div>
    106 
    107 
    108 
    109 </div>
    110 </div>
    111106</form> 
    112107
  • main/waeup.sirp/trunk/src/waeup/sirp/students/browser_templates/studycoursepage.pt

    r7206 r7459  
    11<h2 tal:content="view/label">TITLE</h2>
    22
    3 <table class="zebra">
     3<table class="form-table">
    44<thead>
    55</thead>
     
    77  <tal:block repeat="widget view/widgets">
    88    <tr>
    9       <td>
    10         <label tal:attributes="for widget/name">
    11           <span i18n:translate=""
    12                          tal:content="widget/label">label</span>:
    13         </label>
     9      <td class="filedname">
     10        <span i18n:translate="" tal:content="widget/label">label</span>:
    1411      </td>
    15       <td class="field" tal:on-error="default">
     12      <td tal:on-error="default">
    1613        <div class="widget" tal:content="structure widget">
    1714          <input type="text" />
     
    2219    <tr>
    2320      <td>
    24         <label>
    2521          Study Mode:
    26         </label>
    2722      </td>
    2823      <td class="field">
     
    3429    <tr tal:condition="python: view.department is not None">
    3530      <td>
    36         <label>
    3731          Department:
    38         </label>
    3932      </td>
    4033      <td class="field">
     
    4740    <tr tal:condition="python: view.faculty is not None">
    4841      <td>
    49         <label>
    5042          Faculty:
    51         </label>
    5243      </td>
    5344      <td class="field">
     
    6455
    6556
    66 <table class="zebra">
     57<table>
    6758  <thead>
    6859    <tr>
     
    7263  </thead>
    7364  <tbody>
    74     <tr tal:repeat="value context/values">
     65    <tr class="gradeC" tal:repeat="value context/values">
    7566      <td> <a tal:attributes="href value/__name__">
    7667      <span tal:content="value/level">CODE</span></a></td>
  • main/waeup.sirp/trunk/src/waeup/sirp/students/browser_templates/studyleveladdpage.pt

    r6806 r7459  
    33tal:content="view/label">Label</h2>
    44
    5 <div class="form-status"
     5<div class="alert-message error"
    66    tal:define="status view/status"
    77    tal:condition="status">
     
    1313
    1414<form action="." tal:attributes="action request/URL" method="POST"
    15       class="edit-form" enctype="multipart/form-data">
     15      enctype="multipart/form-data">
    1616
    1717  <p>Text to explain course registration procedure.</p>
  • main/waeup.sirp/trunk/src/waeup/sirp/students/browser_templates/studyleveleditpage.pt

    r7310 r7459  
    33tal:content="view/label">Label</h2>
    44
    5 <div class="form-status"
     5<div class="alert-message error"
    66    tal:define="status view/status"
    77    tal:condition="status">
     
    1313
    1414<form action="." tal:attributes="action request/URL" method="POST"
    15       class="edit-form" enctype="multipart/form-data">
     15      enctype="multipart/form-data">
    1616
    1717  <h3>Course Tickets (Total Credits: <span tal:replace="view/total_credits">TOTAL</span>)</h3>
     
    3030  </thead>
    3131  <tbody>
    32     <tr tal:repeat="value context/values">
     32    <tr tal:repeat="value context/values" class="gradeC">
    3333       <td>
    3434        <input type="checkbox" name="val_id"
     
    4949  </table>
    5050
    51   <div class="actionButtons" tal:condition="view/availableActions">
     51  <div tal:condition="view/availableActions">
    5252    <span tal:repeat="action view/actions"
    5353          tal:omit-tag="">
  • main/waeup.sirp/trunk/src/waeup/sirp/students/browser_templates/studylevelmanagepage.pt

    r7310 r7459  
    33tal:content="view/label">Label</h2>
    44
    5 <div class="form-status"
     5<div class="alert-message error"
    66    tal:define="status view/status"
    77    tal:condition="status">
     
    1313
    1414<form action="." tal:attributes="action request/URL" method="POST"
    15       class="edit-form" enctype="multipart/form-data">
     15      enctype="multipart/form-data">
    1616
    17 <div id="tabs">
    18 <ul>
    19   <li><a href="#tab-1"><span>Study Level Data</span></a></li>
    20   <li><a href="#tab-2"><span>Course Tickets</span></a></li>
    21 </ul>
    22    
    23 <div id="tab-1">       
    24   <table class="zebra">
    25   <tbody>
    26   <tal:block repeat="widget view/widgets">
    27     <tr>
    28       <td class="label">
    29         <label tal:attributes="for widget/name">
    30           <span class="required" tal:condition="widget/required">*</span>
    31           <span i18n:translate="" tal:content="widget/label">label</span>:
    32         </label>
    33       </td>
    34       <td class="field">
    35         <span class="widget" tal:content="structure widget">
    36           <input type="text" />
     17  <ul class="tabs" data-tabs="tabs">
     18    <li class="active"><a href="#tab-1"><span>Study Level Data</span></a></li>
     19    <li><a href="#tab-2"><span>Course Tickets</span></a></li>
     20  </ul>
     21
     22  <div class="tab-content">
     23    <div id="tab-1" class="active">
     24      <table class="form-table">
     25      <tbody>
     26      <tal:block repeat="widget view/widgets">
     27        <tr>
     28          <td class="fieldname">
     29            <span class="required" tal:condition="widget/required">*</span>
     30            <span i18n:translate="" tal:content="widget/label">label</span>:
     31          </td>
     32          <td>
     33            <span tal:content="structure widget">
     34              <input type="text" />
     35            </span>
     36            <tal:error tal:condition="widget/error">
     37              <span tal:replace="structure widget/error">error</span>
     38            </tal:error>
     39            <tal:hint tal:condition="widget/hint">
     40              <span tal:content="structure widget/hint">hint</span>
     41            </tal:hint>
     42          </td>
     43        </tr>
     44      </tal:block>
     45      </tbody>
     46      </table>
     47      <div tal:condition="view/availableActions">
     48        <span tal:repeat="action view/actions"
     49              tal:omit-tag="">
     50          <input tal:condition="python:action.label in view.taboneactions"
     51                 tal:replace="structure action/render"/>
    3752        </span>
    38         <tal:error tal:condition="widget/error">
    39           <span tal:replace="structure widget/error">error</span>
    40         </tal:error>
    41         <tal:hint tal:condition="widget/hint">
    42           <span class="hint" tal:content="structure widget/hint">hint</span>
    43         </tal:hint>
    44       </td>
    45     </tr>
    46   </tal:block>
    47   </tbody>
    48   </table>
    49   <div class="actionButtons" tal:condition="view/availableActions">
    50     <span tal:repeat="action view/actions"
    51           tal:omit-tag="">
    52       <input tal:condition="python:action.label in view.taboneactions"
    53              tal:replace="structure action/render"/>
    54     </span>
     53      </div>
     54    </div>
     55
     56    <div id="tab-2">
     57      <h3>Course Tickets</h3>
     58      <table class="display dataTableManage">
     59      <thead>
     60        <tr>
     61          <th>&nbsp;</th>
     62          <th>Sem.</th>
     63          <th>Code</th>
     64          <th>Title</th>
     65          <th>Department</th>
     66          <th>Faculty</th>
     67          <th>Credits</th>
     68          <th>Mandatory</th>
     69          <th>Score</th>
     70          <th>Auto</th>
     71        </tr>
     72      </thead>
     73      <tbody>
     74        <tr tal:repeat="value context/values" class="gradeC">
     75          <td>
     76            <input type="checkbox" name="val_id"
     77                  tal:attributes="value value/__name__" />
     78          </td>
     79          <td tal:content="value/semester">SEMESTER</td>
     80          <td> <a tal:attributes="href value/__name__">
     81          <span tal:content="value/code">CODE</span>
     82          </a></td>
     83          <td tal:content="value/title">TITLE</td>
     84          <td tal:content="value/department">DEPARTMENT</td>
     85          <td tal:content="value/faculty">FACULTY</td>
     86          <td tal:content="value/credits">CREDITS</td>
     87          <td tal:content="value/core_or_elective">MANDATORY</td>
     88          <td tal:content="value/score">SCORE</td>
     89          <td tal:content="value/automatic">AUTO</td>
     90        </tr>
     91      </tbody>
     92      </table>
     93
     94      <div tal:condition="view/availableActions">
     95        <span tal:repeat="action view/actions"
     96              tal:omit-tag="">
     97          <input tal:condition="python:action.label in view.tabtwoactions"
     98                 tal:replace="structure action/render"/>
     99        </span>
     100      </div>
     101
     102    </div>
    55103  </div>
    56 </div>   
    57    
    58 <div id="tab-2">
    59   <h3>Course Tickets</h3>
    60   <table class="display dataTableManage">
    61   <thead>
    62     <tr>
    63       <th>&nbsp;</th>
    64       <th>Sem.</th>
    65       <th>Code</th>
    66       <th>Title</th>
    67       <th>Department</th>
    68       <th>Faculty</th>
    69       <th>Credits</th>
    70       <th>Mandatory</th>
    71       <th>Score</th>
    72       <th>Auto</th>
    73     </tr>
    74   </thead>
    75   <tbody>
    76     <tr tal:repeat="value context/values">
    77       <td>
    78         <input type="checkbox" name="val_id"
    79                   tal:attributes="value value/__name__" />
    80       </td>
    81       <td tal:content="value/semester">SEMESTER</td>
    82       <td> <a tal:attributes="href value/__name__">
    83       <span tal:content="value/code">CODE</span>
    84       </a></td>
    85       <td tal:content="value/title">TITLE</td>
    86       <td tal:content="value/department">DEPARTMENT</td>
    87       <td tal:content="value/faculty">FACULTY</td>
    88       <td tal:content="value/credits">CREDITS</td>
    89       <td tal:content="value/core_or_elective">MANDATORY</td>
    90       <td tal:content="value/score">SCORE</td>
    91       <td tal:content="value/automatic">AUTO</td>
    92     </tr>
    93   </tbody>
    94   </table>
    95 
    96   <div class="actionButtons" tal:condition="view/availableActions">
    97     <span tal:repeat="action view/actions"
    98           tal:omit-tag="">
    99       <input tal:condition="python:action.label in view.tabtwoactions"
    100              tal:replace="structure action/render"/>
    101     </span>
    102   </div>
    103 
    104 </div>
    105 </div>
    106104</form> 
    107105
  • main/waeup.sirp/trunk/src/waeup/sirp/students/browser_templates/studylevelpage.pt

    r7310 r7459  
    11<h2 tal:content="view/label">TITLE</h2>
    22
    3 <table class="zebra">
     3<table class="form-table">
    44<thead>
    55</thead>
     
    77  <tal:block repeat="widget view/widgets">
    88    <tr>
    9       <td>
    10         <label tal:attributes="for widget/name">
    11           <span i18n:translate=""
    12                          tal:content="widget/label">label</span>:
    13         </label>
     9      <td class="fieldname">
     10        <span i18n:translate="" tal:content="widget/label">label</span>:
    1411      </td>
    15       <td class="field" tal:on-error="default">
     12      <td tal:on-error="default">
    1613        <div class="widget" tal:content="structure widget">
    1714          <input type="text" />
     
    2219  <tr>
    2320    <td>
    24       <label>Total Credits:</label>
     21      Total Credits:
    2522    </td>
    2623    <td>
     
    3330<h3>Course Tickets</h3>
    3431
    35 <table class="display dataTable" >
     32<table class="display dataTable">
    3633  <thead>
    3734    <tr>
     
    4845  </thead>
    4946  <tbody>
    50     <tr tal:repeat="value context/values">
     47    <tr tal:repeat="value context/values" class="gradeC">
    5148      <td tal:content="value/semester">SEMESTER</td>
    5249      <td> <a tal:attributes="href value/__name__">
  • main/waeup.sirp/trunk/src/waeup/sirp/students/tests/test_browser.py

    r7422 r7459  
    807807        self.browser.getLink("Clear student").click()
    808808        self.assertTrue('Student has been cleared' in self.browser.contents)
    809         self.assertTrue('State: <span>cleared</span>' in self.browser.contents)
     809        self.assertTrue('cleared' in self.browser.contents)
    810810        self.browser.getLink("Reject clearance").click()
    811811        self.assertTrue('Clearance has been annulled' in self.browser.contents)
     
    814814        self.assertEqual(self.browser.url, self.student_path +
    815815            '/contactstudent?subject=%s' % urlmessage)
    816         self.assertTrue('State: <span>clearance started</span>'
    817             in self.browser.contents)
     816        self.assertTrue('clearance started' in self.browser.contents)
    818817        IWorkflowInfo(self.student).fireTransition('request_clearance')
    819818        self.browser.open(self.clearance_student_path)
     
    821820        self.assertTrue('Clearance request has been rejected'
    822821            in self.browser.contents)
    823         self.assertTrue('State: <span>clearance started</span>'
    824             in self.browser.contents)
     822        self.assertTrue('clearance started' in self.browser.contents)
    825823        # CO does now also see the contact form and can send a message
    826824        self.browser.getControl(name="form.subject").value = 'Important subject'
     
    917915        self.browser.getLink("Validate courses").click()
    918916        self.assertTrue('Course list has been validated' in self.browser.contents)
    919         self.assertTrue('State: <span>courses validated</span>' in self.browser.contents)
     917        self.assertTrue('courses validated' in self.browser.contents)
    920918        self.browser.getLink("Reject courses").click()
    921919        self.assertTrue('Course list request has been annulled'
     
    924922        self.assertEqual(self.browser.url, self.student_path +
    925923            '/contactstudent?subject=%s' % urlmessage)
    926         self.assertTrue('State: <span>school fee paid</span>'
    927             in self.browser.contents)
     924        self.assertTrue('school fee paid' in self.browser.contents)
    928925        IWorkflowInfo(self.student).fireTransition('register_courses')
    929926        self.browser.open(L110_student_path)
     
    931928        self.assertTrue('Course list request has been rejected'
    932929            in self.browser.contents)
    933         self.assertTrue('State: <span>school fee paid</span>'
    934             in self.browser.contents)
     930        self.assertTrue('school fee paid' in self.browser.contents)
    935931        # CA does now see the contact form and can send a message
    936932        self.browser.getControl(name="form.subject").value = 'Important subject'
     
    977973        self.assertTrue('Password changed' in self.browser.contents)
    978974        # We are still logged in. Changing the password hasn't thrown us out.
    979         self.browser.getLink("My Data").click()
     975        self.browser.getLink("Base Data").click()
    980976        self.assertEqual(self.browser.url, self.student_path)
    981977        # We can logout
  • main/waeup.sirp/trunk/src/waeup/sirp/students/viewlets.py

    r7366 r7459  
    5757    def render(self):
    5858        url = self.view.url(self.context.getStudent(), self.link)
    59         return u'<div class="portlet"><a href="%s">%s</a></div>' % (
     59        return u'<li><a href="%s">%s</a></li>' % (
    6060                url, self.text)
    6161
    62 class StudentManageBaseLink(StudentManageLink):
    63     grok.order(1)
    64     link = 'index'
    65     text = u'Base Data'
    66 
    6762class StudentManageApplicationLink(StudentManageLink):
    68     grok.order(2)
     63    grok.order(1)
    6964    link = 'application_slip'
    7065    text = u'Application Slip'
     
    7570        if slip:
    7671            url = self.view.url(self.context,self.link)
    77             return u'<div class="portlet"><a href="%s">%s</a></div>' % (
     72            return u'<li><a href="%s">%s</a></li>' % (
    7873                    url, self.text)
    7974        return ''
     75
     76class StudentManageBaseLink(StudentManageLink):
     77    grok.order(2)
     78    link = 'index'
     79    text = u'Base Data'
    8080
    8181class StudentManageClearanceLink(StudentManageLink):
     
    104104    grok.require('waeup.handleAccommodation')
    105105    link = 'accommodation'
    106     text = u'Accommodation Data'
     106    text = u'Accommodation'
    107107
    108108class StudentManageHistoryLink(StudentManageLink):
    109     grok.order(8)
    110     link = 'history'
    111     text = u'History'
    112 
    113 
    114 class StudentMenu(grok.ViewletManager):
    115     grok.name('top_student')
    116 
    117 class StudentLink(PlainActionButton):
    118     """A link displayed in the student box which shows up for StudentNavigation
    119     objects.
    120 
    121     """
    122     grok.baseclass()
    123     grok.viewletmanager(StudentMenu)
    124     grok.context(ISIRPObject)
    125     grok.view(Interface)
    126     grok.order(5)
    127     grok.require('waeup.viewStudent')
    128 
    129     link = 'index'
    130     text = u'Base Data'
    131 
    132     @property
    133     def target_url(self):
    134         """Get a URL to the target...
    135         """
    136         return self.view.url(self.context.getStudent(), self.link)
    137 
    138 class StudentBaseLink(StudentLink):
    139     grok.order(1)
    140     link = 'index'
    141     text = u'Base Data'
    142 
    143 class ApplicationSlipLink(StudentLink):
    144     grok.order(2)
    145     link = 'application_slip'
    146     text = u'Application Slip'
    147 
    148     @property
    149     def target_url(self):
    150         slip = getUtility(IExtFileStore).getFileByContext(
    151             self.context.getStudent(), attr=self.link)
    152         if slip:
    153             return self.view.url(self.context,self.link)
    154         return
    155 
    156 class StudentClearanceLink(StudentLink):
    157     grok.order(3)
    158     link = 'view_clearance'
    159     text = u'Clearance Data'
    160 
    161 class StudentPersonalLink(StudentLink):
    162     grok.order(4)
    163     link = 'view_personal'
    164     text = u'Personal Data'
    165 
    166 class StudentStudyCourseLink(StudentLink):
    167     grok.order(5)
    168     link = 'studycourse'
    169     text = u'Study Course'
    170 
    171 class StudentPaymentsLink(StudentLink):
    172     grok.order(6)
    173     link = 'payments'
    174     text = u'Payments'
    175 
    176 class StudentAccommodationLink(StudentLink):
    177     grok.order(7)
    178     link = 'accommodation'
    179     text = u'Accommodation'
    180 
    181 class StudentHistoryLink(StudentLink):
    182109    grok.order(8)
    183110    link = 'history'
     
    227154
    228155class MyStudentDataTab(PrimaryStudentNavTab):
    229     """MyData-tab in primary navigation.
     156    """MyData dropdown tab in primary navigation.
    230157    """
    231158    grok.order(3)
    232159    grok.require('waeup.viewMyStudentDataTab')
     160    grok.template('mydatadropdowntabs')
    233161    pnav = 4
    234162    tab_title = u'My Data'
    235163
    236164    @property
    237     def link_target(self):
    238         rel_link = '/students/%s' % self.request.principal.id
    239         return self.view.application_url() + rel_link
     165    def active(self):
     166        view_pnav = getattr(self.view, 'pnav', 0)
     167        if view_pnav == self.pnav:
     168            return 'active dropdown'
     169        return 'dropdown'
     170
     171    @property
     172    def targets(self):
     173        student_url = self.view.application_url() + (
     174            '/students/%s' % self.request.principal.id)
     175        #app_slip = getUtility(IExtFileStore).getFileByContext(
     176        #    self.context.getStudent(), 'application_slip')
     177        targets = []
     178        #if app_slip:
     179        #    targets = [{'url':student_url + '/application_slip', 'title':'Application Slip'},]
     180        targets += [
     181            {'url':student_url, 'title':'Base Data'},
     182            {'url':student_url + '/view_clearance', 'title':'Clearance Data'},
     183            {'url':student_url + '/view_personal', 'title':'Personal Data'},
     184            {'url':student_url + '/studycourse', 'title':'Study Course'},
     185            {'url':student_url + '/payments', 'title':'Payments'},
     186            {'url':student_url + '/accommodation', 'title':'Accommodation Data'},
     187            {'url':student_url + '/history', 'title':'History'},
     188            ]
     189        return targets
    240190
    241191def handle_file_delete(context, view, download_name):
Note: See TracChangeset for help on using the changeset viewer.