template.xml 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <openerp>
  3. <data>
  4. <!-- Different homepage for website 127.0.0.1 /!\ key should be the same as other homepage -->
  5. <record id="website_ip_homepage_template" model="ir.ui.view">
  6. <field name="name">Homepage (127.0.0.1)</field>
  7. <field name="type">qweb</field>
  8. <field name="page" eval="True" />
  9. <field name="website_id" ref="website_ip" />
  10. <field name="key">website.homepage</field>
  11. <field name="arch" type="xml">
  12. <t name="Homepage" priority="29" t-name="website.homepage">
  13. <t t-call="website.layout">
  14. <div id="wrap" class="oe_structure oe_empty">
  15. <section class="oe_dark mt16 mb16">
  16. <div class="container">
  17. <div class="row">
  18. <div class="col-md-12 text-center mt32 mb32">
  19. <h2>Website 127.0.0.1 is so cool</h2>
  20. </div>
  21. <div class="col-md-12">
  22. <img class="img img-responsive" src="/website/static/src/img/big_picture.png" style="margin: 0 auto;"/>
  23. </div>
  24. <div class="col-md-6 col-md-offset-3 mb16 mt16">
  25. <p class="text-center">
  26. <b>A Small Subtitle</b>
  27. </p>
  28. <p class="text-center">Choose a vibrant image and write an inspiring paragraph about it. It does not have to be long, but it should reinforce your image.</p>
  29. <p class="text-center">
  30. <a href="/page/website.contactus">Contact us »</a>
  31. </p>
  32. </div>
  33. </div>
  34. </div>
  35. </section>
  36. </div>
  37. </t>
  38. </t>
  39. </field>
  40. </record>
  41. <!--new page for website 127.0.0.1 /!\ key should be the end of url specify in the menu -->
  42. <!-- key should be equal to t-name -->
  43. <record id="website_ip_other_template" model="ir.ui.view">
  44. <field name="name">New page for 127.0.0.1</field>
  45. <field name="type">qweb</field>
  46. <field name="page" eval="True" />
  47. <field name="website_id" ref="website_ip" />
  48. <field name="key">website.other-127-0-0-1-page</field>
  49. <field name="arch" type="xml">
  50. <t t-name="website.other-127-0-0-1-page">
  51. <t t-call="website.layout">
  52. <div id="wrap" class="oe_structure oe_empty"/>
  53. <div><h1>Other page on 127.0.0.1</h1></div>
  54. <div id="wrap" class="oe_structure oe_empty"/>
  55. </t>
  56. </t>
  57. </field>
  58. </record>
  59. <!--Change Layout -->
  60. <!-- Page should be False for layout template -->
  61. <record id="website_ip_layout" model="ir.ui.view">
  62. <field name="name">Main Layout for 127.0.0.1</field>
  63. <field name="type">qweb</field>
  64. <field name="page" eval="False" />
  65. <field name="website_id" ref="website_ip" />
  66. <field name="key">website.layout</field>
  67. <field name="arch" type="xml">
  68. <t name="Main layout" t-name="website.layout">&lt;!DOCTYPE html&gt;
  69. <html t-att-lang="lang and lang.replace('_', '-')" t-att-data-website-id="website.id if editable and website else None" t-att-data-editable="'1' if editable else None" t-att-data-translatable="'1' if translatable else None" t-att-data-view-xmlid="xmlid if editable else None" t-att-data-main-object="repr(main_object) if editable else None" t-att-data-oe-company-name="res_company.name">
  70. <head>
  71. <meta charset="utf-8"/>
  72. <t t-if="main_object and 'website_meta_title' in main_object and not title">
  73. <t t-set="title" t-value="main_object.website_meta_title"/>
  74. </t>
  75. <t t-if="main_object and 'name' in main_object and not title and not additional_title">
  76. <t t-set="additional_title" t-value="main_object.name"/>
  77. </t>
  78. <t t-if="not title">
  79. <t t-set="title"><t t-if="additional_title"><t t-raw="additional_title"/> | </t><t t-esc="(website or res_company).name"/></t>
  80. </t>
  81. <meta name="viewport" content="initial-scale=1"/>
  82. <meta name="description" t-att-content="main_object and 'website_meta_description' in main_object and main_object.website_meta_description or website_meta_description"/>
  83. <meta name="keywords" t-att-content="main_object and 'website_meta_keywords' in main_object and main_object.website_meta_keywords or website_meta_keywords"/>
  84. <title><t t-esc="title"/></title>
  85. <t t-set="languages" t-value="website.get_languages() if website else None"/>
  86. <t t-if="request and request.website_multilang and website">
  87. <t t-foreach="website.get_alternate_languages(request.httprequest)" t-as="lang">
  88. <link rel="alternate" t-att-hreflang="lang['hreflang']" t-att-href="lang['href']"/>
  89. </t>
  90. </t>
  91. <t t-call-assets="web.assets_common" t-js="false"/>
  92. <t t-call-assets="website.assets_frontend" t-js="false"/>
  93. <t t-raw="head or ''" name="layout_head"/>
  94. </head>
  95. <body>
  96. <div id="wrapwrap">
  97. <header>
  98. <div class="navbar navbar-default navbar-static-top">
  99. <div class="container">
  100. <div class="navbar-header">
  101. <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-top-collapse">
  102. <span class="sr-only">Toggle navigation</span>
  103. <span class="icon-bar"/>
  104. <span class="icon-bar"/>
  105. <span class="icon-bar"/>
  106. </button>
  107. <a class="navbar-brand" href="/" t-field="res_company.name"/>
  108. </div>
  109. <div class="collapse navbar-collapse navbar-top-collapse">
  110. <ul class="nav navbar-nav navbar-right" id="top_menu">
  111. <t t-foreach="website.menu_id.child_id" t-as="submenu">
  112. <t t-call="website.submenu"/>
  113. </t>
  114. <li class="divider" t-ignore="true" t-if="website.user_id != user_id"/>
  115. <li class="dropdown" t-ignore="true" t-if="website.user_id != user_id">
  116. <a href="#" class="dropdown-toggle" data-toggle="dropdown">
  117. <b>
  118. <span t-esc="user_id.name"/>
  119. <span class="caret"/>
  120. </b>
  121. </a>
  122. <ul class="dropdown-menu js_usermenu" role="menu">
  123. <li><a href="/web" role="menuitem">My Account</a></li>
  124. <li class="divider"/>
  125. <li><a t-attf-href="/web/session/logout?redirect=/" role="menuitem">Logout</a></li>
  126. </ul>
  127. </li>
  128. </ul>
  129. </div>
  130. </div>
  131. </div>
  132. </header>
  133. <main>
  134. <t t-raw="0"/>
  135. </main>
  136. <footer>
  137. <div id="footer_container">
  138. </div>
  139. <div id="other_footer">
  140. <h2> New stuff under the footer</h2>
  141. </div>
  142. </footer>
  143. </div>
  144. <t t-call-assets="web.assets_common" t-css="false"/>
  145. <t t-call-assets="website.assets_frontend" t-css="false"/>
  146. <script t-if="website and website.google_analytics_key">
  147. (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  148. (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  149. m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  150. })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
  151. ga('create', _.str.trim('<t t-esc="website.google_analytics_key"/>'), 'auto');
  152. ga('send','pageview');
  153. </script>
  154. </body>
  155. </html>
  156. </t>
  157. </field>
  158. </record>
  159. <!--Add footer, since we change the layout, we lost all the inherited view of the layout from localhost -->
  160. <record id="website_ip_footer" model="ir.ui.view">
  161. <field name="name">Main Layout for 127.0.0.1</field>
  162. <field name="type">qweb</field>
  163. <field name="page" eval="False" />
  164. <field name="website_id" ref="website_ip" />
  165. <field name="key">website.footer</field>
  166. <field name="inherit_id" ref="website_ip_layout" />
  167. <field name="arch" type="xml">
  168. <data inherit_id="website.layout" name="Footer">
  169. <xpath expr="//div[@id='footer_container']" position="replace">
  170. <div class="oe_structure" id="footer">
  171. <section data-snippet-id="three-columns">
  172. <div class="container">
  173. <div class="row">
  174. <div class="col-md-4">
  175. <h4 class="mt16">Subtitle</h4>
  176. <p>
  177. <a href="/">Homepage</a>
  178. </p>
  179. </div>
  180. <div class="col-md-4">
  181. <h4 class="mt16">Some Stuff for 127.0.0.1</h4>
  182. <p>
  183. ...
  184. </p>
  185. </div>
  186. <div class="col-md-4">
  187. <h4 class="mt16">Contact editor of 127.0.0.1</h4>
  188. <p>
  189. ...
  190. </p>
  191. </div>
  192. </div>
  193. </div>
  194. </section>
  195. </div>
  196. </xpath>
  197. </data>
  198. </field>
  199. </record>
  200. </data>
  201. </openerp>