[IMP] website: move hearder and footer in layout

bzr revid: chm@openerp.com-20130812093255-3cbehw7nx0h57qca
This commit is contained in:
Christophe Matthieu 2013-08-12 11:32:55 +02:00
parent 2abdcf99bc
commit 3f86396b4e
5 changed files with 99 additions and 149 deletions

View File

@ -3,19 +3,6 @@
-->
<openerp>
<data>
<template id="header">
<div class="container">
<a href='/page/website.homepage' class='brand'>
<em>Open</em><b>ERP</b>
<!--<img t-att-alt="res_company.name" src='/web/binary/company_logo'/></a>-->
</a>
<ul class="nav pull-right" id="top_menu">
<li><a href="/page/website.contactus">Contact us</a></li>
<li><a href="/admin">Sign in</a></li>
</ul>
</div>
</template>
<!--
Files used in the generic theme, mostly bootstrap and a few OpenERP tags
-->
@ -31,62 +18,6 @@
</xpath>
</template>
<template id="footer" name="Footer">
<div class="container" id="footer_container">
<div class="row">
<div class="span3" name="product">
<h5>Our products</h5>
<ul class='unstyled' name="products">
<li><a href="/">Home</a></li>
</ul>
</div>
<div class="span3" name="info">
<h5 name="info_title">Connect with us</h5>
<ul class='unstyled'>
<li><a href="/page/website.aboutus">About us</a></li>
<li><a href="/page/website.contactus">Contact us</a></li>
</ul>
<ul class='unstyled'>
<li><i class="icon-phone"></i> <span t-field="res_company.phone"/></li>
<li><i class="icon-envelope"></i> <span t-field="res_company.email"></span></li>
</ul>
</div>
<div class="span5 offset1" name="about_us">
<h5 t-field="res_company.name">About us</h5>
<p>
We are a team of passionated people whose goal
is to improve everyone's life through
disruptive products. We build great products to
solve your business problems.
</p><p>
Our products are designed for small to medium
companies willing to optimize their
performance.
</p>
<h1 style="padding: 12px 24px">
<a href="http://twitter.com/openerp"><i class="icon-twitter-sign"></i></a>
<a href="http://facebook.com/OpenERP"><i class="icon-facebook-sign"></i></a>
<a href="https://plus.google.com/+openerp/posts"><i class="icon-google-plus-sign"></i></a>
</h1>
</div>
</div>
</div>
<div class="container mt16">
<div class="pull-right" t-ignore="1">
Create a <a href="http://openerp.com/apps/website">free website</a> with <a class="label label-important" href="https://openerp.com/apps/website">OpenERP</a>
</div>
<div class="pull-left muted">
Copyright &amp;copy; <span t-field="res_company.name">Company name</span> - <a href="/sitemap">Sitemap</a>
</div>
</div>
</template>
<template id="footer_custom" inherit_option_id="website.footer" name="Custom Footer">
<xpath expr="//div[@id='footer_container']" position="attributes">
<attribute name="style">display: none</attribute>
</xpath>
</template>
<template id="layout">
&lt;!DOCTYPE html&gt;
<html>
@ -115,7 +46,16 @@
<body>
<header class='navbar navbar-static-top'>
<div class='navbar-inner'>
<t t-call="website.header"/>
<div class="container">
<a href='/page/website.homepage' class='brand'>
<em>Open</em><b>ERP</b>
<!--<img t-att-alt="res_company.name" src='/web/binary/company_logo'/></a>-->
</a>
<ul class="nav pull-right" id="top_menu">
<li><a href="/page/website.contactus">Contact us</a></li>
<li><a href="/admin">Sign in</a></li>
</ul>
</div>
</div>
</header>
<div t-raw="0" id="wrap">
@ -124,7 +64,53 @@
</div>
</div>
<footer>
<t t-call="website.footer"/>
<div class="container" id="footer_container">
<div class="row">
<div class="span3" name="product">
<h5>Our products</h5>
<ul class='unstyled' name="products">
<li><a href="/">Home</a></li>
</ul>
</div>
<div class="span3" name="info">
<h5 name="info_title">Connect with us</h5>
<ul class='unstyled'>
<li><a href="/page/website.aboutus">About us</a></li>
<li><a href="/page/website.contactus">Contact us</a></li>
</ul>
<ul class='unstyled'>
<li><i class="icon-phone"></i> <span t-field="res_company.phone"/></li>
<li><i class="icon-envelope"></i> <span t-field="res_company.email"></span></li>
</ul>
</div>
<div class="span5 offset1" name="about_us">
<h5 t-field="res_company.name">About us</h5>
<p>
We are a team of passionated people whose goal
is to improve everyone's life through
disruptive products. We build great products to
solve your business problems.
</p><p>
Our products are designed for small to medium
companies willing to optimize their
performance.
</p>
<h1 style="padding: 12px 24px">
<a href="http://twitter.com/openerp"><i class="icon-twitter-sign"></i></a>
<a href="http://facebook.com/OpenERP"><i class="icon-facebook-sign"></i></a>
<a href="https://plus.google.com/+openerp/posts"><i class="icon-google-plus-sign"></i></a>
</h1>
</div>
</div>
</div>
<div class="container mt16">
<div class="pull-right" t-ignore="1">
Create a <a href="http://openerp.com/apps/website">free website</a> with <a class="label label-important" href="https://openerp.com/apps/website">OpenERP</a>
</div>
<div class="pull-left muted">
Copyright &amp;copy; <span t-field="res_company.name">Company name</span> - <a href="/sitemap">Sitemap</a>
</div>
</div>
</footer>
<div class='oe_snippet_editor' style="display: none;">
@ -232,6 +218,12 @@
</html>
</template>
<template id="footer_custom" inherit_option_id="website.layout" name="Custom Footer">
<xpath expr="body/footer//div[@id='footer_container']" position="attributes">
<attribute name="style">display: none</attribute>
</xpath>
</template>
<template id="homepage">
<t t-call="website.layout">

