- Repo for opensource odoo website theme (since V13.0)
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.

226 lines
13 KiB

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <odoo>
  3. <template id="header_1" inherit_id="website.layout" active="True" name="Header 1">
  4. <xpath expr="//header" position="before">
  5. <div class="top-bar-main">
  6. <div class="top-bar bg-dark py-1" id="top-bar"
  7. t-if="res_company.city or res_company.zip or res_company.country_id or website.social_facebook or website.social_linkedin or website.social_youtube or website.social_github or website.social_instagram">
  8. <div class="container">
  9. <div class="row align-items-center">
  10. <div class="col-lg-6 col-md-6">
  11. <div class="top-bar-left text-white"
  12. t-if="res_company.city or res_company.zip or res_company.country_id">
  13. <i class="fa fa-map-marker"></i>
  14. <span class="ml-2" t-field="res_company.city"/>
  15. <span t-field="res_company.country_id"/>
  16. <span t-field="res_company.zip"/>
  17. </div>
  18. </div>
  19. <div class="col-lg-4 ml-lg-auto col-md-6">
  20. <ul class="d-flex list-unstyled header-socials float-lg-right">
  21. <li t-if="website.social_facebook">
  22. <a t-att-href="website.social_facebook">
  23. <span class="fab fa-facebook-f"/>
  24. </a>
  25. </li>
  26. <li t-if="website.social_twitter">
  27. <a t-att-href="website.social_twitter">
  28. <span class="fab fa-twitter"/>
  29. </a>
  30. </li>
  31. <li t-if="website.social_linkedin">
  32. <a t-att-href="website.social_linkedin">
  33. <span class="fab fa-linkedin"/>
  34. </a>
  35. </li>
  36. <li t-if="website.social_youtube">
  37. <a t-att-href="website.social_youtube">
  38. <span class="fab fa-youtube"/>
  39. </a>
  40. </li>
  41. <li t-if="website.social_github">
  42. <a t-att-href="website.social_github">
  43. <span class="fab fa-github"/>
  44. </a>
  45. </li>
  46. <li t-if="website.social_instagram">
  47. <a t-att-href="website.social_instagram">
  48. <span class="fab fa-instagram"/>
  49. </a>
  50. </li>
  51. </ul>
  52. </div>
  53. </div>
  54. </div>
  55. </div>
  56. <div class="logo-bar d-none d-md-block d-lg-block bg-light">
  57. <div class="container">
  58. <div class="row">
  59. <div class="col-lg-2">
  60. <div class="logo d-none d-lg-block">
  61. <t t-set="logo_show"
  62. t-value="request.website.viewref('website.option_header_off_canvas_logo_show').active"/>
  63. <t t-if="logo_show">
  64. <a href="/" class="navbar-brand logo">
  65. <span t-field="website.logo" t-options="{'widget': 'image'}" role="img"
  66. t-att-aria-label="'Logo of %s' % website.name"
  67. t-att-title="website.name"/>
  68. </a>
  69. </t>
  70. <t t-else="">
  71. <a class="navbar-brand" href="/" t-if="website" t-field="website.name">My
  72. Website
  73. </a>
  74. </t>
  75. </div>
  76. </div>
  77. <div class="col-lg-8 justify-content-lg-end ml-lg-auto d-flex col-12 col-md-12 justify-content-center ">
  78. <div class="top-info-block d-inline-flex" t-if="res_company.phone">
  79. <div class="icon-block">
  80. <i class="ti-mobile"></i>
  81. </div>
  82. <div class="info-block">
  83. <h5 class="font-weight-500" t-field="res_company.phone"></h5>
  84. <p>Call Free</p>
  85. </div>
  86. </div>
  87. <div class="top-info-block d-inline-flex" t-if="res_company.email">
  88. <div class="icon-block">
  89. <i class="ti-email"></i>
  90. </div>
  91. <div class="info-block">
  92. <h5 class="font-weight-500" t-field="res_company.email"></h5>
  93. <p>Email Us</p>
  94. </div>
  95. </div>
  96. <!-- <div class="top-info-block d-inline-flex">
  97. <div class="icon-block">
  98. <i class="ti-time"></i>
  99. </div>
  100. <div class="info-block">
  101. <h5 class="font-weight-500">Mon-Sat 9:00-12.00 </h5>
  102. <p>Sunday Closed</p>
  103. </div>
  104. </div> -->
  105. </div>
  106. </div>
  107. </div>
  108. </div>
  109. </div>
  110. </xpath>
  111. <xpath expr="//header//nav" position="replace">
  112. <nav data-name="Navbar"
  113. class="navbar navbar-expand-lg navbar-dark bg-primary header-main-nav container rounded-radius">
  114. <div id="top_menu_container" class="container justify-content-start justify-content-lg-between">
  115. <div id="top_menu_collapse" class="collapse navbar-collapse order-last order-lg-0">
  116. <ul id="top_menu" t-attf-class="nav navbar-nav mr-auto text-left">
  117. <t t-foreach="website.menu_id.child_id" t-as="submenu">
  118. <t t-call="website.submenu">
  119. <t t-set="item_class" t-value="'nav-item'"/>
  120. <t t-set="link_class" t-value="'nav-link'"/>
  121. </t>
  122. </t>
  123. <t t-set="website_sale_order" t-value="website.sale_get_order()"/>
  124. <li t-att-class="'nav-item' if website_sale_order and website_sale_order.cart_quantity else 'hidden'">
  125. <a class="nav-link" href="/shop/cart">
  126. <i class="fa fa-shopping-cart"></i>
  127. My cart
  128. <sup t-attf-class="my_cart_quantity badge badge-primary"
  129. t-esc="website_sale_order and website_sale_order.cart_quantity or ''"/>
  130. </a>
  131. </li>
  132. </ul>
  133. </div>
  134. <t t-call="website.placeholder_header_language_selector">
  135. <t t-set="_div_classes" t-value="'ml-2'"/>
  136. </t>
  137. </div>
  138. </nav>
  139. </xpath>
  140. <xpath expr="//div[@id='top_menu_collapse']" position="after">
  141. <div class="t-header-account d-none d-lg-block">
  142. <div class="dropdown" t-ignore="true" t-if="not user_id._is_public()">
  143. <a href="#" class="dropdown-toggle btn btn-white btn-circled" data-toggle="dropdown">
  144. <b>
  145. <span t-esc="user_id.name[:23] + '...' if user_id.name and len(user_id.name) &gt; 25 else user_id.name"/>
  146. </b>
  147. </a>
  148. <div class="dropdown-menu dropdown-menu-right js_usermenu" role="menu">
  149. <a href="/my/home" role="menuitem" class="dropdown-item">My
  150. Account
  151. </a>
  152. <a id="o_logout" class="dropdown-item" t-attf-href="/web/session/logout?redirect=/"
  153. role="menuitem">Logout
  154. </a>
  155. </div>
  156. </div>
  157. <div groups="base.group_public" class="t-login"
  158. t-if="request.website.viewref('portal.user_sign_in').active">
  159. <a t-attf-href="/web/login" class="btn btn btn-white btn-circled">
  160. <b>Log In</b>
  161. </a>
  162. </div>
  163. </div>
  164. </xpath>
  165. </template>
  166. <template id="header_2" inherit_id="website.layout" active="False" name="Header 2">
  167. <xpath expr="//header//nav" position="replace">
  168. <nav data-name="Navbar" class="navbar navbar-expand-lg navbar-dark header-main-nav bg-dark"
  169. style="margin-top:0px;">
  170. <div id="top_menu_container" class="container justify-content-start justify-content-lg-between">
  171. <!-- Brand -->
  172. <a href="/" t-attf-class="navbar-brand logo #{_link_class}" style="display:block !important;">
  173. <span t-field="website.logo" t-options="{'widget': 'image'}" role="img"
  174. t-att-aria-label="'Logo of %s' % website.name" t-att-title="website.name"/>
  175. </a>
  176. <!-- Navbar Toggler -->
  177. <t t-call="website.navbar_toggler">
  178. <t t-set="_toggler_class" t-value="'ml-auto'"/>
  179. </t>
  180. <!-- Navbar Collapse -->
  181. <div id="top_menu_collapse" class="collapse navbar-collapse order-last order-lg-0">
  182. <ul id="top_menu" t-attf-class="nav navbar-nav ml-auto text-lg-right text-left">
  183. <t t-foreach="website.menu_id.child_id" t-as="submenu">
  184. <t t-call="website.submenu">
  185. <t t-set="item_class" t-value="'nav-item'"/>
  186. <t t-set="link_class" t-value="'nav-link'"/>
  187. </t>
  188. </t>
  189. <t t-set="website_sale_order" t-value="website.sale_get_order()"/>
  190. <li t-att-class="'nav-item' if website_sale_order and website_sale_order.cart_quantity else 'hidden'">
  191. <a class="nav-link" href="/shop/cart">
  192. <i class="fa fa-shopping-cart"></i>
  193. My cart
  194. <sup t-attf-class="my_cart_quantity badge badge-primary"
  195. t-esc="website_sale_order and website_sale_order.cart_quantity or ''"/>
  196. </a>
  197. </li>
  198. <t t-call="portal.placeholder_user_sign_in">
  199. <t t-set="_item_class" t-value="'nav-item ml-lg-auto'"/>
  200. <t t-set="_link_class" t-value="'nav-link font-weight-bold'"/>
  201. </t>
  202. <t t-call="portal.user_dropdown">
  203. <t t-set="_user_name" t-value="true"/>
  204. <t t-set="_item_class" t-value="'nav-item dropdown ml-lg-auto'"/>
  205. <t t-set="_link_class" t-value="'nav-link font-weight-bold'"/>
  206. </t>
  207. </ul>
  208. </div>
  209. <t t-call="website.placeholder_header_language_selector">
  210. <t t-set="_div_classes" t-value="'ml-2'"/>
  211. </t>
  212. <div class="oe_structure" id="oe_structure_header_default_1"/>
  213. </div>
  214. </nav>
  215. </xpath>
  216. </template>
  217. </odoo>