1 | <%inherit file="/base.mako"/> |
---|
2 | <%namespace file="/message.mako" import="render_msg" /> |
---|
3 | <%namespace file="/library/common/common.mako" import="render_template_fields" /> |
---|
4 | |
---|
5 | <%def name="javascripts()"> |
---|
6 | ${parent.javascripts()} |
---|
7 | </%def> |
---|
8 | |
---|
9 | <% |
---|
10 | from cgi import escape |
---|
11 | if trans.user_is_admin() and cntrller == 'library_admin': |
---|
12 | can_add = can_modify = can_manage = True |
---|
13 | elif cntrller in [ 'library', 'requests' ]: |
---|
14 | can_add = trans.app.security_agent.can_add_library_item( current_user_roles, library ) |
---|
15 | can_modify = trans.app.security_agent.can_modify_library_item( current_user_roles, library ) |
---|
16 | can_manage = trans.app.security_agent.can_manage_library_item( current_user_roles, library ) |
---|
17 | else: |
---|
18 | can_add = can_modify = can_manage = False |
---|
19 | library_name = escape( str( library.name ), quote=True ) |
---|
20 | library_description = escape( str( library.description ), quote=True ) |
---|
21 | library_synopsis = escape( str( library.synopsis ), quote=True ) |
---|
22 | %> |
---|
23 | |
---|
24 | <br/><br/> |
---|
25 | <ul class="manage-table-actions"> |
---|
26 | <li> |
---|
27 | <a class="action-button" href="${h.url_for( controller='library_common', action='browse_library', cntrller=cntrller, id=trans.security.encode_id( library.id ), use_panels=use_panels, show_deleted=show_deleted )}"><span>Browse this data library</span></a> |
---|
28 | </li> |
---|
29 | </ul> |
---|
30 | |
---|
31 | %if message: |
---|
32 | ${render_msg( message, status )} |
---|
33 | %endif |
---|
34 | |
---|
35 | <div class="toolForm"> |
---|
36 | <div class="toolFormTitle"> |
---|
37 | <div class="menubutton split popup" id="library-${library.id}-popup"> |
---|
38 | <a href="${h.url_for( controller='library_common', action='browse_library', cntrller=cntrller, id=trans.security.encode_id( library.id ), use_panels=use_panels, show_deleted=show_deleted )}">${library.name[:50]}</a> |
---|
39 | </div> |
---|
40 | %if can_add or can_modify or can_manage: |
---|
41 | <div popupmenu="library-${library.id}-popup"> |
---|
42 | %if not library.deleted: |
---|
43 | %if can_add and not library.info_association: |
---|
44 | <a class="action-button" href="${h.url_for( controller='library_common', action='add_template', cntrller=cntrller, item_type='library', library_id=trans.security.encode_id( library.id ), use_panels=use_panels, show_deleted=show_deleted )}">Add template</a> |
---|
45 | %endif |
---|
46 | %if can_manage: |
---|
47 | <a class="action-button" href="${h.url_for( controller='library_common', action='library_permissions', cntrller=cntrller, id=trans.security.encode_id( library.id ), use_panels=use_panels, show_deleted=show_deleted )}">Edit permissions</a> |
---|
48 | %endif |
---|
49 | %if can_modify: |
---|
50 | <a class="action-button" confirm="Click OK to delete the library named '${library.name}'." href="${h.url_for( controller='library_common', action='delete_library_item', cntrller=cntrller, library_id=trans.security.encode_id( library.id ), item_id=trans.security.encode_id( library.id ), item_type='library' )}">Delete this data library</a> |
---|
51 | %endif |
---|
52 | %elif can_modify and not library.purged: |
---|
53 | <a class="action-button" href="${h.url_for( controller='library_common', action='undelete_library_item', cntrller=cntrller, library_id=trans.security.encode_id( library.id ), item_id=trans.security.encode_id( library.id ), item_type='library' )}">Undelete this data library</a> |
---|
54 | %elif library.purged: |
---|
55 | <a class="action-button" href="${h.url_for( controller='library_common', action='browse_library', cntrller=cntrller, id=trans.security.encode_id( library.id ), use_panels=use_panels, show_deleted=show_deleted )}">This data library has been purged</a> |
---|
56 | %endif |
---|
57 | </div> |
---|
58 | %endif |
---|
59 | </div> |
---|
60 | <div class="toolFormBody"> |
---|
61 | %if not library.deleted and can_modify: |
---|
62 | <form name="library" action="${h.url_for( controller='library_common', action='library_info', id=trans.security.encode_id( library.id ), cntrller=cntrller, use_panels=use_panels, show_deleted=show_deleted )}" method="post" > |
---|
63 | <div class="form-row"> |
---|
64 | <label>Name:</label> |
---|
65 | <div style="float: left; width: 250px; margin-right: 10px;"> |
---|
66 | <input type="text" name="name" value="${library_name}" size="40"/> |
---|
67 | </div> |
---|
68 | <div style="clear: both"></div> |
---|
69 | </div> |
---|
70 | <div class="form-row"> |
---|
71 | <label>Description:</label> |
---|
72 | <div style="float: left; width: 250px; margin-right: 10px;"> |
---|
73 | <input type="text" name="description" value="${library_description}" size="40"/> |
---|
74 | </div> |
---|
75 | <div class="toolParamHelp" style="clear: both;"> |
---|
76 | Displayed when browsing all libraries |
---|
77 | </div> |
---|
78 | <div style="clear: both"></div> |
---|
79 | </div> |
---|
80 | <div class="form-row"> |
---|
81 | <label>Synopsis:</label> |
---|
82 | <div style="float: left; width: 250px; margin-right: 10px;"> |
---|
83 | <input type="text" name="synopsis" value="${library_synopsis}" size="40"/> |
---|
84 | </div> |
---|
85 | <div class="toolParamHelp" style="clear: both;"> |
---|
86 | Displayed when browsing this library |
---|
87 | </div> |
---|
88 | <div style="clear: both"></div> |
---|
89 | </div> |
---|
90 | <div class="form-row"> |
---|
91 | <input type="submit" name="library_info_button" value="Save"/> |
---|
92 | </div> |
---|
93 | </form> |
---|
94 | %else: |
---|
95 | <div class="form-row"> |
---|
96 | <label>Name:</label> |
---|
97 | ${library_name} |
---|
98 | </div> |
---|
99 | <div style="clear: both"></div> |
---|
100 | <div class="form-row"> |
---|
101 | <label>Description:</label> |
---|
102 | ${library_description} |
---|
103 | </div> |
---|
104 | <div style="clear: both"></div> |
---|
105 | <div class="form-row"> |
---|
106 | <label>Synopsis:</label> |
---|
107 | ${library_synopsis} |
---|
108 | </div> |
---|
109 | <div style="clear: both"></div> |
---|
110 | %endif |
---|
111 | </div> |
---|
112 | </div> |
---|
113 | |
---|
114 | %if widgets: |
---|
115 | ${render_template_fields( cntrller=cntrller, item_type='library', library_id=trans.security.encode_id( library.id ), widgets=widgets, widget_fields_have_contents=widget_fields_have_contents, info_association=info_association, inherited=inherited, editable=not( library.deleted ) )} |
---|
116 | %endif |
---|