<%inherit file="/base.mako"/> <%namespace file="/message.mako" import="render_msg" /> <%namespace file="/library/common/common.mako" import="render_template_fields" /> <%def name="javascripts()"> ${parent.javascripts()} <% from cgi import escape if trans.user_is_admin() and cntrller == 'library_admin': can_add = can_modify = can_manage = True elif cntrller in [ 'library', 'requests' ]: can_add = trans.app.security_agent.can_add_library_item( current_user_roles, library ) can_modify = trans.app.security_agent.can_modify_library_item( current_user_roles, library ) can_manage = trans.app.security_agent.can_manage_library_item( current_user_roles, library ) else: can_add = can_modify = can_manage = False library_name = escape( str( library.name ), quote=True ) library_description = escape( str( library.description ), quote=True ) library_synopsis = escape( str( library.synopsis ), quote=True ) %>

%if message: ${render_msg( message, status )} %endif
%if can_add or can_modify or can_manage:
%if not library.deleted: %if can_add and not library.info_association: Add template %endif %if can_manage: Edit permissions %endif %if can_modify: Delete this data library %endif %elif can_modify and not library.purged: Undelete this data library %elif library.purged: This data library has been purged %endif
%endif
%if not library.deleted and can_modify:
Displayed when browsing all libraries
Displayed when browsing this library
%else:
${library_name}
${library_description}
${library_synopsis}
%endif
%if widgets: ${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 ) )} %endif