| 1 | <div id="history_list"> |
|---|
| 2 | <div class="toolbar"> |
|---|
| 3 | <h1>Histories</h1> |
|---|
| 4 | <a class="back button" href="#">Back</a> |
|---|
| 5 | </div> |
|---|
| 6 | |
|---|
| 7 | %if trans.user is None: |
|---|
| 8 | <ul class="edgetoedge"> |
|---|
| 9 | <li><i style="color: gray"> No histories available (not logged in) </i></li> |
|---|
| 10 | </ul> |
|---|
| 11 | |
|---|
| 12 | %else: |
|---|
| 13 | <ul class="edgetoedge"> |
|---|
| 14 | |
|---|
| 15 | %for i, history in enumerate( trans.user.histories ): |
|---|
| 16 | |
|---|
| 17 | %if not ( history.purged or history.deleted ): |
|---|
| 18 | |
|---|
| 19 | |
|---|
| 20 | <li> |
|---|
| 21 | |
|---|
| 22 | <a href="${h.url_for( action="history_detail", id=history.id )}"> |
|---|
| 23 | ${history.name} |
|---|
| 24 | |
|---|
| 25 | <div class="secondary">${h.date.distance_of_time_in_words( history.update_time, h.date.datetime.utcnow() )} ago</div> |
|---|
| 26 | |
|---|
| 27 | <div class="counts"> |
|---|
| 28 | <% |
|---|
| 29 | total_ok = sum( 1 for d in history.active_datasets if d.state == 'ok' ) |
|---|
| 30 | total_running = sum( 1 for d in history.active_datasets if d.state == 'running' ) |
|---|
| 31 | total_queued = sum( 1 for d in history.active_datasets if d.state == 'queued' ) |
|---|
| 32 | total_error = sum( 1 for d in history.active_datasets if d.state in ( 'error', 'fail' ) ) |
|---|
| 33 | parts = [] |
|---|
| 34 | if total_ok: |
|---|
| 35 | parts.append( "<span style='color: #66AA66'>" + str(total_ok) + " finished</span>" ) |
|---|
| 36 | if total_queued: |
|---|
| 37 | parts.append( "<span style='color: #888888'>" + str(total_queued) + " queued</span>" ) |
|---|
| 38 | if total_running: |
|---|
| 39 | parts.append( "<span style='color: #AAAA66'>" + str(total_running) + " running</span>" ) |
|---|
| 40 | if total_error: |
|---|
| 41 | parts.append( "<span style='color: #AA6666'>" + str(total_error) + " failed</span>" ) |
|---|
| 42 | |
|---|
| 43 | %> |
|---|
| 44 | ${", ".join( parts )} |
|---|
| 45 | </div> |
|---|
| 46 | |
|---|
| 47 | </a> |
|---|
| 48 | |
|---|
| 49 | </li> |
|---|
| 50 | %endif |
|---|
| 51 | %endfor |
|---|
| 52 | |
|---|
| 53 | </ul> |
|---|
| 54 | %endif |
|---|
| 55 | </div> |
|---|