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.

253 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='oe_leftbar']" 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, height=device-height, 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" groups="base.group_user,base.group_portal">
  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. >
  29. <div class="container-fluid">
  30. <div class="navbar-header">
  31. <a class="drawer-toggle navbar-collapse collapse btn btn-default app-drawer-toggle"
  32. accesskey="A"
  33. >
  34. <span class="sr-only">Toggle App Drawer</span>
  35. <i class="fa fa-th fa-lg app-drawer-icon-open"
  36. t-translation="off"
  37. aria-hidden="true"
  38. />
  39. </a>
  40. <button type="button"
  41. class="app-drawer-toggle drawer-toggle pull-left navbar-toggle collapsed"
  42. >
  43. <span class="sr-only">Toggle App Drawer</span>
  44. <div class="fa fa-th fa-lg app-drawer-icon-open" />
  45. </button>
  46. <button type="button"
  47. id="odooMenuBarToggle"
  48. class="navbar-toggle collapsed pull-right"
  49. data-toggle="collapse"
  50. data-target="#odooMenuBarNav"
  51. >
  52. <span class="sr-only">Toggle Navigation</span>
  53. <i class="fa fa-bars fa-lg"
  54. t-translation="off"
  55. aria-hidden="true"
  56. />
  57. </button>
  58. </div>
  59. <div class="collapse navbar-collapse"
  60. id="odooMenuBarNav"
  61. data-parent="#odooMenuBarToggle"
  62. aria-expanded="false"
  63. >
  64. <div class="oe_leftbar"
  65. groups="base.group_user,base.group_portal"
  66. >
  67. <t t-call="web.menu_secondary" />
  68. </div>
  69. </div>
  70. </div>
  71. <div class="nav navbar-nav navbar-right navbar-systray o_menu_systray">
  72. <ul class="nav navbar-nav navbar-right navbar-systray-item oe_user_menu_placeholder"/>
  73. <ul class="nav navbar-nav navbar-right navbar-systray-item oe_systray"/>
  74. </div>
  75. </nav>
  76. </header>
  77. </xpath>
  78. </template>
  79. <template id="menu_secondary"
  80. inherit_id="web.menu_secondary"
  81. name="App Drawer - Secondary Menu"
  82. >
  83. <xpath expr="//div[@class='oe_secondary_menus_container']/t" position="replace">
  84. <t t-foreach="menu_data['children']" t-as="menu">
  85. <ul style="display: none"
  86. class="oe_secondary_menu nav navbar-nav"
  87. t-att-data-menu-parent="menu['id']">
  88. <li class="app-name">
  89. <span class="oe_menu_text">
  90. <t t-esc="menu['name']"/>
  91. </span>
  92. </li>
  93. <li>
  94. <t t-call="web.menu_secondary_submenu" />
  95. </li>
  96. </ul>
  97. </t>
  98. </xpath>
  99. </template>
  100. <template id="menu_secondary_submenu"
  101. inherit_id="web.menu_secondary_submenu"
  102. name="App Drawer - Secondary Submenu"
  103. >
  104. <xpath expr="//ul" position="replace">
  105. <t t-foreach="menu['children']" t-as="menu">
  106. <t t-if="menu['children']">
  107. <li t-attf-class="{{ 'dropdown-header' if submenu else '' }}">
  108. <t t-if="submenu">
  109. <t t-esc="menu['name']" />
  110. <t t-call="web.menu_secondary_submenu">
  111. <t t-set="submenu" t-value="True" />
  112. </t>
  113. </t>
  114. <t t-if="not submenu">
  115. <a class="dropdown-toggle"
  116. data-toggle="dropdown"
  117. role="button"
  118. aria-haspopup="true"
  119. aria-expanded="false"
  120. >
  121. <t t-esc="menu['name']" />
  122. <span class="caret" />
  123. </a>
  124. <ul t-if="menu['children']"
  125. t-attf-class="dropdown-menu oe_secondary_submenu dropdown-scrollable"
  126. >
  127. <t t-call="web.menu_secondary_submenu">
  128. <t t-set="submenu" t-value="True" />
  129. </t>
  130. </ul>
  131. </t>
  132. </li>
  133. </t>
  134. <t t-if="not menu['children']">
  135. <li>
  136. <t t-call="web.menu_link" />
  137. </li>
  138. </t>
  139. </t>
  140. </xpath>
  141. </template>
  142. <template id="menu_link"
  143. inherit_id="web.menu_link"
  144. name="App Drawer - Menu Link"
  145. >
  146. <xpath expr="//a" position="attributes">
  147. <attribute name="t-att-data-menu-name">menu['name']</attribute>
  148. </xpath>
  149. <xpath expr="//span[@class='oe_menu_text']" position="replace">
  150. <t t-if="display_images">
  151. <img t-attf-src="/web/image/ir.ui.menu/{{ menu['id'] }}/web_icon_data"
  152. class="app-drawer-icon-app img-rounded"
  153. t-att-alt="menu['name']"
  154. t-att-title="menu['name']"
  155. />
  156. <p class="app-drawer-title text-center">
  157. <t t-esc="menu['name']" />
  158. </p>
  159. </t>
  160. <t t-if="not display_images">
  161. <span class="oe_menu_text">
  162. <t t-esc="menu['name']" />
  163. </span>
  164. </t>
  165. </xpath>
  166. </template>
  167. <template id="menu"
  168. inherit_id="web.menu"
  169. name="App Drawer - Menu"
  170. >
  171. <xpath expr="//ul[contains(@class, 'oe_systray')]" position="replace" />
  172. <xpath expr="//ul[contains(@class, 'oe_user_menu_placeholder')]" position="replace" />
  173. <xpath expr="//ul[contains(@class, 'oe_application_menu_placeholder')]" position="replace">
  174. <div class="panel-default app-drawer-app-panel" id="appDrawerAppMenu">
  175. <div class="panel-heading" id="appDrawerAppPanelHead">
  176. <div class="col-xs-6">
  177. <h4 class="app-drawer-panel-title pull-left">
  178. <a class="app-drawer-icon-close drawer-toggle">
  179. <i class="fa fa-lg fa-chevron-left"
  180. t-translation="off"
  181. aria-hidden="true"
  182. />
  183. Apps
  184. </a>
  185. </h4>
  186. </div>
  187. <div class="col-xs-6">
  188. <a class="oe_logo pull-right" t-attf-href="/web?{{ keep_query() }}">
  189. <i class="fa fa-pencil-square-o oe_logo_edit"
  190. aria-hidden="true"
  191. t-translation="off"
  192. />
  193. <img src='/web/binary/company_logo'/>
  194. </a>
  195. </div>
  196. </div>
  197. <div class="panel-body" id="appDrawerAppPanelBody">
  198. <ul class="row list-unstyled oe_application_menu_placeholder"
  199. style="display: none;">
  200. <li t-foreach="menu_data['children']" t-as="menu"
  201. class="col-xs-6 col-sm-4 col-md-3 col-lg-2 text-center mt16">
  202. <t t-call="web.menu_link">
  203. <t t-set="display_images" t-value="1" />
  204. </t>
  205. </li>
  206. <li id="menu_more_container" class="dropdown" style="display: none;">
  207. <a class="dropdown-toggle" data-toggle="dropdown">More <b class="caret"></b></a>
  208. <ul id="menu_more" class="dropdown-menu"></ul>
  209. </li>
  210. </ul>
  211. </div>
  212. </div>
  213. </xpath>
  214. </template>
  215. </odoo>