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

/templates/mobile/manage_library.mako

https://bitbucket.org/cistrome/cistrome-harvard/
Mako | 73 lines | 69 code | 4 blank | 0 comment | 4 complexity | f39932880f6cc25be46d798e1159d9fc MD5 | raw file
 1<%inherit file="/base.mako"/>
 2<%namespace file="/message.mako" import="render_msg" />
 3<%namespace file="/dataset/security_common.mako" import="render_permission_form" />
 4<%namespace file="/common/template_common.mako" import="render_template_fields" />
 5
 6<% current_user_roles = trans.get_current_user_roles() %>
 7
 8%if message:
 9    ${render_msg( message, status )}
10%endif
11
12%if trans.app.security_agent.can_modify_library_item( current_user_roles, library ):
13    <div class="toolForm">
14        <div class="toolFormTitle">Change library name and description</div>
15        <div class="toolFormBody">
16            <form name="library" action="${h.url_for( controller='library_common', action='library_info', id=trans.security.encode_id( library.id ), cntrller='mobile' )}" method="post" >
17                <div class="form-row">
18                    <label>Name:</label>
19                    <div style="float: left; width: 250px; margin-right: 10px;">
20                        <input type="text" name="name" value="${library.name}" size="40"/>
21                    </div>
22                    <div style="clear: both"></div>
23                </div>
24                <div class="form-row">
25                    <label>Description:</label>
26                    <div style="float: left; width: 250px; margin-right: 10px;">
27                        <input type="text" name="description" value="${library.description}" size="40"/>
28                    </div>
29                    <div style="clear: both"></div>
30                </div>
31                <div class="form-row">
32                    <label>Synopsis:</label>
33                    <div style="float: left; width: 250px; margin-right: 10px;">
34                        <input type="text" name="synopsis" value="${library.synopsis}" size="40"/>
35                    </div>
36                    <div style="clear: both"></div>
37                </div>
38                <input type="submit" name="library_info_button" value="Save"/>
39            </form>
40        </div>
41    </div>
42    <p/>
43%else:
44    <div class="toolForm">
45        <div class="toolFormTitle">View information about ${library.name}</div>
46        <div class="form-row">
47            <label>Name:</label>
48            ${library.name}
49        </div>
50        <div style="clear: both"></div>
51        <div class="form-row">
52            <label>Description:</label>
53            ${library.description}
54        </div>
55        <div style="clear: both"></div>
56        <div class="form-row">
57            <label>Synopsis:</label>
58            ${library.synopsis}
59        </div>
60        <div style="clear: both"></div>
61        <div class="toolForm">
62            ${render_template_fields( cntrller='mobile', item_type='library', widgets=widgets, widget_fields_have_contents=widget_fields_have_contents, library_id=trans.security.encode_id( library.id ), info_association=info_association, inherited=inherited )}
63        </div>
64    </div>
65%endif
66%if trans.app.security_agent.can_manage_library_item( current_user_roles, library ):
67    <% roles = trans.app.security_agent.get_legitimate_roles( trans, library, 'mobile' ) %>
68    ${render_permission_form( library, library.name, h.url_for( controller='library_common', cntrller='mobile', action='library_permissions', id=trans.security.encode_id( library.id ) ), roles )}
69%endif
70
71%if widgets:
72    ${render_template_fields( cntrller='mobile', item_type='library', widgets=widgets, widget_fields_have_contents=widget_fields_have_contents, library_id=trans.security.encode_id( library.id ), info_association=info_association, inherited=inherited )}
73%endif