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.

259 lines
10 KiB

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