Changeset 9815 for main


Ignore:
Timestamp:
21 Dec 2012, 11:25:15 (12 years ago)
Author:
Henrik Bettermann
Message:

First improvements of export job index page (work in progress).

Location:
main/waeup.kofa/trunk/src/waeup/kofa/students
Files:
2 added
2 edited

Legend:

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

    r9814 r9815  
    26682668        for job_id, exporter_name, user_id in job_entries:
    26692669            job = job_manager.get(job_id)
    2670             descr = 'Export (%r, %r)' % (job.args[1:], job.kwargs)
     2670
     2671            # XXX: Descr. should be improved
     2672            descr = '%r, %r' % (job.args[1:], job.kwargs)
     2673
     2674            # XXX: status should be replaced by 'ready', 'running' or 'FAILED'
     2675            # like in w.k.browser.reports ...
    26712676            status = job.status
    2672             start_time = '%s' % job.begin_after
     2677            # ... and buttons should be displayed accordingly
     2678            show_download_button = True
     2679            show_discard_button = True
     2680            show_refresh_button = True
     2681
     2682
     2683            start_time = getattr(job, 'begin_after', None)
     2684            if start_time:
     2685                start_time = start_time.astimezone(
     2686                    getUtility(
     2687                        IKofaUtils).tzinfo).strftime("%Y-%m-%d %H:%M:%S %Z")
    26732688            download_url = self.url(self.context, 'download',
    26742689                                    data=dict(job_id=job_id))
    26752690            new_entry = dict(
    2676                 job=job_id, descr=descr, status=status, start_time=start_time,
    2677                 download_url=download_url)
     2691                job=job_id,
     2692                descr=descr,
     2693                creator=user_id,
     2694                status=status,
     2695                start_time=start_time,
     2696                download_url=download_url,
     2697                show_download_button = show_download_button,
     2698                show_refresh_button = show_refresh_button,
     2699                show_discard_button = show_discard_button,)
    26782700            entries.append(new_entry)
    26792701        self.entries = entries
  • main/waeup.kofa/trunk/src/waeup/kofa/students/browser_templates/exportjobsindex.pt

    r9797 r9815  
    1 <br /><br />
    2 <div>
    3   <form method="POST" tal:repeat="job view/entries">
    4     <b><span tal:replace="job/job">666</span></b>
    5     <span tal:replace="job/descr">Description</span>
     1<table i18n:domain="waeup.kofa">
     2  <thead>
     3    <tr>
     4      <th i18n:translate="">Export Number</th>
     5      <th i18n:translate="">Description</th>
     6      <th i18n:translate="">Creator</th>
     7      <th i18n:translate="">Creation Date</th>
     8      <th i18n:translate="">Status</th>
     9      <th>&nbsp;</th>
     10    </tr>
     11  </thead>
     12  <tbody>
     13    <tr tal:repeat="job view/entries">
     14      <td>
     15        <span tal:replace="job/job">12</span>
     16      </td>
     17      <td>
     18        <span tal:replace="job/descr">DESCRIPTION</span>
     19      </td>
     20      <td>
     21        <span tal:replace="job/creator">CREATOR</span>
     22      </td>
     23      <td nowrap>
     24        <span tal:replace="job/start_time">DATETIME</span>
     25      </td>
     26      <td>
     27        <span tal:replace="job/status">STATUS</span>
     28      </td>
     29      <td nowrap>
     30        <form method="POST">
     31          <input type="hidden" name="job_id"
     32                 tal:attributes="value job/job" />
     33          <a href="" class="btn primary"
     34            tal:attributes="href job/download_url"
     35            tal:condition="job/show_download_button">
     36            Download</a>
     37          <input type="submit" class="btn secondary"
     38                 name="DISCARD" value="Discard"
     39                 tal:condition="job/show_discard_button" />
     40          <a href="" class="btn" i18n:translate=""
     41             tal:condition="job/show_refresh_button">
     42            <img tal:attributes="src static/actionicon_reload.png" />
     43            Reload
     44          </a>
     45        </form>
     46      </td>
     47    </tr>
     48  </tbody>
     49</table>
     50<form method="POST" i18n:domain="waeup.kofa">
     51  <div class="span12">
    652
    7     <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    8     start: <span tal:replace="job/start_time">23:55 h</span>
    9 
    10     <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    11     status: <span tal:replace="job/status">completed</span>
    12 
    13     <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    14     <input type="hidden" name="job_id" value=""
    15            tal:attributes="value job/job" />
    16     <a href="" class="btn" tal:attributes="href job/download_url">
    17       Download</a>
    18     <input type="submit" class="btn" name="DISCARD"
    19            value="Discard" />
    20 
    21   </form>
    22 </div>
    23 
    24 <form method="POST">
    25   <input class="btn secondary" type="submit" name="CREATE"
     53  </div>
     54  <input class="btn primary" type="submit" name="CREATE"
    2655         value="Create new export"
    2756          />
Note: See TracChangeset for help on using the changeset viewer.