document-widgets.mak 7.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  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>
  6. <a href="${tg.url('/api/set_parent_node?node_id=%i&new_parent_id=0'%(current_node.node_id))}">
  7. <i class="fa fa-file-text-o"></i> ${_('Home')}
  8. </a>
  9. ${node_treeview_for_set_parent_menu(node_id, node_list, 0)}
  10. </li>
  11. % else:
  12. % if len(node_list)>0:
  13. <ul style="list-style: none;">
  14. % for new_parent_node in node_list:
  15. <li>
  16. <a href="${tg.url('/api/set_parent_node?node_id=%i&new_parent_id=%i'%(node_id, new_parent_node.node_id))}"><i class="fa fa-file-text-o"></i> ${new_parent_node.getTruncatedLabel(40-indentation*2)}
  17. </a>
  18. ${node_treeview_for_set_parent_menu(node_id, new_parent_node.getStaticChildList(), indentation+1)}
  19. </li>
  20. % endfor
  21. </ul>
  22. % endif
  23. % endif
  24. </%def>
  25. <%def name="Toolbar(poNode, plNodeStatusList, plRootNodes, psDivId)">
  26. <div id="${psDivId}">
  27. <div class="btn-group">
  28. % if poNode.parent_id!=None and poNode.parent_id!=0:
  29. ${POD.EditButton('current-document-content-edit-button', True)}
  30. % endif
  31. <button class="btn btn-small" data-toggle="dropdown" href="#">
  32. <i class="fa fa-signal"></i>
  33. ${_("Change status")}
  34. </button>
  35. <a class="btn btn-small dropdown-toggle" data-toggle="dropdown" href="#">
  36. <span class="caret"></span>
  37. </a>
  38. <ul class="dropdown-menu">
  39. % for node_status in plNodeStatusList:
  40. % if node_status.status_id==poNode.getStatus().status_id:
  41. <li title="${h.getExplanationAboutStatus(node_status.status_id, current_node.getStatus().status_id)}">
  42. <a class="${node_status.css}" href="#" style="color: #999;">
  43. <i class="${node_status.icon_id}"></i> ${node_status.label}
  44. </a>
  45. </li>
  46. % else:
  47. <li title="${h.getExplanationAboutStatus(node_status.status_id, current_node.getStatus().status_id)}">
  48. <a class="${node_status.css}" href="${tg.url('/api/edit_status?node_id=%i&node_status=%s'%(current_node.node_id, node_status.status_id))}">
  49. <i class="${node_status.icon_id}"></i> ${node_status.label}
  50. </a>
  51. </li>
  52. % endif
  53. % endfor
  54. </ul>
  55. </div>
  56. <div class="btn-group">
  57. <button class="btn btn-small btn-success" data-toggle="dropdown" href="#">
  58. <i class="fa fa-plus"></i> ${_('Add')}
  59. </button>
  60. <a class="btn btn-small dropdown-toggle" data-toggle="dropdown" href="#"><span class="caret"></span></a>
  61. <ul class="dropdown-menu">
  62. <li>
  63. <div class="btn-success strong" ><strong><i class="fa fa-magic"></i> Add New...</strong><br/></div>
  64. <div class="pod-grey"><i>create a totally new item...</i></div>
  65. </li>
  66. <li><a><i class="fa fa-file-text-o"></i> Document</a></li>
  67. <li><a><i class="fa fa-paperclip"></i> File</a></li>
  68. <li><a><i class="fa fa-calendar"></i> Event</a></li>
  69. <li><a><i class="fa fa-user"></i> Contact</a></li>
  70. <li><a><i class="fa fa-comments-o"></i> Comment</a></li>
  71. <li class="divider" role="presentation"></li>
  72. <li>
  73. <div class="btn-warning strong" ><strong><i class="fa fa-link"></i> Add Existing...</strong><br/></div>
  74. <div class="pod-grey"><i>link to an existing item...</i></div>
  75. </li>
  76. <li><a><i class="fa fa-file-text-o"></i> Document</a></li>
  77. <li><a><i class="fa fa-paperclip"></i> File</a></li>
  78. <li><a><i class="fa fa-calendar"></i> Event</a></li>
  79. <li><a><i class="fa fa-user"></i> Contact</a></li>
  80. <li><a><i class="fa fa-comments-o"></i> Comment</a></li>
  81. </ul>
  82. </div>
  83. <div class="btn-group ">
  84. <a
  85. class="btn btn-small btn-warning"
  86. href="#"
  87. data-toggle="dropdown"
  88. title="${_('Move to')}"
  89. ><i class="fa fa-arrows"></i></a>
  90. <ul class="dropdown-menu">
  91. <li >
  92. <div class="btn-warning strong" ><strong><i class="fa fa-magic"></i> ${_("Move the document...")}</strong><br/></div>
  93. <div class="pod-grey"><i>move the document to...</i></div>
  94. </li>
  95. ${node_treeview_for_set_parent_menu(poNode.node_id, plRootNodes)}
  96. </ul>
  97. <a
  98. class="btn btn-small btn-danger"
  99. href='${tg.url('/api/edit_status?node_id=%i&node_status=%s'%(poNode.node_id, 'deleted'))}'
  100. id='current-document-force-delete-button' onclick="return confirm('${_('Delete current document?')}');"
  101. title="${_('Delete')}"
  102. ><i class="fa fa-trash-o"></i></a>
  103. </div>
  104. </div>
  105. </%def>
  106. <%def name="BreadCrumb(poNode)">
  107. <ul class="breadcrumb span12">
  108. <li>
  109. <span class="divider"> / Documents /</span>
  110. </li>
  111. % for breadcrumb_node in poNode.getBreadCrumbNodes():
  112. <li>
  113. <a href="${tg.url('/document/%s'%(breadcrumb_node.node_id))}">${breadcrumb_node.getTruncatedLabel(30)}</a>
  114. <span class="divider">/</span>
  115. </li>
  116. % endfor
  117. <li class="active">${poNode.data_label}</li>
  118. </ul>
  119. </%def>
  120. <%def name="EditForm(poNode)">
  121. <form
  122. style="display: none;"
  123. id="current-document-content-edit-form"
  124. method="post"
  125. action="${tg.url('/api/edit_label_and_content')}"
  126. >
  127. <div>
  128. ${POD.CancelButton('current-document-content-edit-cancel-button-top', True)}
  129. ${POD.SaveButton('current-document-content-edit-save-button-top', True)}
  130. </div>
  131. <div style="padding: 0.5em 0 0 0">
  132. <input type="hidden" name="node_id" value="${current_node.node_id}"/>
  133. <input type="hidden" name="data_content" id="current_node_textarea" />
  134. <input
  135. type="text"
  136. name="data_label"
  137. value="${current_node.data_label}"
  138. class="span4"
  139. placeholder="${_('document title')}"
  140. />
  141. </div>
  142. <div>
  143. ${POD.RichTextEditor('current_node_textarea_wysiwyg', current_node.data_content)}
  144. </div>
  145. <div class="pull-right">
  146. ${POD.CancelButton('current-document-content-edit-cancel-button', True)}
  147. ${POD.SaveButton('current-document-content-edit-save-button', True)}
  148. </div>
  149. </form>
  150. </%def>
  151. <%def name="ShowContent(poNode, psKeywords)">
  152. <div>
  153. % if len(psKeywords)>0 and psKeywords!='':
  154. ${poNode.getContentWithHighlightedKeywords(psKeywords.split(), poNode.getContentWithTags())|n}
  155. % else:
  156. ${poNode.getContentWithTags()|n}
  157. % endif
  158. </div>
  159. </%def>
  160. <%def name="ShowTitle(poNode, psKeywords, psId)">
  161. <h3 id="${psId}" title="Document ${poNode.node_id}: ${poNode.data_label}">
  162. ${poNode.data_label}
  163. <sup class="label ${poNode.getStatus().css}" href="#">
  164. ${poNode.getStatus().label}
  165. </sup>
  166. </h3>
  167. </%def>
  168. #######
  169. ##
  170. ## METADATA TAB FUNCTIONS
  171. ##
  172. <%def name="MetadataTab(psAnchorName, psDataToggleName, psTitle, psFontAwesomeIconClass, plItems)">
  173. <a
  174. href="${psAnchorName}"
  175. data-toggle="${psDataToggleName}"
  176. title="${psTitle}"
  177. >
  178. <i class="pod-dark-grey fa ${psFontAwesomeIconClass}"></i>
  179. ${POD.ItemNb(plItems)}
  180. </a>
  181. </%def>