macro.tpl 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217
  1. {# Macros to generate repeated html code #}
  2. {% macro collapse(name, title, content, list = false, expanded = 'true', title_right = '', title_icons = '') %}
  3. <div class="panel-group" id="{{ name }}" role="tablist" aria-multiselectable="true">
  4. <div class="panel panel-default" id="{{ name }}_block">
  5. <div class="panel-heading" role="tab">
  6. {% if title_icons %}
  7. {{ title_icons }}
  8. {% endif %}
  9. <a role="button" data-toggle="collapse" data-parent="#{{ name }}" href="#{{ name }}Collapse"
  10. aria-expanded="{{ expanded }}" aria-controls="{{ name }}Collapse">
  11. {{ title }}
  12. </a>
  13. {% if title_right %}
  14. <div class="pull-right">
  15. {{ title_right }}
  16. </div>
  17. {% endif %}
  18. </div>
  19. <div aria-expanded="{{ expanded }}" id="{{ name }}Collapse"
  20. class="panel-collapse collapse {{ expanded == 'true' ? 'in' : '' }}" role="tabpanel">
  21. <div class="panel-body">
  22. {% if list %}
  23. <ul class="nav nav-pills nav-stacked">
  24. {{ content }}
  25. </ul>
  26. {% else %}
  27. {{ content }}
  28. {% endif %}
  29. </div>
  30. </div>
  31. </div>
  32. </div>
  33. {% endmacro %}
  34. {% macro collapseFor(name, title, array) %}
  35. <div class="panel-group" id="{{ name }}" role="tablist" aria-multiselectable="true">
  36. <div class="panel panel-default" id="{{ name }}_block">
  37. <div class="panel-heading" role="tab">
  38. <a role="button" data-toggle="collapse" data-parent="#{{ name }}" href="#{{ name }}Collapse"
  39. aria-expanded="true" aria-controls="{{ name }}Collapse">
  40. {{ title }}
  41. </a>
  42. </div>
  43. <div aria-expanded="true" id="{{ name }}Collapse" class="panel-collapse collapse in" role="tabpanel">
  44. <div class="panel-body">
  45. <ul class="nav nav-pills nav-stacked">
  46. {% for item in array %}
  47. <li>
  48. <a href="{{ item.link }}">{{ item.title }}</a>
  49. </li>
  50. {% endfor %}
  51. </ul>
  52. </div>
  53. </div>
  54. </div>
  55. </div>
  56. {% endmacro %}
  57. {% macro collapseMenu(name, title, array) %}
  58. <div class="panel-group" id="{{ name }}" role="tablist" aria-multiselectable="true">
  59. <div class="panel panel-default" id="{{ name }}_block">
  60. <div class="panel-heading" role="tab">
  61. <a role="button" data-toggle="collapse" data-parent="#{{ name }}" href="#{{ name }}Collapse"
  62. aria-expanded="true" aria-controls="{{ name }}Collapse">
  63. {{ title }}
  64. </a>
  65. </div>
  66. <div aria-expanded="true" id="{{ name }}Collapse" class="panel-collapse collapse in" role="tabpanel">
  67. <div class="panel-body">
  68. <ul class="list-group">
  69. {% for item in array %}
  70. <li class="list-group-item {{ item.class }}">
  71. <span class="item-icon">{{ item.icon }}</span>
  72. <a href="{{ item.link }}">{{ item.title }}</a>
  73. </li>
  74. {% endfor %}
  75. </ul>
  76. </div>
  77. </div>
  78. </div>
  79. </div>
  80. {% endmacro %}
  81. {% macro pluginSidebar(name, content) %}
  82. <div id="{{ name }}" class="plugin plugin_{{ name }}">
  83. {{ content }}
  84. </div>
  85. {% endmacro %}
  86. {% macro pluginPanel(name, content) %}
  87. <div id="{{ name }}" class="plugin plugin_{{ name }}">
  88. <div class="row">
  89. <div class="col-md-12">
  90. {{ content }}
  91. </div>
  92. </div>
  93. </div>
  94. {% endmacro %}
  95. {% macro panel(name, content, footer = '') %}
  96. <div class="panel panel-default">
  97. {% if name %}
  98. <div class="panel-heading"> {{ name }}</div>
  99. {% endif %}
  100. <div class="panel-body">
  101. {{ content }}
  102. </div>
  103. {% if footer %}
  104. <div class="panel-footer">{{ footer }}</div>
  105. {% endif %}
  106. </div>
  107. {% endmacro %}
  108. {% macro box_widget(name, content, icon) %}
  109. <div class="card box-widget">
  110. <div class="card-body">
  111. <div class="stat-widget-five">
  112. <i class="fa fa-{{ icon }}" aria-hidden="true"></i>
  113. {{ content }}
  114. <div class="box-name">
  115. {{ name }}
  116. </div>
  117. </div>
  118. </div>
  119. </div>
  120. {% endmacro %}
  121. {% macro card_widget(name, content, icon, extra) %}
  122. <div class="card card-first-date">
  123. <div class="card-body">
  124. <div class="stat-widget-five">
  125. <div class="stat-icon">
  126. <i class="fa fa-{{ icon }}" aria-hidden="true"></i>
  127. {% if extra %}
  128. <span class="active-icon">{{ extra }}</span>
  129. {% endif %}
  130. </div>
  131. <div class="stat-content">
  132. <div class="text-left">
  133. <div class="stat-text">
  134. {{ content }}
  135. </div>
  136. <div class="stat-heading">
  137. {{ name }}
  138. </div>
  139. </div>
  140. </div>
  141. </div>
  142. </div>
  143. </div>
  144. {% endmacro %}
  145. {% macro reporting_user_details(user) %}
  146. <div class="parameters">
  147. <dl class="dl-horizontal">
  148. {% if user.status %}
  149. <dt>{{ 'Status'|get_lang }}</dt>
  150. <dd>{{ user.status }}</dd>
  151. {% endif %}
  152. <dt>{{ 'OfficialCode'|get_lang }}</dt>
  153. <dd>{{ user.code == '' ? 'NoOfficialCode'|get_lang : user.code }}</dd>
  154. <dt>{{ 'OnLine'|get_lang }}</dt>
  155. <dd>
  156. {{ user.user_is_online }}
  157. {{ user.online }}
  158. </dd>
  159. <dt>{{ 'Tel'|get_lang }}</dt>
  160. <dd>{{ user.phone == '' ? 'NoTel'|get_lang : user.phone }}</dd>
  161. {% if user.timezone %}
  162. <dt>{{ 'Timezone'|get_lang }}</dt>
  163. <dd>{{ user.timezone }}</dd>
  164. {% endif %}
  165. </dl>
  166. {% if user.created %}
  167. <div class="create">{{ user.created }}</div>
  168. {% endif %}
  169. {% if user.url_access or user.legal.url_send %}
  170. <div class="access">
  171. {{ user.url_access }}
  172. {{ user.legal.url_send }}
  173. </div>
  174. {% endif %}
  175. </div>
  176. {% endmacro %}
  177. {% macro reporting_user_box(user) %}
  178. {% import _self as display %}
  179. <div class="user">
  180. <div class="avatar">
  181. <img width="128px" src="{{ user.avatar }}" class="img-responsive">
  182. </div>
  183. <div class="name">
  184. <h3>
  185. {% if user.complete_name_link %}
  186. {{ user.complete_name_link }}
  187. {% else %}
  188. {{ user.complete_name }}
  189. {% endif %}
  190. </h3>
  191. <p class="email">{{ user.email }}</p>
  192. </div>
  193. {{ display.reporting_user_details(user) }}
  194. </div>
  195. {% endmacro %}