Changeset 6017 for main/waeup.sirp/trunk


Ignore:
Timestamp:
2 May 2011, 15:27:20 (14 years ago)
Author:
Henrik Bettermann
Message:

Implement jQuery datatables on DepartmentManageFormPage?.
Add missing images.

Location:
main/waeup.sirp/trunk/src/waeup/sirp/browser
Files:
9 added
4 edited

Legend:

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

    r6008 r6017  
    1515from hurry.workflow.interfaces import NoTransitionAvailableError
    1616from zope import schema
    17 from waeup.sirp.browser.resources import warning
    18 from waeup.sirp.browser.resources import datepicker, tabs
     17from waeup.sirp.browser.resources import warning, datepicker, tabs, datatable
    1918try:
    2019    from zope.authentication.interfaces import (
     
    11341133    def title(self):
    11351134        return self.context.longtitle()   
     1135       
     1136    def getCourses(self):
     1137        """Get a list of all stored courses.
     1138        """
     1139        for key, val in self.context.courses.items():
     1140            url = self.url(val)
     1141            yield(dict(url=url, name=key, container=val))
     1142
     1143    def getCertificates(self):
     1144        """Get a list of all stored certificates.
     1145        """
     1146        for key, val in self.context.certificates.items():
     1147            url = self.url(val)
     1148            yield(dict(url=url, name=key, container=val))                     
    11361149
    11371150    def update(self):
    11381151        tabs.need()
    1139         self.tables = ITableProvider(self.context).getTables(view=self)
    1140         self.coursetable = self.tables[0]
    1141         self.certificatetable = self.tables[1]
    1142         self.coursetable.need()
     1152        datatable.need()
     1153    #    self.tables = ITableProvider(self.context).getTables(view=self)
     1154    #    self.coursetable = self.tables[0]
     1155    #    self.certificatetable = self.tables[1]
     1156    #    self.coursetable.need()
     1157        super(DepartmentManageFormPage, self).update()
     1158        return
    11431159
    11441160    form_fields = grok.AutoFields(IDepartment)
  • main/waeup.sirp/trunk/src/waeup/sirp/browser/resources.py

    r6016 r6017  
    186186#: other <div>s disappear. See
    187187#:
    188 #:   http://jqueryui.com/demos/tabs/
     188#:   http://www.datatables.net/
    189189#:
    190190#: for details.
  • main/waeup.sirp/trunk/src/waeup/sirp/browser/static/datatables.css

    r6010 r6017  
    158158
    159159.paginate_disabled_previous {
    160         background-image: url('../images/back_disabled.jpg');
     160        background-image: url('back_disabled.jpg');
    161161}
    162162
    163163.paginate_enabled_previous {
    164         background-image: url('../images/back_enabled.jpg');
     164        background-image: url('back_enabled.jpg');
    165165}
    166166
    167167.paginate_disabled_next {
    168         background-image: url('../images/forward_disabled.jpg');
     168        background-image: url('forward_disabled.jpg');
    169169}
    170170
    171171.paginate_enabled_next {
    172         background-image: url('../images/forward_enabled.jpg');
     172        background-image: url('forward_enabled.jpg');
    173173}
    174174
     
    210210
    211211.sorting_asc {
    212         background: url('../images/sort_asc.png') no-repeat center right;
     212        background: url('sort_asc.png') no-repeat center right;
    213213}
    214214
    215215.sorting_desc {
    216         background: url('../images/sort_desc.png') no-repeat center right;
     216        background: url('sort_desc.png') no-repeat center right;
    217217}
    218218
    219219.sorting {
    220         background: url('../images/sort_both.png') no-repeat center right;
     220        background: url('sort_both.png') no-repeat center right;
    221221}
    222222
    223223.sorting_asc_disabled {
    224         background: url('../images/sort_asc_disabled.png') no-repeat center right;
     224        background: url('sort_asc_disabled.png') no-repeat center right;
    225225}
    226226
    227227.sorting_desc_disabled {
    228         background: url('../images/sort_desc_disabled.png') no-repeat center right;
     228        background: url('sort_desc_disabled.png') no-repeat center right;
    229229}
    230230
  • main/waeup.sirp/trunk/src/waeup/sirp/browser/templates/departmentmanagepage.pt

    r6003 r6017  
    7474   
    7575<div id="tab-2"> 
    76     <div name="thecoursetable" tal:condition="python: len(context.courses.keys())">
    77         <div tal:replace="structure view/coursetable/renderHTML"></div>
    78     </div>
    79     <br />
     76    <table id="datatable" class="display">
     77      <thead>
     78        <tr>
     79          <th>&nbsp;</th><th>Code</th><th>Title</th>
     80        </tr>
     81      </thead>
     82      <tbody>
     83        <tr tal:repeat="entry view/getCourses"
     84        class="gradeB">
     85          <td>
     86            <input type="checkbox" name="val_id" tal:attributes="value entry/name" />
     87          </td>
     88          <td>
     89                <a href=""
     90                   tal:attributes="href entry/url"
     91                   tal:content="entry/name">Name</a>
     92          </td>
     93          <td tal:content="entry/container/title">
     94               Title
     95          </td>
     96        </tr>
     97      </tbody>
     98    </table>
     99    <br /><br />
    80100    <div id="actionsView">
    81101        <span class="actionButtons" tal:condition="view/availableActions">
     
    90110
    91111<div id="tab-3"> 
    92     <div name="thecerttable">
    93         <div tal:replace="structure view/certificatetable/renderHTML"></div>
    94     </div>
    95     <br />
     112    <table id="datatable" class="display">
     113      <thead>
     114        <tr>
     115          <th>&nbsp;</th><th>Code</th><th>Title</th>
     116        </tr>
     117      </thead>
     118      <tbody>
     119        <tr tal:repeat="entry view/getCertificates"
     120        class="gradeB">
     121          <td>
     122            <input type="checkbox" name="val_id" tal:attributes="value entry/name" />
     123          </td>
     124          <td>
     125                <a href=""
     126                   tal:attributes="href entry/url"
     127                   tal:content="entry/name">Name</a>
     128          </td>
     129          <td tal:content="entry/container/title">
     130               Title
     131          </td>
     132        </tr>
     133      </tbody>
     134    </table>
     135    <br /><br />
    96136    <div id="actionsView">
    97137        <span class="actionButtons" tal:condition="view/availableActions">
Note: See TracChangeset for help on using the changeset viewer.