forms.mak 5.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. <%namespace name="TIM" file="tracim.templates.pod"/>
  2. <%namespace name="BUTTON" file="tracim.templates.widgets.button"/>
  3. <%namespace name="ICON" file="tracim.templates.widgets.icon"/>
  4. <%namespace name="LEFT_MENU" file="tracim.templates.user_workspace_widgets"/>
  5. <%def name="NEW(dom_id, workspace_id, parent_id=None)">
  6. <div id="{dom_id}">
  7. <form role="form" method="POST" enctype="multipart/form-data" action="${tg.url('/workspaces/{workspace_id}/folders').format(workspace_id=workspace_id)}">
  8. <input type="hidden" name="parent_id" value="${parent_id}">
  9. <div class="modal-header">
  10. <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">${_('Close')}</span></button>
  11. <h4 class="modal-title" >${ICON.FA('fa-folder-open-o t-folder-color')} ${_('New Folder')}</h4>
  12. </div>
  13. <div class="modal-body">
  14. <div class="form-group">
  15. <label for="folder-label">${_('Folder name')}</label>
  16. <input id="folder-label" class="form-control" name="label" type="text">
  17. </div>
  18. <div class="form-group">
  19. <p>${_('This folder may contain:')}</p>
  20. <p>
  21. <label><input id="content-folders" name="can_contain_folders" type="checkbox" checked> ${TIM.FA('fa-folder-open-o fa-fw t-folder-color')} ${_('sub-folders')}</label><br/>
  22. <label><input id="content-threads" name="can_contain_threads" type="checkbox" checked> ${TIM.FA('fa-comments-o fa-fw t-thread-color')} ${_('threads')}</label><br/>
  23. <label><input id="content-files" name="can_contain_files" type="checkbox" checked> ${TIM.FA('fa-paperclip fa-fw t-file-color')} ${_('files')}</label><br/>
  24. <label><input id="content-pages" name="can_contain_pages" type="checkbox" checked> ${TIM.FA('fa-file-text-o fa-fw t-page-color')} ${_('pages')}</label>
  25. ## FIXME - D.A. - 2015-05-25
  26. ## The help dialog is show below current dialog (so it is invisible)
  27. ## ${BUTTON.HELP_MODAL_DIALOG('content-wiki-page-definition', 'margin-left: 0.5em;')}
  28. </p>
  29. </div>
  30. </div>
  31. <div class="modal-footer">
  32. <span class="pull-right" style="margin-top: 0.5em;">
  33. <button id="folder-save-button" type="submit" class="btn btn-small btn-success" title="${_('Create folder')}"><i class="fa fa-check"></i> ${_('Validate')}</button>
  34. </span>
  35. </div>
  36. </form>
  37. </div>
  38. </%def>
  39. <%def name="MOVE(dom_id, item, do_move_url, modal_title)">
  40. <form id="move_folder_popup" role="form" method="POST" action="${do_move_url}">
  41. <div class="modal-header">
  42. <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">${_('Close')}</span></button>
  43. <h4 class="modal-title">${TIM.FA('fa-arrows t-less-visible')} ${modal_title}</h4>
  44. </div>
  45. <div class="modal-body">
  46. <div>
  47. <ul class="nav nav-tabs" role="tablist">
  48. <li role="presentation" class="active"><a href="#move-to-same-workspace" aria-controls="move-to-same-workspace" role="tab" data-toggle="tab">${_('in current workspace...')}</a></li>
  49. <li role="presentation"><a href="#move-to-another-workspace" aria-controls="move-to-another-workspace" role="tab" data-toggle="tab">${_('to another workspace')}</a></li>
  50. </ul>
  51. <div class="tab-content">
  52. <div role="tabpanel" class="tab-pane active bg-primary" id="move-to-same-workspace"></div>
  53. <%
  54. selected_id = 'workspace_{}__folder_{}'.format(item.workspace.id, item.folder.id if item.folder else '')
  55. apiPath = tg.url('/workspaces/treeview_root')
  56. apiParameters = tg.url('', dict(current_id=selected_id, all_workspaces=0, folder_allowed_content_types='folder', ignore_id=item.id))
  57. apiChildPath = tg.url('/workspaces/treeview_children')
  58. apiChildParameters = tg.url('', dict(ignore_id=item.id, allowed_content_types='folder'))
  59. %>
  60. ${LEFT_MENU.TREEVIEW('move-to-same-workspace', apiPath, apiParameters, apiChildPath, apiChildParameters, 'True')}
  61. <div role="tabpanel" class="tab-pane bg-primary" id="move-to-another-workspace"></div>
  62. <%
  63. apiPath = tg.url('/workspaces/treeview_root')
  64. apiParameters = tg.url('', dict(current_id=None, all_workspaces=1, folder_allowed_content_types='folder', ignore_id=item.id, ignore_workspace_id=item.workspace.id))
  65. apiChildPath = tg.url('/workspaces/treeview_children')
  66. apiChildParameters = tg.url('', dict(ignore_id=item.id, allowed_content_types='folder'))
  67. %>
  68. ${LEFT_MENU.TREEVIEW('move-to-another-workspace', apiPath, apiParameters, apiChildPath, apiChildParameters, 'False')}
  69. </div>
  70. </div>
  71. </div>
  72. <div class="modal-footer">
  73. <span class="pull-right t-modal-form-submit-button">
  74. <button id="folder-save-button" type="submit" class="btn btn-small btn-success" title="${_('Validate')}"><i class="fa fa-check"></i> ${_('Validate')}</button>
  75. </span>
  76. </div>
  77. </form>
  78. </%def>