/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. <% current_user_roles = trans.get_current_user_roles() %>
  6. %if message:
  7. ${render_msg( message, status )}
  8. %endif
  9. %if trans.app.security_agent.can_modify_library_item( current_user_roles, library ):
  10. <div class="toolForm">
  11. <div class="toolFormTitle">Change library name and description</div>
  12. <div class="toolFormBody">
  13. <form name="library" action="${h.url_for( controller='library_common', action='library_info', id=trans.security.encode_id( library.id ), cntrller='mobile' )}" method="post" >
  14. <div class="form-row">
  15. <label>Name:</label>
  16. <div style="float: left; width: 250px; margin-right: 10px;">
  17. <input type="text" name="name" value="${library.name}" size="40"/>
  18. </div>
  19. <div style="clear: both"></div>
  20. </div>
  21. <div class="form-row">
  22. <label>Description:</label>
  23. <div style="float: left; width: 250px; margin-right: 10px;">
  24. <input type="text" name="description" value="${library.description}" size="40"/>
  25. </div>
  26. <div style="clear: both"></div>
  27. </div>
  28. <div class="form-row">
  29. <label>Synopsis:</label>
  30. <div style="float: left; width: 250px; margin-right: 10px;">
  31. <input type="text" name="synopsis" value="${library.synopsis}" size="40"/>
  32. </div>
  33. <div style="clear: both"></div>
  34. </div>
  35. <input type="submit" name="library_info_button" value="Save"/>
  36. </form>
  37. </div>
  38. </div>
  39. <p/>
  40. %else:
  41. <div class="toolForm">
  42. <div class="toolFormTitle">View information about ${library.name}</div>
  43. <div class="form-row">
  44. <label>Name:</label>
  45. ${library.name}
  46. </div>
  47. <div style="clear: both"></div>
  48. <div class="form-row">
  49. <label>Description:</label>
  50. ${library.description}
  51. </div>
  52. <div style="clear: both"></div>
  53. <div class="form-row">
  54. <label>Synopsis:</label>
  55. ${library.synopsis}
  56. </div>
  57. <div style="clear: both"></div>
  58. <div class="toolForm">
  59. ${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 )}
  60. </div>
  61. </div>
  62. %endif
  63. %if trans.app.security_agent.can_manage_library_item( current_user_roles, library ):
  64. <% roles = trans.app.security_agent.get_legitimate_roles( trans, library, 'mobile' ) %>
  65. ${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 )}
  66. %endif
  67. %if widgets:
  68. ${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 )}
  69. %endif