PageRenderTime 15ms CodeModel.GetById 9ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/templates/webapps/reports/workflows_per_user.mako

https://bitbucket.org/cistrome/cistrome-harvard/
Mako | 42 lines | 40 code | 2 blank | 0 comment | 2 complexity | c7ab724f63e4c4244154baca8a12a6c2 MD5 | raw file
 1<%inherit file="/base.mako"/>
 2<%namespace file="/message.mako" import="render_msg" />
 3
 4%if message:
 5    ${render_msg( message, 'done' )}
 6%endif
 7
 8<div class="toolForm">
 9    <div class="toolFormBody">
10        <h3 align="center">Workflows Per User</h3>
11        <table align="center" width="60%" class="colored">
12            %if len( workflows ) == 0:
13                <tr><td colspan="2">There are no workflows</td></tr>
14            %else:
15                <tr class="header">
16                    <td>User</td>
17                    <td>Total Workflows</td>
18                </tr>
19                <% ctr = 0 %>
20                %for workflow in workflows:
21                    <%
22                        from galaxy import util
23                        email = workflow[0]
24                        total = workflow[1]
25                        user = trans.sa_session.query( trans.model.User ) \
26                                               .filter_by( email=email ) \
27                                               .one()
28                    %>
29                    %if ctr % 2 == 1:
30                        <tr class="odd_row">
31                    %else:
32                        <tr class="tr">
33                    %endif
34                        <td><a href="${h.url_for( controller='workflows', action='user_per_month', id=trans.security.encode_id( user.id ), email=util.sanitize_text( user.email ) )}">${email}</a></td>
35                        <td>${total}</td>
36                    </tr>
37                    <% ctr += 1 %>
38                %endfor
39            %endif
40        </table>
41    </div>
42</div>