View File

@ -4,28 +4,14 @@
<!-- Layout add nav and footer -->
<record id="header_website_event" model="ir.ui.view">
<field name="name">header_website_event</field>
<field name="inherit_id" ref="website.header"/>
<field name="arch" type="xml">
<data>
<xpath expr="//ul[@id='top_menu']/li" position="after">
<li><a href="/event">Events</a></li>
</xpath>
</data>
</field>
</record>
<record id="footer_website_event" model="ir.ui.view">
<field name="name">footer_website_event</field>
<field name="inherit_id" ref="website.footer"/>
<field name="arch" type="xml">
<data>
<xpath expr="//a[@href='/page/website.contactus']" position="after">
<li><a href="/event">Events</a></li>
</xpath>
</data>
</field>
</record>
<template id="footer_custom" inherit_id="website.layout" name="Custom Footer">
<xpath expr="//body/header//ul[@id='top_menu']/li[last()]" position="before">
<li><a href="/event">Events</a></li>
</xpath>
<xpath expr="//body/footer//a[@href='/page/website.contactus']" position="after">
<li><a href="/event">Events</a></li>
</xpath>
</template>
<!-- Page -->

View File

@ -12,17 +12,11 @@
<!-- Layout add nav and footer -->
<record id="footer_website_hr" model="ir.ui.view">
<field name="name">footer_website_hr</field>
<field name="inherit_id" ref="website.footer"/>
<field name="arch" type="xml">
<data>
<xpath expr="//a[@href='/page/website.aboutus']" position="after">
<li><a href="/blog/%(website_hr.website_mail_job)d/">Jobs</a></li>
</xpath>
</data>
</field>
</record>
<template id="footer_custom" inherit_id="website.layout" name="Custom Footer">
<xpath expr="//body/footer//a[@href='/page/website.aboutus']" position="after">
<li><a href="/blog/%(website_hr.website_mail_job)d/">Jobs</a></li>
</xpath>
</template>
<!-- Page -->

View File

@ -12,30 +12,16 @@
<!-- Layout add nav and footer -->
<record id="header_website_mail" model="ir.ui.view">
<field name="name">header_website_mail</field>
<field name="inherit_id" ref="website.header"/>
<field name="arch" type="xml">
<data>
<xpath expr="//ul[@id='top_menu']/li" position="after">
<li><a href="/blog/%(website_mail.website_mail_blog)d/">News</a></li>
</xpath>
</data>
</field>
</record>
<record id="footer_website_mail" model="ir.ui.view">
<field name="name">footer_website_mail</field>
<field name="inherit_id" ref="website.footer"/>
<field name="arch" type="xml">
<data>
<xpath expr="//h5[@name='info_title']" position="after">
<ul class='unstyled'>
<li><a href="/blog/%(website_mail.website_mail_blog)d/">News</a></li>
</ul>
</xpath>
</data>
</field>
</record>
<template id="footer_custom" inherit_id="website.layout" name="Custom Footer">
<xpath expr="//body/header//ul[@id='top_menu']/li[last()]" position="before">
<li><a href="/blog/%(website_mail.website_mail_blog)d/">News</a></li>
</xpath>
<xpath expr="//body/footer//h5[@name='info_title']" position="after">
<ul class='unstyled'>
<li><a href="/blog/%(website_mail.website_mail_blog)d/">News</a></li>
</ul>
</xpath>
</template>
<!-- Page -->

View File

@ -15,27 +15,19 @@
<!-- Layout add nav and footer -->
<record id="header_ecommerce" model="ir.ui.view">
<field name="name">header_ecommerce</field>
<field name="inherit_id" ref="website.header"/>
<field name="arch" type="xml">
<data>
<xpath expr="//ul[@id='top_menu']/li" position="before">
<li>
<a href="/shop/">Shop</a>
</li>
<li>
<a href="/shop/mycart/">
<i class="icon-shopping-cart"></i>
My cart
<!-- FIXME: logic to obtain the shopping cart numer of items shall not be in the template. Move it in models or in controllers -->
<!-- <span class="badge badge-success" t-if="order.order_line" t-esc="int(sum([l.product_uom_qty for l in order.order_line]))"/> -->
</a>
</li>
</xpath>
</data>
</field>
</record>
<template id="footer_custom" inherit_id="website.layout" name="Custom Footer">
<xpath expr="//body/header//ul[@id='top_menu']/li" position="before">
<li><a href="/shop/">Shop</a></li>
<li>
<a href="/shop/mycart/">
<i class="icon-shopping-cart"></i>
My cart
<!-- FIXME: logic to obtain the shopping cart numer of items shall not be in the template. Move it in models or in controllers -->
<!-- <span class="badge badge-success" t-if="order.order_line" t-esc="int(sum([l.product_uom_qty for l in order.order_line]))"/> -->
</a>
</li>
</xpath>
</template>
<record id="product_normal_form_view" model="ir.ui.view">
<field name="name">product.normal.form.inherit</field>