PageRenderTime 118ms CodeModel.GetById 110ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 1ms

/templates/webapps/community/repository/contact_owner.mako

https://bitbucket.org/cistrome/cistrome-harvard/
Mako | 82 lines | 77 code | 5 blank | 0 comment | 3 complexity | 21aa5a8cb4a3ad209961c0031853887b MD5 | raw file
 1<%inherit file="/base.mako"/>
 2<%namespace file="/message.mako" import="render_msg" />
 3
 4<%
 5    is_admin = trans.user_is_admin()
 6    is_new = repository.is_new
 7    can_contact_owner = trans.user and trans.user != repository.user
 8    can_push = trans.app.security_agent.can_push( trans.user, repository )
 9    can_upload = can_push
10    can_download = not is_new and ( not is_malicious or can_push )
11    can_browse_contents = not is_new
12    can_rate = repository.user != trans.user
13    can_manage = is_admin or repository.user == trans.user
14    can_view_change_log = not is_new
15    if can_push:
16        browse_label = 'Browse or delete repository files'
17    else:
18        browse_label = 'Browse repository files'
19%>
20
21<%!
22   def inherit(context):
23       if context.get('use_panels'):
24           return '/webapps/community/base_panels.mako'
25       else:
26           return '/base.mako'
27%>
28<%inherit file="${inherit(context)}"/>
29
30<br/><br/>
31<ul class="manage-table-actions">
32    %if is_new and can_upload:
33        <a class="action-button" href="${h.url_for( controller='upload', action='upload', repository_id=trans.security.encode_id( repository.id ), webapp='community' )}">Upload files to repository</a>
34    %else:
35        <li><a class="action-button" id="repository-${repository.id}-popup" class="menubutton">Repository Actions</a></li>
36        <div popupmenu="repository-${repository.id}-popup">
37            %if can_manage:
38                <a class="action-button" href="${h.url_for( controller='repository', action='manage_repository', id=trans.app.security.encode_id( repository.id ) )}">Manage repository</a>
39            %else:
40                <a class="action-button" href="${h.url_for( controller='repository', action='view_repository', id=trans.app.security.encode_id( repository.id ) )}">View repository</a>
41            %endif
42            %if can_upload:
43                <a class="action-button" href="${h.url_for( controller='upload', action='upload', repository_id=trans.security.encode_id( repository.id ), webapp='community' )}">Upload files to repository</a>
44            %endif
45            %if can_view_change_log:
46                <a class="action-button" href="${h.url_for( controller='repository', action='view_changelog', id=trans.app.security.encode_id( repository.id ) )}">View change log</a>
47            %endif
48            %if can_browse_contents:
49                <a class="action-button" href="${h.url_for( controller='repository', action='browse_repository', id=trans.app.security.encode_id( repository.id ) )}">${browse_label}</a>
50            %endif
51            %if can_download:
52                <a class="action-button" href="${h.url_for( controller='repository', action='download', repository_id=trans.app.security.encode_id( repository.id ), changeset_revision=repository.tip, file_type='gz' )}">Download as a .tar.gz file</a>
53                <a class="action-button" href="${h.url_for( controller='repository', action='download', repository_id=trans.app.security.encode_id( repository.id ), changeset_revision=repository.tip, file_type='bz2' )}">Download as a .tar.bz2 file</a>
54                <a class="action-button" href="${h.url_for( controller='repository', action='download', repository_id=trans.app.security.encode_id( repository.id ), changeset_revision=repository.tip, file_type='zip' )}">Download as a zip file</a>
55            %endif
56        </div>
57    %endif
58</ul>
59
60%if message:
61    ${render_msg( message, status )}
62%endif
63
64<div class="toolForm">
65    <div class="toolFormTitle">Contact the owner of the repository named '${repository.name}'</div>
66    <div class="toolFormBody">
67        <div class="form-row">
68            This feature is intended to streamline appropriate communication between
69            Galaxy tool developers and those in the Galaxy community that use them.
70            Please don't send messages unnecessarily.
71        </div>
72        <form name="send_to_owner" id="send_to_owner" action="${h.url_for( controller='repository', action='send_to_owner', id=trans.security.encode_id( repository.id ) )}" method="post" >
73            <div class="form-row">
74                <label>Message:</label>
75                <textarea name="message" rows="10" cols="40"></textarea>
76            </div>
77            <div class="form-row">
78                <input type="submit" value="Send to owner"/>
79            </div>
80        </form>
81    </div>
82</div>