workspace_getall.mak 4.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. <%inherit file="local:templates.master_authenticated_left_treeview"/>
  2. <%namespace name="LEFT_MENU" file="tracim.templates.widgets.left_menu"/>
  3. <%namespace name="TIM" file="tracim.templates.pod"/>
  4. <%namespace name="TOOLBAR" file="tracim.templates.workspace.toolbar"/>
  5. <%namespace name="ROW" file="tracim.templates.widgets.row"/>
  6. <%namespace name="ICON" file="tracim.templates.widgets.icon"/>
  7. <%namespace name="BUTTON" file="tracim.templates.widgets.button"/>
  8. <%def name="title()">${_('Workspaces')}</%def>
  9. <%def name="SIDEBAR_LEFT_CONTENT()">
  10. ${LEFT_MENU.TREEVIEW('sidebar-left-menu', '__')}
  11. </%def>
  12. <%def name="TITLE_ROW()">
  13. ${ROW.TITLE_ROW(_('Workspaces'), 'fa-bank', '', 't-user-color', _('Manage workspaces and subscribed users'))}
  14. </%def>
  15. <div class="workspace__wrapper">
  16. ## ADD A WORKSPACE
  17. % if fake_api.current_user.profile.id>=2:
  18. ## In this case the user is a pod manager, so he is allowed to create workspaces (and to delete them)
  19. <div class="workspace__create">
  20. <!-- #### CREATE A WORKSPACE #### -->
  21. <p class="t-spacer-above">
  22. <a class="btn btn-success" data-toggle="collapse" data-target="#create-workspace-form"><b>${_('Create a workspace...')}</b></a>
  23. </p>
  24. <div id="create-workspace-form" class="collapse">
  25. <div class="pod-inline-form" >
  26. <form role="form" method="POST" action="${tg.url('/admin/workspaces')}">
  27. <div class="form-group">
  28. <label for="workspace-name1">${_('Name')}</label>
  29. <input name="name" type="text" class="form-control" id="workspace-name" placeholder="${_('Name')}">
  30. </div>
  31. <div class="form-group">
  32. <label for="workspaceDescription">${_('Description')}</label>
  33. <textarea name="description" class="form-control" id="workspaceDescription" placeholder="${_('You may add a description of the workspace')}"></textarea>
  34. </div>
  35. <div class="checkbox form-group">
  36. <label for="workspaceCalendarEnabled">
  37. <input id="workspaceCalendarEnabled" name="calendar_enabled" type="checkbox" checked >
  38. <b>${_('Activate associated calendar')}</b>
  39. </label>
  40. </div>
  41. <div class="form-group">
  42. <p class="form-control-static">${_('<u>Note</u>: members will be added during next step.')|n}</p>
  43. </div>
  44. <span class="pull-right" style="margin-top: 0.5em;">
  45. <button type="submit" class="btn btn-small btn-success" title="${_('Validate')}"><i class=" fa fa-check"></i> ${_('Validate')}</button>
  46. </span>
  47. </form>
  48. <div style="clear: both;"></div>
  49. </div>
  50. </div>
  51. <!-- #### CREATE A WORKSPACE [END] #### -->
  52. </div>
  53. % endif
  54. ## ADD A WORKSPACE [END]
  55. ## LIST OF WORKSPACES
  56. <div class="workspace__list t-spacer-above">
  57. % if result.workspace_nb<=0:
  58. ${TIM.NO_CONTENT_INFO(_('There are no workspace yet. Start by <a class="alert-link" data-toggle="collapse" data-target="#create-workspace-form">creating a workspace</a>.'))}
  59. % else:
  60. <table class="table table-striped table-hover">
  61. <thead>
  62. <tr>
  63. <th>#</th>
  64. <th>${_('Workspace')}</th>
  65. <th>${_('Description')}</th>
  66. <th>${_('User Nb')}</th>
  67. <th>${_('Calendar')}</th>
  68. </tr>
  69. </thead>
  70. % for workspace in result.workspaces:
  71. <tr>
  72. <td>${workspace.id}</td>
  73. <td><a href="${tg.url('/admin/workspaces/{}'.format(workspace.id))}">${workspace.label}</a></td>
  74. <td>${workspace.description}</td>
  75. <td>${workspace.member_nb}</td>
  76. <td class="text-center">
  77. % if workspace.calendar_enabled:
  78. ${ICON.FA('fa-check-square-o fa-lg t-enabled-color')}
  79. % else:
  80. ${ICON.FA('fa-square-o fa-lg t-disabled-color')}
  81. % endif
  82. </td>
  83. </tr>
  84. % endfor
  85. </table>
  86. % endif
  87. </div>
  88. ## LIST OF WORKSPACES [END]
  89. </div> <!-- end workspace__wrapper -->