document.mak 12KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269
  1. <%inherit file="local:templates.master"/>
  2. <%namespace name="POD" file="pboard.templates.pod"/>
  3. <%def name="node_treeview_for_set_parent_menu(node_id, node_list, indentation=-1)">
  4. % if indentation==-1:
  5. <li><a href="${tg.url('/api/set_parent_node?node_id=%i&new_parent_id=0'%(current_node.node_id))}">${_('Home')}</a>
  6. ${node_treeview_for_set_parent_menu(node_id, node_list, 0)}
  7. </li>
  8. % else:
  9. % if len(node_list)>0:
  10. <ul>
  11. % for new_parent_node in node_list:
  12. <li>
  13. <a href="${tg.url('/api/set_parent_node?node_id=%i&new_parent_id=%i'%(node_id, new_parent_node.node_id))}">${new_parent_node.getTruncatedLabel(40-indentation*2)}</a>
  14. ${node_treeview_for_set_parent_menu(node_id, new_parent_node.getChildren(), indentation+1)}
  15. </li>
  16. % endfor
  17. </ul>
  18. % endif
  19. % endif
  20. </%def>
  21. <%def name="node_treeview(node_list, indentation=-1)">
  22. % if indentation==-1:
  23. <div class="pod-toolbar-parent" style="padding-left: 0.5em; position: relative;">
  24. <a href="?node=0" title="${_('Root')}">
  25. <i class='icon-g-folder-open'></i>
  26. ${_('Root')}
  27. </a>
  28. <div class="pod-toolbar">
  29. <a href="${tg.url('/api/create_document?parent_id=0')}" title="${_('Add child document')}"><i class="icon-g-circle-plus"></i></a>
  30. </div>
  31. </div>
  32. ${node_treeview(node_list, 0)}
  33. % else:
  34. % if len(node_list)>0:
  35. % for node in node_list:
  36. <div class="pod-toolbar-parent" style="padding-left: ${(indentation+2)*0.5}em; position: relative;">
  37. <a href="?node=${node.node_id}" title="${node.data_label}">
  38. % if node.getStatus().status_family=='closed' or node.getStatus().status_family=='invisible':
  39. <strike>
  40. % endif
  41. <i class='${node.getIconClass()}'></i> ${node.getTruncatedLabel(32-0.8*(indentation+1))}
  42. % if node.getStatus().status_family=='closed' or node.getStatus().status_family=='invisible':
  43. </strike>
  44. % endif
  45. </a>
  46. <div class="pod-toolbar">
  47. <a href="${tg.url('/api/move_node_upper?node_id=%i'%(node.node_id))}" title="${_('Move up')}"><i class="icon-g-up-arrow"></i></a>
  48. <a href="${tg.url('/api/move_node_lower?node_id=%i'%(node.node_id))}" title="${_('Move down')}"><i class="icon-g-down-arrow"></i></a>
  49. <a href="${tg.url('/api/create_document?parent_id=%i'%(node.node_id))}" title="${_('Add child document')}"><i class="icon-g-circle-plus"></i></a>
  50. </div>
  51. <div class="pod-status ${node.getStatus().css}" title='${node.getStatus().label}'>
  52. <i class='${node.getStatus().icon}'></i>
  53. </div>
  54. </div>
  55. ${node_treeview(node.getChildren(), indentation+1)}
  56. % endfor
  57. % endif
  58. % endif
  59. </%def>
  60. <%def name="node_treeview_in_select_field(node_list, indentation, selected_id=0)">
  61. % if len(node_list)>0:
  62. % if indentation==0:
  63. <option style="margin-left: ${0.5*indentation}em; color: #CCC;" value="0">no parent...</option>
  64. % endif
  65. % for node in node_list:
  66. % if selected_id!=node.node_id:
  67. <option style="margin-left: ${0.5*indentation}em;" value="${node.node_id}">${node.data_label}</option>
  68. % else:
  69. <option style="margin-left: ${0.5*indentation}em;" value="${node.node_id}" selected>${node.data_label}</option>
  70. % endif
  71. ${node_treeview_in_select_field(node.getChildren(), indentation+1, selected_id)}
  72. % endfor
  73. % endif
  74. </%def>
  75. <%def name="title()">
  76. POD :: ${current_node.getTruncatedLabel(40)} [${current_node.getStatus().label}]
  77. </%def>
  78. <div class="row">
  79. <div class="span3">
  80. <div class="btn-group">
  81. <button class="btn">${_('Documents')}</button>
  82. <button class="btn" title="${_('Show current filtering state')}"><i class=" icon-g-eye-open"></i></button>
  83. <a class="btn dropdown-toggle" data-toggle="dropdown" href="#" title='${_('Adjust filtering')}'><i class=" icon-g-adjust"></i></a>
  84. <ul class="dropdown-menu">
  85. % for node_status in node_status_list:
  86. <li>
  87. <a class="${node_status.css}" href="${tg.url('/edit_status?node_id=%i&node_status=%s'%(current_node.node_id, node_status.status_id))}">
  88. <i class="${node_status.icon_id}"></i> ${node_status.label}
  89. </a>
  90. </li>
  91. % endfor
  92. </ul>
  93. </div>
  94. <p></p>
  95. <div>
  96. ${node_treeview(root_node_list)}
  97. </div>
  98. </div>
  99. <div class="span9">
  100. <div class="btn-group">
  101. <button class="btn">Status</button>
  102. <a class="btn ${current_node.getStatus().css}" href="#"><i class="${current_node.getStatus().icon}"></i> ${current_node.getStatus().getLabel()}</a>
  103. <a class="btn ${current_node.getStatus().css} dropdown-toggle" data-toggle="dropdown" href="#"><span class="caret"></span></a>
  104. <ul class="dropdown-menu">
  105. % for node_status in node_status_list:
  106. <li>
  107. <a class="${node_status.css}" href="${tg.url('/edit_status?node_id=%i&node_status=%s'%(current_node.node_id, node_status.status_id))}">
  108. <i class="${node_status.icon_id}"></i> ${node_status.label}
  109. </a>
  110. </li>
  111. % endfor
  112. </ul>
  113. </div>
  114. <div class="btn-group">
  115. ${POD.EditButton('current-document-content-edit-button', True)}
  116. <a class="btn" href="#" data-toggle="dropdown"><i class="icon-g-move"></i> ${_('Move to')} <span class="caret"></span></a>
  117. <ul class="dropdown-menu">
  118. ${node_treeview_for_set_parent_menu(current_node.node_id, root_node_list)}
  119. </ul>
  120. <a href='${tg.url('/api/force_delete_node?node_id=%i'%(current_node.node_id))}' id='current-document-force-delete-button' class="btn" onclick="return confirm('${_('Delete current document?')}');"><i class="icon-g-remove"></i> ${_('Delete')}</a>
  121. </div>
  122. <!--</div> PAGE HEADER -->
  123. <h3 id="current-document-title">#${current_node.node_id} - ${current_node.data_label}</h3>
  124. <form style='display: none; margin-top: 1em;' id="current-document-title-edit-form" method='post' action='${tg.url('/api/edit_label')}'>
  125. <div class="input-prepend input-append">
  126. <input type='hidden' name='node_id' value='${current_node.node_id}'/>
  127. ${POD.CancelButton('current-document-title-edit-cancel-button')}
  128. <input type='text' name='data_label' value='${current_node.data_label}' class="span2" />
  129. ${POD.SaveButton('current-document-title-save-cancel-button')}
  130. </div>
  131. </form>
  132. </div>
  133. <div class="span5">
  134. <p>
  135. <div id='current-document-content' class="">
  136. ${current_node.getContentWithTags()|n}
  137. </div>
  138. <form style='display: none;' id="current-document-content-edit-form" method='post' action='${tg.url('/api/edit_content')}'>
  139. <input type='hidden' name='node_id' value='${current_node.node_id}'/>
  140. <textarea id="current_node_textarea" name='data_content' spellcheck="false" wrap="off" autofocus placeholder="Enter something ...">
  141. ${current_node.data_content|n}
  142. </textarea>
  143. ${POD.CancelButton('current-document-content-edit-cancel-button', True)}
  144. ${POD.SaveButton('current-document-content-edit-save-button', True)}
  145. </form>
  146. </p>
  147. </div>
  148. <div class="span4">
  149. <div class="tabbable">
  150. <ul class="nav nav-tabs">
  151. <li class=""><a href="#tags" data-toggle="tab" title="${_('Tags')}"><i class='icon-g-tags'></i></a></li>
  152. <li class="active">
  153. <a href="#events" data-toggle="tab" title="History"><i class="icon-g-history"></i></a>
  154. </li>
  155. <li><a href="#contacts" data-toggle="tab" title="Contacts"><i class="icon-g-phone""></i> </a></li>
  156. <li><a href="#comments" data-toggle="tab" title="Comments"><i class="icon-g-comments"></i> </a></li>
  157. <li><a href="#files" data-toggle="tab" title="Files"><i class="icon-g-attach"></i> </a></li>
  158. <li><a href="#contacts" data-toggle="tab" title="Users"><i class="icon-g-user""></i> </a></li>
  159. </ul>
  160. <div class="tab-content">
  161. <div class="tab-pane" id="tags">
  162. <div class="well">
  163. <p>
  164. <i>
  165. ${_('Tags are automatically extracted from document content:')}
  166. <ul>
  167. <li>${_('<code>@visible_keyword</code> is a visible keyword generating a tag.')|n}</li>
  168. <li>
  169. ${_('<code>@invisible_keyword</code> is an <u>invisible</u> keyword generating a tag.')|n}</li>
  170. </ul>
  171. </i>
  172. </p>
  173. % for tag in current_node.getTagList():
  174. ${POD.Badge(tag)}
  175. % endfor
  176. </div>
  177. </div>
  178. <div class="tab-pane active" id="events">
  179. ${POD.AddButton('current-document-add-event-button', True, _(' Add event'))}
  180. <form style='display: none;' id='current-document-add-event-form' action='${tg.url('/api/create_event')}' method='post' class="well">
  181. <input type="hidden" name='parent_id' value='${current_node.node_id}'/>
  182. <fieldset>
  183. <legend>Add an event</legend>
  184. <label>
  185. <input type="text" name='data_label' placeholder="Event"/>
  186. </label>
  187. <label>
  188. <div class="datetime-picker-input-div input-append date">
  189. <input name='data_datetime' data-format="dd/MM/yyyy hh:mm" type="text" placeholder="date and time"/>
  190. <span class="add-on"><i data-time-icon="icon-g-clock" data-date-icon="icon-g-calendar"></i></span>
  191. </div>
  192. </label>
  193. <label>
  194. <div>
  195. <textarea id="add_event_data_content_textarea" name='data_content' spellcheck="false" wrap="off" autofocus placeholder="${_('detail...')}"></textarea>
  196. </div>
  197. </label>
  198. <label class="checkbox">
  199. <input disabled name='add_reminder' type="checkbox"> add a reminder
  200. </label>
  201. <label>
  202. <div class="datetime-picker-input-div input-append date">
  203. <input disabled name='data_reminder_datetime' data-format="dd/MM/yyyy hh:mm" type="text" placeholder="date and time"/>
  204. <span class="add-on"><i data-time-icon="icon-g-clock" data-date-icon="icon-g-calendar"></i></span>
  205. </div>
  206. </label>
  207. ${POD.CancelButton('current-document-add-event-cancel-button', True)}
  208. ${POD.SaveButton('current-document-add-event-save-button', True)}
  209. </fieldset>
  210. </form>
  211. % if len(current_node.getEvents())<=0:
  212. <p><i>${_('No history for the moment.')}</i></p>
  213. % else:
  214. <table class="table table-striped table-hover table-condensed">
  215. <thead>
  216. <tr>
  217. <th>Date</th>
  218. <th>Time</th>
  219. <th>
  220. Event
  221. </th>
  222. <th>
  223. <a href="" title="Add an event"><i class="icon-g-plus"></i></a>
  224. </th>
  225. </tr>
  226. </thead>
  227. % for event in current_node.getEvents():
  228. <tr title="Last updated: ${event.updated_at}">
  229. <td>${event.getFormattedDate(event.data_datetime)}</td>
  230. <td>${event.getFormattedTime(event.data_datetime)}</td>
  231. <td>${event.data_label}</td>
  232. </tr>
  233. % endfor
  234. </table>
  235. % endif
  236. </div>
  237. <div class="tab-pane" id="contacts">
  238. % for contact in current_node.getContacts():
  239. <div class="well">
  240. <legend class="text-info">${contact.data_label}</legend>
  241. <div>${contact.data_content|n}</div>
  242. </div>
  243. % endfor
  244. </div>
  245. <div class="tab-pane" id="comments">${current_node.data_content|n}</div>
  246. <div class="tab-pane" id="files">Files</div>
  247. </div>
  248. </div>
  249. </div>
  250. </div>