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[hasclass('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[hasclass('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[hasclass('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[hasclass('oe_systray')]" position="replace" />
  173. <xpath expr="//ul[hasclass('oe_user_menu_placeholder')]" position="replace" />
  174. <xpath expr="//ul[hasclass('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">
  180. <i class="fa fa-lg fa-chevron-left"
  181. t-translation="off"
  182. aria-hidden="true"
  183. />
  184. Apps
  185. </a>
  186. </h4>
  187. </div>
  188. <div class="col-xs-6">
  189. <a class="oe_logo pull-right" t-attf-href="/web?{{ keep_query() }}">
  190. <i class="fa fa-pencil-square-o oe_logo_edit"
  191. aria-hidden="true"
  192. t-translation="off"
  193. />
  194. <img src='/web/binary/company_logo'/>
  195. </a>
  196. </div>
  197. </div>
  198. <div class="panel-body" id="appDrawerAppPanelBody">
  199. <ul class="row list-unstyled oe_application_menu_placeholder"
  200. style="display: none;">
  201. <li t-foreach="menu_data['children']" t-as="menu"
  202. class="col-xs-6 col-sm-4 col-md-3 col-lg-2 text-center mt16">
  203. <t t-call="web.menu_link">
  204. <t t-set="display_images" t-value="1" />
  205. </t>
  206. </li>
  207. <li id="menu_more_container" class="dropdown" style="display: none;">
  208. <a class="dropdown-toggle" data-toggle="dropdown">More <b class="caret"></b></a>
  209. <ul id="menu_more" class="dropdown-menu"></ul>
  210. </li>
  211. </ul>
  212. </div>
  213. </div>
  214. </xpath>
  215. </template>
  216. </odoo>