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.

252 lines
10 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 text-center"
  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 class="nav navbar-nav navbar-right">
  71. <ul class="nav navbar-nav navbar-right oe_user_menu_placeholder"
  72. style="display: none;"
  73. />
  74. <ul class="nav navbar-nav navbar-right oe_systray"
  75. style="display: none;"
  76. />
  77. </div>
  78. </div>
  79. </div>
  80. </nav>
  81. </header>
  82. </xpath>
  83. </template>
  84. <template id="menu_secondary"
  85. inherit_id="web.menu_secondary"
  86. name="App Drawer - Secondary Menu"
  87. >
  88. <xpath expr="//div[@class='o_sub_menu_content']/t" position="replace">
  89. <t t-foreach="menu_data['children']" t-as="menu">
  90. <ul class="oe_secondary_menu nav navbar-nav"
  91. t-att-data-menu-parent="menu['id']"
  92. style="display: none;"
  93. >
  94. <t t-call="web.menu_secondary_submenu" />
  95. </ul>
  96. </t>
  97. </xpath>
  98. </template>
  99. <template id="menu_secondary_submenu"
  100. inherit_id="web.menu_secondary_submenu"
  101. name="App Drawer - Secondary Submenu"
  102. >
  103. <xpath expr="//ul" position="replace">
  104. <t t-foreach="menu['children']" t-as="menu">
  105. <t t-if="menu['children']">
  106. <li t-attf-class="{{ 'dropdown-header' if submenu else '' }}">
  107. <t t-if="submenu">
  108. <t t-esc="menu['name']" />
  109. <t t-call="web.menu_secondary_submenu">
  110. <t t-set="submenu" t-value="True" />
  111. </t>
  112. </t>
  113. <t t-if="not submenu">
  114. <a class="dropdown-toggle"
  115. data-toggle="dropdown"
  116. role="button"
  117. aria-haspopup="true"
  118. aria-expanded="false"
  119. >
  120. <t t-esc="menu['name']" />
  121. <span class="caret" />
  122. </a>
  123. <ul t-if="menu['children']"
  124. t-attf-class="dropdown-menu oe_secondary_submenu dropdown-scrollable"
  125. >
  126. <t t-call="web.menu_secondary_submenu">
  127. <t t-set="submenu" t-value="True" />
  128. </t>
  129. </ul>
  130. </t>
  131. </li>
  132. </t>
  133. <t t-if="not menu['children']">
  134. <li>
  135. <t t-call="web.menu_link" />
  136. </li>
  137. </t>
  138. </t>
  139. </xpath>
  140. </template>
  141. <template id="menu_link"
  142. inherit_id="web.menu_link"
  143. name="App Drawer - Menu Link"
  144. >
  145. <xpath expr="//a" position="attributes">
  146. <attribute name="t-att-data-menu-name">menu['name']</attribute>
  147. </xpath>
  148. <xpath expr="//span[@class='oe_menu_text']" position="replace">
  149. <t t-if="display_images">
  150. <img t-attf-src="/web/image/ir.ui.menu/{{ menu['id'] }}/web_icon_data"
  151. class="app-drawer-icon-app img-rounded"
  152. t-att-alt="menu['name']"
  153. t-att-title="menu['name']"
  154. />
  155. <p class="app-drawer-title text-center">
  156. <t t-esc="menu['name']" />
  157. </p>
  158. </t>
  159. <t t-if="not display_images">
  160. <span class="oe_menu_text">
  161. <t t-esc="menu['name']" />
  162. </span>
  163. </t>
  164. </xpath>
  165. </template>
  166. <template id="menu"
  167. inherit_id="web.menu"
  168. name="App Drawer - Menu"
  169. >
  170. <xpath expr="//ul[contains(@class, 'oe_systray')]" position="replace" />
  171. <xpath expr="//ul[contains(@class, 'oe_user_menu_placeholder')]" position="replace" />
  172. <xpath expr="//ul[contains(@class, 'oe_application_menu_placeholder')]" position="replace">
  173. <div class="panel-default app-drawer-app-panel" id="appDrawerAppMenu">
  174. <div class="panel-heading" id="appDrawerAppPanelHead">
  175. <div class="col-xs-6">
  176. <h4 class="app-drawer-panel-title pull-left">
  177. <a class="app-drawer-icon-close drawer-toggle">
  178. <i class="fa fa-lg fa-chevron-left"
  179. t-translation="off"
  180. aria-hidden="true"
  181. />
  182. Apps
  183. </a>
  184. </h4>
  185. </div>
  186. <div class="col-xs-6">
  187. <a class="oe_logo pull-right" t-attf-href="/web?{{ keep_query() }}">
  188. <i class="fa fa-pencil-square-o oe_logo_edit"
  189. aria-hidden="true"
  190. t-translation="off"
  191. />
  192. <img src='/web/binary/company_logo'/>
  193. </a>
  194. </div>
  195. </div>
  196. <div class="panel-body" id="appDrawerAppPanelBody">
  197. <ul class="row list-unstyled oe_application_menu_placeholder"
  198. style="display: none;">
  199. <li t-foreach="menu_data['children']" t-as="menu"
  200. class="col-xs-6 col-sm-4 col-md-3 col-lg-2 text-center mt16">
  201. <t t-call="web.menu_link">
  202. <t t-set="display_images" t-value="1" />
  203. </t>
  204. </li>
  205. <li id="menu_more_container" class="dropdown" style="display: none;">
  206. <a class="dropdown-toggle" data-toggle="dropdown">More <b class="caret"></b></a>
  207. <ul id="menu_more" class="dropdown-menu"></ul>
  208. </li>
  209. </ul>
  210. </div>
  211. </div>
  212. </xpath>
  213. </template>
  214. </odoo>