user_workspace_forms.mak 7.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. <%namespace name="TIM" file="tracim.templates.pod"/>
  2. <%namespace name="WIDGETS" file="tracim.templates.user_workspace_widgets"/>
  3. <%namespace name="BUTTON" file="tracim.templates.widgets.button"/>
  4. <%def name="EDIT_FOLDER_FORM(dom_id, folder)">
  5. <form role="form" method="POST" action="${tg.url('/workspaces/{}/folders/{}?_method=PUT').format(folder.workspace.id, folder.id)}">
  6. <div class="modal-header">
  7. <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">${_('Close')}</span></button>
  8. <h4 class="modal-title">${TIM.FA('fa-edit t-less-visible')} ${_('Edit Folder')}</h4>
  9. </div>
  10. <div class="modal-body">
  11. <div class="form-group">
  12. <label for="folder-name">${_('Name')}</label>
  13. <input name="label" type="text" class="form-control" id="name" placeholder="${_('Name')}" value="${folder.label}">
  14. </div>
  15. <p>
  16. ${_('This folder may contain:')}
  17. </p>
  18. <div class="checkbox">
  19. <% checked = ('', 'checked')[folder.allowed_content.folder] %>
  20. <label><input name="can_contain_folders" type="checkbox" ${checked}> ${TIM.FA('fa-folder-open-o fa-fw t-folder-color')} ${_('sub-folders')}</label>
  21. </div>
  22. <div class="checkbox">
  23. <% checked = ('', 'checked')[folder.allowed_content.thread] %>
  24. <label><input name="can_contain_threads" type="checkbox" ${checked}> ${TIM.FA('fa-comments-o fa-fw t-thread-color')} ${_('threads')}</label>
  25. </div>
  26. <div class="checkbox">
  27. <% checked = ('', 'checked')[folder.allowed_content.file] %>
  28. <label><input name="can_contain_files" type="checkbox" ${checked}> ${TIM.FA('fa-paperclip fa-fw t-file-color')} ${_('files')}</label>
  29. </div>
  30. <div class="checkbox">
  31. <% checked = ('', 'checked')[folder.allowed_content.page] %>
  32. <label><input name="can_contain_pages" type="checkbox" ${checked}> ${TIM.FA('fa-file-text-o fa-fw t-page-color')} ${_('Wiki pages')} </label>
  33. </div>
  34. </div>
  35. <div class="modal-footer">
  36. <span class="pull-right t-modal-form-submit-button">
  37. <button id="folder-save-button" type="submit" class="btn btn-small btn-success" title="${_('Validate')}"><i class="fa fa-check"></i> ${_('Validate')}</button>
  38. </span>
  39. </div>
  40. </form>
  41. </%def>
  42. <%def name="NEW_PAGE_FORM(dom_id, workspace_id, parent_id=None)">
  43. <div id="${dom_id}" class="collapse">
  44. <div class="pod-inline-form" >
  45. <form method="POST" action="${tg.url('/workspaces/{}/folders/{}/pages').format(workspace_id, parent_id)}">
  46. <div class="form-group">
  47. <label for="page-title">${_('Page title')}</label>
  48. <input name="label" type="text" class="form-control" id="page-title" placeholder="${_('Title')}">
  49. </div>
  50. <div class="form-group">
  51. <label for="page-content">${_('Content')}</label>
  52. <textarea id="page-content-textarea" name="content" class="form-control pod-rich-textarea" id="page-content" placeholder="${_('Write here the page content')}"></textarea>
  53. </div>
  54. <span class="pull-right t-modal-form-submit-button">
  55. <button id="${dom_id}-submit-button" type="submit" class="btn btn-small btn-success" title="${_('Create this page')}"><i class=" fa fa-check"></i> ${_('Validate')}</button>
  56. </span>
  57. <div style="clear: both;"></div>
  58. </form>
  59. </div>
  60. <hr/>
  61. </div>
  62. </%def>
  63. <%def name="NEW_THREAD_FORM(dom_id, workspace_id, parent_id=None)">
  64. <div id="${dom_id}" class="collapse">
  65. <div class="pod-inline-form" >
  66. <form role="form" method="POST" action="${tg.url('/workspaces/{}/folders/{}/threads').format(workspace_id, parent_id)}">
  67. <div class="form-group">
  68. <label for="thread-name">${_('Subject')}</label>
  69. <input id="thread-name" class="form-control" name="label" type="text" placeholder="${_('...')}">
  70. </div>
  71. <div class="form-group">
  72. <label for="thread-message">${_('Message')}</label>
  73. <textarea id="thread-message" class="form-control pod-rich-textarea" name="content" type="text" placeholder="${_('...')}"></textarea>
  74. </div>
  75. <span class="pull-right t-modal-form-submit-button">
  76. <button id="${dom_id}-submit-button" type="submit" class="btn btn-small btn-success" title="${_('Create this page')}"><i class=" fa fa-check"></i> ${_('Validate')}</button>
  77. </span>
  78. <div style="clear: both;"></div>
  79. </form>
  80. </div>
  81. <hr/>
  82. </div>
  83. </%def>
  84. <%def name="USER_EDIT_FORM(dom_id, user, target_url, next_url='')">
  85. <form id="${dom_id}" role="form" method="POST" action="${target_url}">
  86. <input type="hidden" name="next_url" id="next_url" value="${next_url}">
  87. <div class="modal-header">
  88. <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
  89. <h4 class="modal-title" id="myModalLabel">${TIM.FA('fa-edit t-less-visible')} ${_('Edit User')}</h4>
  90. </div>
  91. <div class="modal-body">
  92. <div class="form-group">
  93. <label for="name">${_('Name')}</label>
  94. % if h.is_user_externalized_field('name'):
  95. <span class="info readonly">${_('This information is managed by an external application')}</span>
  96. % endif
  97. <input name="name" type="text" class="form-control" id="name" placeholder="${_('Name')}" value="${user.name}" ${'readonly="readonly"' if h.is_user_externalized_field('name') else '' | n}>
  98. </div>
  99. <div class="form-group">
  100. <label for="email">${_('Email')}</label>
  101. % if h.is_user_externalized_field('email'):
  102. <span class="info readonly">${_('This information is managed by an external application')}</span>
  103. % endif
  104. <input name="email" type="text" class="form-control" id="email" placeholder="${_('Name')}" value="${user.email}" ${'readonly="readonly"' if h.is_user_externalized_field('email') else '' | n}>
  105. </div>
  106. <div class="form-group">
  107. <label for="calendar">${_('Personal calendar')}</label>
  108. <span class="info readonly">${_('This calendar URL will work with CalDav compatibles clients')}</span>
  109. <div class="user-edit-form__calendar__url">${user.calendar_url}</div>
  110. </div>
  111. <div class="form-group">
  112. <label for="timezone">${_('Timezone')}</label>
  113. <span class="info readonly">${_('Dates will be displayed with this timezone')}</span>
  114. <select id="timezone" name="timezone" class="form-control">
  115. <option value=""></option>
  116. % for timezone in timezones:
  117. % if timezone == user.timezone:
  118. <option value="${timezone}" selected>${timezone}</option>
  119. % else:
  120. <option value="${timezone}">${timezone}</option>
  121. % endif
  122. % endfor
  123. </select>
  124. </div>
  125. </div>
  126. <div class="modal-footer">
  127. <span class="pull-right t-modal-form-submit-button">
  128. <button type="submit" class="btn btn-small btn-success" title="Add first comment"><i class=" fa fa-check"></i> ${_('Validate')}</button>
  129. </span>
  130. </div>
  131. </form>
  132. </%def>