You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

305 lines
13 KiB

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <!--
  3. Copyright 2016 LasLabs Inc.
  4. License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).
  5. -->
  6. <odoo>
  7. <template id="webclient_bootstrap"
  8. inherit_id="web.webclient_bootstrap"
  9. name="App Drawer - Web Client"
  10. >
  11. <xpath expr="//div[@class='o_sub_menu']" position="replace" />
  12. <xpath expr="//t[@t-set='head']" position="inside">
  13. <meta charset="utf-8" />
  14. <meta http-equiv="cleartype" content="on" />
  15. <meta name="MobileOptimized" content="320" />
  16. <meta name="HandheldFriendly" content="True" />
  17. <meta name="apple-mobile-web-app-capable" content="yes" />
  18. <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no" />
  19. </xpath>
  20. <xpath expr="//nav[@id='oe_main_menu_navbar']" position="replace">
  21. <t t-set="body_classname" t-value="'drawer drawer--left o_web_client'" />
  22. <header role="banner">
  23. <nav id="odooAppDrawer" class="app-drawer-nav drawer-nav" role="navigation">
  24. <t t-call="web.menu" />
  25. </nav>
  26. <nav class="navbar navbar-default main-nav"
  27. role="navigation"
  28. groups="base.group_user,base.group_portal"
  29. >
  30. <div class="container-fluid">
  31. <div class="navbar-header">
  32. <a class="drawer-toggle navbar-collapse collapse btn btn-default app-drawer-toggle"
  33. accesskey="A"
  34. >
  35. <span class="sr-only">Toggle App Drawer</span>
  36. <i class="fa fa-th fa-lg app-drawer-icon-open"
  37. t-translation="off"
  38. aria-hidden="true"
  39. />
  40. </a>
  41. <button type="button"
  42. class="app-drawer-toggle drawer-toggle pull-left navbar-toggle collapsed"
  43. >
  44. <span class="sr-only">Toggle App Drawer</span>
  45. <div class="fa fa-th fa-lg app-drawer-icon-open" />
  46. </button>
  47. <button type="button"
  48. id="odooMenuBarToggle"
  49. class="navbar-toggle collapsed pull-right"
  50. data-toggle="collapse"
  51. data-target="#odooMenuBarNav"
  52. >
  53. <span class="sr-only">Toggle Navigation</span>
  54. <i class="fa fa-bars fa-lg"
  55. t-translation="off"
  56. aria-hidden="true"
  57. />
  58. </button>
  59. </div>
  60. <div class="collapse navbar-collapse"
  61. id="odooMenuBarNav"
  62. data-parent="#odooMenuBarToggle"
  63. aria-expanded="false"
  64. >
  65. <div class="o_sub_menu"
  66. groups="base.group_user,base.group_portal"
  67. >
  68. <t t-call="web.menu_secondary" />
  69. </div>
  70. </div>
  71. </div>
  72. <div class="nav navbar-nav navbar-right navbar-systray o_menu_systray">
  73. <ul class="nav navbar-nav navbar-right navbar-systray-item oe_user_menu_placeholder"/>
  74. <ul class="nav navbar-nav navbar-right navbar-systray-item oe_systray"/>
  75. </div>
  76. </nav>
  77. </header>
  78. </xpath>
  79. </template>
  80. <template id="menu_secondary"
  81. inherit_id="web.menu_secondary"
  82. name="App Drawer - Secondary Menu"
  83. >
  84. <xpath expr="//div[@class='o_sub_menu_content']/t" position="replace">
  85. <t t-foreach="menu_data['children']" t-as="menu">
  86. <ul style="display: none"
  87. class="oe_secondary_menu nav navbar-nav"
  88. t-att-data-menu-parent="menu['id']">
  89. <li class="app-name">
  90. <span class="oe_menu_text">
  91. <t t-esc="menu['name']"/>
  92. </span>
  93. </li>
  94. <li>
  95. <t t-call="web.menu_secondary_submenu" />
  96. </li>
  97. </ul>
  98. </t>
  99. </xpath>
  100. </template>
  101. <template id="menu_secondary_submenu"
  102. inherit_id="web.menu_secondary_submenu"
  103. name="App Drawer - Secondary Submenu"
  104. >
  105. <xpath expr="//ul" position="replace">
  106. <t t-foreach="menu['children']" t-as="menu">
  107. <t t-if="menu['children']">
  108. <li t-attf-class="{{ 'dropdown-header' if submenu else '' }}">
  109. <t t-if="submenu">
  110. <t t-esc="menu['name']" />
  111. <t t-call="web.menu_secondary_submenu">
  112. <t t-set="submenu" t-value="True" />
  113. </t>
  114. </t>
  115. <t t-if="not submenu">
  116. <a class="dropdown-toggle"
  117. data-toggle="dropdown"
  118. role="button"
  119. aria-haspopup="true"
  120. aria-expanded="false"
  121. >
  122. <t t-esc="menu['name']" />
  123. <span class="caret" />
  124. </a>
  125. <ul t-if="menu['children']"
  126. t-attf-class="dropdown-menu oe_secondary_submenu dropdown-scrollable"
  127. >
  128. <t t-call="web.menu_secondary_submenu">
  129. <t t-set="submenu" t-value="True" />
  130. </t>
  131. </ul>
  132. </t>
  133. </li>
  134. </t>
  135. <t t-if="not menu['children']">
  136. <li>
  137. <t t-call="web.menu_link" />
  138. </li>
  139. </t>
  140. </t>
  141. </xpath>
  142. </template>
  143. <template id="menu_link"
  144. inherit_id="web.menu_link"
  145. name="App Drawer - Menu Link"
  146. >
  147. <xpath expr="//a" position="attributes">
  148. <attribute name="t-att-data-menu-name">menu['name']</attribute>
  149. </xpath>
  150. <xpath expr="//span[@class='oe_menu_text']" position="replace">
  151. <t t-if="display_images">
  152. <img t-attf-src="/web/image/ir.ui.menu/{{ menu['id'] }}/web_icon_data"
  153. class="app-drawer-icon-app img-rounded"
  154. t-att-alt="menu['name']"
  155. t-att-title="menu['name']"
  156. />
  157. <p class="app-drawer-title text-center">
  158. <t t-esc="menu['name']" />
  159. </p>
  160. </t>
  161. <t t-if="not display_images">
  162. <span class="oe_menu_text">
  163. <t t-esc="menu['name']" />
  164. </span>
  165. </t>
  166. </xpath>
  167. </template>
  168. <template id="menu"
  169. inherit_id="web.menu"
  170. name="App Drawer - Menu"
  171. >
  172. <xpath expr="//ul[contains(@class, 'oe_systray')]" position="replace" />
  173. <xpath expr="//ul[contains(@class, 'oe_user_menu_placeholder')]" position="replace" />
  174. <xpath expr="//ul[contains(@class, 'oe_application_menu_placeholder')]" position="replace">
  175. <div class="panel-default app-drawer-app-panel" id="appDrawerAppMenu">
  176. <div class="panel-heading" id="appDrawerAppPanelHead">
  177. <div class="col-xs-6">
  178. <h4 class="app-drawer-panel-title pull-left">
  179. <a class="app-drawer-icon-close drawer-toggle hidden-xs">
  180. <i class="fa fa-lg fa-chevron-left"
  181. t-translation="off"
  182. aria-hidden="true"
  183. />
  184. Apps
  185. </a>
  186. <span class="hidden-xs">
  187. &amp;nbsp;|&amp;nbsp;
  188. </span>
  189. <a class="app-drawer-icon-search drawer-search-open">
  190. <i class="fa fa-lg fa-search"
  191. t-translation="off"
  192. aria-hidden="true"
  193. />
  194. </a>
  195. <a class="app-drawer-icon-search drawer-search-close">
  196. <i class="fa fa-lg fa-close"
  197. t-translation="off"
  198. aria-hidden="true"
  199. />
  200. </a>
  201. </h4>
  202. </div>
  203. <div class="col-xs-6">
  204. <a class="oe_logo pull-right" t-attf-href="/web?{{ keep_query() }}">
  205. <i class="fa fa-pencil-square-o oe_logo_edit"
  206. aria-hidden="true"
  207. t-translation="off"
  208. />
  209. <img src='/web/binary/company_logo'/>
  210. </a>
  211. </div>
  212. </div>
  213. <div class="panel-body" id="appDrawerAppPanelBody">
  214. <div id="appDrawerApps"
  215. class="row oe_application_menu_placeholder"
  216. style="display: none;">
  217. <t t-foreach="menu_data['children']" t-as="menu">
  218. <div class="col-xs-6 col-sm-4 col-md-3 col-lg-2 text-center mt16">
  219. <t t-call="web.menu_link">
  220. <t t-set="display_images" t-value="1" />
  221. </t>
  222. </div>
  223. <!-- Provide breakpoints on necessary viewports for proper row heights -->
  224. <t t-if="(menu_index + 1) % 6 == 0">
  225. <div class="clearfix visible-lg-block" />
  226. </t>
  227. <t t-if="(menu_index + 1) % 4 == 0">
  228. <div class="clearfix visible-md-block" />
  229. </t>
  230. <t t-if="(menu_index + 1) % 3 == 0">
  231. <div class="clearfix visible-sm-block" />
  232. </t>
  233. <t t-if="(menu_index + 1) % 2 == 0">
  234. <div class="clearfix visible-xs-block" />
  235. </t>
  236. </t>
  237. <div id="menu_more_container" class="dropdown" style="display: none;">
  238. <a class="dropdown-toggle" data-toggle="dropdown">More <b class="caret"></b></a>
  239. <ul id="menu_more" class="dropdown-menu"></ul>
  240. </div>
  241. </div>
  242. <ul id="appDrawerMenuSearch"
  243. class="row list-unstyled"
  244. style="display: none;">
  245. <div class="panel panel-info app-drawer-search-panel">
  246. <div class="panel-heading">
  247. <h2>
  248. <i>Searching:</i>
  249. <input id="appDrawerSearchInput" class="menu-search-query"/>
  250. </h2>
  251. </div>
  252. <div class="panel-body">
  253. <ul id="appDrawerSearchResults"
  254. class="row list-unstyled oe_application_menu_placeholder">
  255. No Search Supplied.
  256. </ul>
  257. </div>
  258. </div>
  259. </ul>
  260. </div>
  261. </div>
  262. <div class="app-drawer-search-action" />
  263. </xpath>
  264. </template>
  265. </odoo>