* mass_mailing, payment, point_of_sale, portal, survey, web, web_tour, website_blog, website_crm_partner_assign, website_event, website_event_questions, website_form, website_forum, website_gengo, website_hr_recruitment, website_links, website_mail, website_mail_channel, website_mass_mailing, website_quote, website_sale, website_sale_options, website_slides, website_twitter This commit reviews the whole "JS side" of the web_editor and website apps. This is a first step to be able to improve them with new and better functionnalities; this commit is not supposed to change any visual behavior. The main goal was to achieve a structure similar to the backend one. Now, the frontend side also has a root widget (like the WebClient) and all other widgets are attached to it one way or another. This allows the benefits of using the 'trigger_up' functionnality for example. As RPC are now mainly done with the `this._rpc` functionnality (being possible thanks to the parent hierarchy), the frontend will also be possible to test thanks to QUnit in a future update (besides the "text" editor side which still requires a refactoring to be able to do that). --- Here are some of the changes: (-) conventions and documentation The code has been updated to follow JS conventions and a lot of code has been commented (around +2000 lines of comment). This also means that lots of functions have been renamed to use camelCase or simply to make their name understandable. See https://github.com/odoo/odoo/wiki/Javascript-coding-guidelines. (-) deprecated: web_editor.base The "web_editor.base" module has been split and does not force the modules which require it to wait for DOM ready anymore. This was indeed slowing loading times, but also prevented to use some modules in some contexts (see the LESS editor use in web_studio which is the subject of another task). Now the "editor context" can be got thanks to the "web_editor.context" JS module with its "get" function. The "web_editor.base" module should probably not be used anymore (see its code and recent updates). (-) new: web.dom_ready If a JS module should wait for the DOM to be ready to be executed, a new JS module has been created: "web.dom_ready". This should always be used in a module which only want to instantiate stuff. Do not extend (or worst, include) classes after DOM ready. (-) website.website The "website.website" module has been split. "website.website" does not return anything useful anymore, it just initialize some miscellaneous stuff, without waiting for the DOM to be ready. You might want to check "website.utils", "website.content.compatibility" or `WebsiteRoot`. Also `website.form` has been deleted (use `this._rpc`), so has been `website.error`. `website.prompt` will be removed in a future update to be replaced by `Dialog.prompt`. (-) widgets are great Many classes which were not widgets are now widgets. This allows them to use the 'events', the 'xmlDependencies' and the 'this._rpc' features for example. Here are some of the main ones: - Snippet options: these were classes with a `$el` for the menu element and `$target` for the customized element. This is still the case but following standard `Widget` structure (one exception: using `this.$(...)` searches in the `$target` as before this update). - Snippet animations: instead of class instances with a `$target` element which can be `start` and `stop`, these are now standard widgets which can be `start` and `destroy`. `this.$target` is an alias to `this.$el` for ease of compatibility. - Snippet editors: instead of class instances in charge of an editor overlay, these are now widgets. Each "child" snippet editor is properly attached as a "child", which allows editors to communicate and to be properly destroyed. (-) root widgets and website navbar The frontend is different of the backend. In the backend, the page has an empty <body/> element and all the components are instantiated from parent to children (i.e. the `WebClient` is instantiated and is in charge of instantiating the `ControlPanel`, etc). The frontend cannot work like that on page loadings as they are way more frequent than in the backend and we do not want them to flicker. A frontend page is loaded as a <body/> element which already contains the website navbar and its menus and the whole content page. JS code has to be "attached" to these existing elements. This is possible thanks to the `RootWidget` instances and the specialized `WebsiteRoot`, `IframeRoot` and `WebsiteNavbar` (see code for details). (-) lazy loading No more (or at least a lot less) XML/JS has to be loaded on page loading, thanks to the use of the `Widget.xmlDependencies` feature. XML which have to be lazy loaded is loaded only on related Widget instantiation if necessary, which allows to execute a lot of JS code before the DOM is ready and to start many widgets on DOM ready (not later). A visual benefit of this is clicking on the 'edit' button as soon as it is possible: before this commit, this was sometimes not doing anything as event handlers were not binded yet. Still a possible exception: loading the session and locales. This may be asynchronous stuff which is still required before widget instantiations but this will be the subject of another task. (-) deprecated code and code location More than reviewing code and organizing it, many apparent dead code was removed. More importantly, mislocated code was put in the right app. This is the case for snippet animations which is a concept for website apps but was defined in the web_editor app, or some translation concepts which were part of website but should have been part of web_editor. --- There are probably more things to say about this commit but I will let the comments speak for those.
911 lines
44 KiB
XML
911 lines
44 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
||
<odoo>
|
||
<!-- Assets -->
|
||
<template id="assets_backend" inherit_id="web.assets_backend" name="Website Backend Assets (used in backend interface)">
|
||
<xpath expr="//link[last()]" position="after">
|
||
<link rel="stylesheet" href="/website/static/src/less/website.backendDashboard.less"/>
|
||
</xpath>
|
||
<xpath expr="//script[last()]" position="after">
|
||
<script type="text/javascript" src="/website/static/src/js/backend/button.js"/>
|
||
<script type="text/javascript" src="/website/static/src/js/backend/dashboard.js"/>
|
||
<script type="text/javascript" src="/website/static/src/js/tours/rte.js"/>
|
||
</xpath>
|
||
</template>
|
||
|
||
<template id="qunit_suite" inherit_id="web.qunit_suite">
|
||
<xpath expr="//script[last()]" position="after">
|
||
<script type="text/javascript" src="/website/static/tests/website_tests.js"/>
|
||
</xpath>
|
||
</template>
|
||
|
||
<template id="assets_frontend" inherit_id="web.assets_frontend" name="Website Assets">
|
||
<xpath expr="//link[last()]" position="after">
|
||
<link rel="stylesheet" type="text/less" href="/website/static/src/less/website.ui.components.less"/>
|
||
<link rel="stylesheet" type="text/less" href="/website/static/src/less/website.snippets.less"/>
|
||
<link rel="stylesheet" type="text/less" href="/website/static/src/less/website.zoomodoo.less"/>
|
||
</xpath>
|
||
<xpath expr="//script[last()]" position="after">
|
||
<script type="text/javascript" src="/website/static/src/js/utils.js"/>
|
||
<script type="text/javascript" src="/website/static/src/js/website.js"/>
|
||
|
||
<script type="text/javascript" src="/website/static/src/js/content/compatibility.js"/>
|
||
<script type="text/javascript" src="/website/static/src/js/content/lazy_template_call.js"/>
|
||
<script type="text/javascript" src="/website/static/src/js/content/snippets.animation.js"/>
|
||
<script type="text/javascript" src="/website/static/src/js/content/website_root.js"/>
|
||
<script type="text/javascript" src="/website/static/src/js/content/zoomodoo.js"/>
|
||
|
||
<script type="text/javascript" src="/website/static/src/js/menu/navbar.js"/>
|
||
</xpath>
|
||
</template>
|
||
|
||
<template id="website.assets_editor" name="Website Editor Assets (used in website editor)">
|
||
<t t-call="web.less_helpers"/>
|
||
|
||
<link rel="stylesheet" type="text/less" href="/website/static/src/less/website.edit_mode.less"/>
|
||
|
||
<script type="text/javascript" src="/website/static/lib/jQuery.transfo.js"/>
|
||
|
||
<script type="text/javascript" src="/website/static/src/js/editor/editor.js"/>
|
||
<script type="text/javascript" src="/website/static/src/js/editor/rte.summernote.js"/>
|
||
<script type="text/javascript" src="/website/static/src/js/editor/snippets.options.js"/>
|
||
|
||
<script type="text/javascript" src="/website/static/src/js/menu/content.js"/>
|
||
<script type="text/javascript" src="/website/static/src/js/menu/customize.js"/>
|
||
<script type="text/javascript" src="/website/static/src/js/menu/edit.js"/>
|
||
<script type="text/javascript" src="/website/static/src/js/menu/mobile_view.js"/>
|
||
<script type="text/javascript" src="/website/static/src/js/menu/new_content.js"/>
|
||
<script type="text/javascript" src="/website/static/src/js/menu/planner.js"/>
|
||
<script type="text/javascript" src="/website/static/src/js/menu/seo.js"/>
|
||
<script type="text/javascript" src="/website/static/src/js/menu/translate.js"/>
|
||
|
||
<script type="text/javascript" src="/website/static/src/js/tours/banner.js"/>
|
||
<script type="text/javascript" src="/website/static/src/js/tours/rte.js"/>
|
||
|
||
<script type="text/javascript" src="/website/static/src/js/widgets/ace.js"/>
|
||
<script type="text/javascript" src="/website/static/src/js/widgets/theme.js"/>
|
||
</template>
|
||
|
||
<!-- Layout -->
|
||
<template id="submenu" name="Submenu">
|
||
<li t-if="not submenu.child_id" t-att-class="
|
||
'active' if submenu.url and submenu.url != '/' and unslug_url(request.httprequest.path) == unslug_url(submenu.url.replace('/page/website.', '/page/')) else None
|
||
">
|
||
<a t-att-href="(website.menu_id.child_id[0] == submenu) and '/' or submenu.url" t-ignore="true" t-att-target="'_blank' if submenu.new_window else None">
|
||
<span t-field="submenu.name"/>
|
||
</a>
|
||
</li>
|
||
<li t-if="submenu.child_id" t-attf-class="dropdown #{
|
||
(submenu.url and submenu.url != '/' and any([request.httprequest.path == child.url.replace('/page/website.', '/page/') for child in submenu.child_id if child.url]) or
|
||
(submenu.url and request.httprequest.path == submenu.url.replace('/page/website.', '/page/'))) and 'active'
|
||
}">
|
||
<a class="dropdown-toggle" data-toggle="dropdown" href="#">
|
||
<span t-field="submenu.name"/> <span class="caret" t-ignore="true"></span>
|
||
</a>
|
||
<ul class="dropdown-menu" role="menu">
|
||
<t t-foreach="submenu.child_id" t-as="submenu">
|
||
<t t-call="website.submenu"/>
|
||
</t>
|
||
</ul>
|
||
</li>
|
||
</template>
|
||
|
||
<template id="layout" name="Main layout" inherit_id="portal.frontend_layout">
|
||
<xpath expr="//t[@t-set='head_website']" position="before">
|
||
<t t-set="html_data" t-value="{
|
||
'lang': lang and lang.replace('_', '-'),
|
||
'data-website-id': website.id if website else None,
|
||
'data-editable': '1' if editable else None,
|
||
'data-translatable': '1' if translatable else None,
|
||
'data-edit_translations': '1' if edit_translations else None,
|
||
'data-view-xmlid': xmlid if editable or translatable else None,
|
||
'data-main-object': repr(main_object) if editable or translatable else None,
|
||
'data-oe-company-name': res_company.name
|
||
}"/>
|
||
<t t-if="not title">
|
||
<t t-if="not additional_title and main_object and 'name' in main_object">
|
||
<t t-set="additional_title" t-value="main_object.name"/>
|
||
</t>
|
||
<t t-if="main_object and 'website_meta_title' in main_object and main_object.website_meta_title">
|
||
<t t-set="title" t-value="main_object.website_meta_title"/>
|
||
</t>
|
||
<t t-else="">
|
||
<t t-set="title"><t t-if="additional_title"><t t-raw="additional_title"/> | </t><t t-raw="(website or res_company).name"/></t>
|
||
</t>
|
||
</t>
|
||
<t t-set="x_icon" t-value="'/web/image/website/%s/favicon/' % website.id"/>
|
||
</xpath>
|
||
<xpath expr="//t[@t-set='head_website']" position="replace">
|
||
<t t-set="head_website">
|
||
<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"/>
|
||
<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"/>
|
||
<meta name="generator" content="Odoo"/>
|
||
|
||
<!-- OpenGraph tags for Facebook sharing -->
|
||
<meta property="og:title" t-att-content="additional_title" />
|
||
<meta property="og:site_name" t-att-content="res_company.name" />
|
||
<t t-if="main_object and 'plain_content' in main_object and main_object.plain_content">
|
||
<t t-set="og_description" t-value="main_object.plain_content[0:500]"/>
|
||
<meta property="og:description" t-att-content="og_description" />
|
||
<meta property='og:image' t-att-content="request.httprequest.url_root+'logo.png'"/>
|
||
<meta property='og:url' t-att-content="request.httprequest.url_root+request.httprequest.path[1:end]"/>
|
||
</t>
|
||
|
||
<t t-set="languages" t-value="website.get_languages() if website else None"/>
|
||
<t t-if="request and request.is_frontend_multilang and website">
|
||
<t t-foreach="website.get_alternate_languages(request.httprequest)" t-as="lg">
|
||
<link rel="alternate" t-att-hreflang="lg['hreflang']" t-att-href="lg['href']"/>
|
||
</t>
|
||
</t>
|
||
|
||
<script type="text/javascript">
|
||
<t groups="website.group_website_publisher">
|
||
odoo.snippetsURL = '/website/snippets';
|
||
</t>
|
||
|
||
odoo.session_info = {
|
||
is_superuser: <t t-esc="json.dumps(request.env.user._is_superuser())"/>,
|
||
is_system: <t t-esc="json.dumps(request.env.user._is_system())"/>,
|
||
is_frontend: true,
|
||
translationURL: '/website/translations',
|
||
is_website_user: <t t-esc="json.dumps(request.env.user.id == request.website.user_id.id)" />,
|
||
user_id: <t t-esc="json.dumps(request.env.user.id)" />
|
||
};
|
||
</script>
|
||
|
||
<t t-call-assets="web.assets_common" t-js="false"/>
|
||
<t t-call-assets="web.assets_frontend" t-js="false"/>
|
||
<t t-call-assets="web_editor.summernote" t-js="false" groups="website.group_website_publisher"/>
|
||
<t t-call-assets="web_editor.assets_editor" t-js="false" groups="website.group_website_publisher"/>
|
||
<t t-call-assets="website.assets_editor" t-js="false" groups="website.group_website_publisher"/>
|
||
|
||
<t t-call-assets="web.assets_common" t-css="false"/>
|
||
<t t-call-assets="web.assets_frontend" t-css="false"/>
|
||
<t t-call-assets="web_editor.summernote" t-css="false" groups="website.group_website_publisher"/>
|
||
<t t-call-assets="web_editor.assets_editor" t-css="false" groups="website.group_website_publisher"/>
|
||
<t t-call-assets="website.assets_editor" t-css="false" groups="website.group_website_publisher"/>
|
||
</t>
|
||
</xpath>
|
||
<xpath expr="//header//div[hasclass('navbar-header')]" position="replace">
|
||
<div class="navbar-header">
|
||
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-top-collapse">
|
||
<span class="sr-only">Toggle navigation</span>
|
||
<span class="icon-bar"></span>
|
||
<span class="icon-bar"></span>
|
||
<span class="icon-bar"></span>
|
||
</button>
|
||
<a class="navbar-brand" href="/" t-if="website" t-field="website.name">My Website</a>
|
||
</div>
|
||
</xpath>
|
||
<xpath expr="//header//ul[@id='top_menu']/li[hasclass('divider')]" position="attributes">
|
||
<attribute name="t-if">website.user_id != user_id</attribute>
|
||
</xpath>
|
||
<xpath expr="//header//ul[@id='top_menu']/li[hasclass('dropdown')]" position="attributes">
|
||
<attribute name="t-if">website.user_id != user_id</attribute>
|
||
</xpath>
|
||
<xpath expr="//header//ul[@id='top_menu']/li[hasclass('divider')]" position="before">
|
||
<t t-foreach="website.menu_id.child_id" t-as="submenu">
|
||
<t t-call="website.submenu"/>
|
||
</t>
|
||
</xpath>
|
||
<xpath expr="//div[@id='wrapwrap']" position="after">
|
||
<script id='tracking_code' t-if="website and website.google_analytics_key and not editable">
|
||
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
||
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
||
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
||
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
|
||
|
||
ga('create', _.str.trim('<t t-esc="website.google_analytics_key"/>'), 'auto');
|
||
ga('send','pageview');
|
||
</script>
|
||
</xpath>
|
||
</template>
|
||
|
||
<template id="layout_footer_copyright" inherit_id="website.layout" name="Footer Copyright">
|
||
<xpath expr="//footer" position="inside">
|
||
<div class="container mt16 mb8">
|
||
<div class="pull-right" t-ignore="true" t-if="not editable">
|
||
Create a <a target="_blank" href="http://www.odoo.com/page/website-builder">free website</a> with
|
||
<a target="_blank" class="label label-danger" href="http://www.odoo.com/page/website-builder">Odoo</a>
|
||
</div>
|
||
<div class="pull-left text-muted" itemscope="itemscope" itemtype="http://schema.org/Organization">
|
||
Copyright &copy; <span t-field="res_company.name" itemprop="name">Company name</span>
|
||
</div>
|
||
</div>
|
||
</xpath>
|
||
</template>
|
||
|
||
<template id="layout_logo_show" inherit_id="website.layout" customize_show="True" name="Show Logo">
|
||
<xpath expr="//header//a[hasclass('navbar-brand')]" position="replace">
|
||
<a href="/" class="navbar-brand logo">
|
||
<span t-field="res_company.logo" t-options="{'widget': 'image'}" t-att-alt="'Logo of %s' % res_company.name" t-att-title="res_company.name" />
|
||
</a>
|
||
</xpath>
|
||
</template>
|
||
|
||
<!-- Features template -->
|
||
<template id="login_layout" inherit_id="web.login_layout" name="Website Login Layout">
|
||
<xpath expr="t" position="replace">
|
||
<t t-call="website.layout">
|
||
<div class="oe_website_login_container" t-raw="0"/>
|
||
</t>
|
||
</xpath>
|
||
</template>
|
||
|
||
<template id="footer_custom" inherit_id="website.layout" name="Footer">
|
||
<xpath expr="//div[@id='footer']" position="replace">
|
||
<div class="oe_structure" id="footer" t-if='not no_footer'>
|
||
<section>
|
||
<div class="container">
|
||
<div class="row">
|
||
<div class="col-md-4">
|
||
<h4 class="mt16">Subtitle</h4>
|
||
<p>
|
||
<a href="/">Homepage</a>
|
||
</p>
|
||
</div>
|
||
<div class="col-md-4">
|
||
<h4 class="mt16">Subtitle 2</h4>
|
||
<p>
|
||
...
|
||
</p>
|
||
</div>
|
||
<div class="col-md-4">
|
||
<h4 class="mt16">Subtitle 3</h4>
|
||
<p>
|
||
...
|
||
</p>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</section>
|
||
</div>
|
||
</xpath>
|
||
</template>
|
||
|
||
<template id="language_selector">
|
||
<ul class="list-inline js_language_selector mt16" t-if="(request and request.is_frontend_multilang and len(languages) > 1) or (website and (editable or translatable))">
|
||
<li t-foreach="languages" t-as="lg">
|
||
<a
|
||
t-att-href="url_for(request.httprequest.path + '?' + keep_query(), lang=lg[0])"
|
||
t-att-data-default-lang="(editable or translatable) and 'true' if website and lg[0] == website.default_lang_code else None"
|
||
t-att-data-lang="lg[0]"
|
||
class="js_change_lang"
|
||
>
|
||
<t t-esc="lg[1].split('/').pop()"/>
|
||
</a>
|
||
</li>
|
||
<li groups="website.group_website_publisher">
|
||
<t t-set="url_return" t-value="url_for('', '[lang]') + '?' + keep_query()"/>
|
||
<a t-attf-href="/web#action=base.action_view_base_language_install&website_id=#{website.id if website else ''}&url_return=#{url_return}">
|
||
<i class="fa fa-plus-circle"/>
|
||
Add a language...
|
||
</a>
|
||
</li>
|
||
</ul>
|
||
</template>
|
||
|
||
<template id="footer_default" inherit_id="website.footer_custom" customize_show="True" name="Automatic Footer">
|
||
<xpath expr="//div[@id='footer']" position="replace" >
|
||
<div id="footer" class="container hidden-print" t-if='not no_footer'>
|
||
<div class="row">
|
||
<div class="col-md-4 col-lg-3">
|
||
<h4>Our Products & Services</h4>
|
||
<ul class="list-unstyled" id="products">
|
||
<li><a href="/">Home</a></li>
|
||
</ul>
|
||
</div>
|
||
<div class="col-md-4 col-lg-3" id="info">
|
||
<h4>Connect with us</h4>
|
||
<ul class="list-unstyled">
|
||
<li><a href="/page/website.contactus">Contact us</a></li>
|
||
</ul>
|
||
<ul class="list-unstyled">
|
||
<li t-ignore="true"><i class="fa fa-phone"></i> <span t-field="res_company.phone"></span></li>
|
||
<li t-ignore="true"><i class="fa fa-envelope"></i> <span t-field="res_company.email"></span></li>
|
||
</ul>
|
||
<h2>
|
||
<a t-att-href="website.social_facebook" t-if="website.social_facebook"><i class="fa fa-facebook-square"/></a>
|
||
<a t-att-href="website.social_twitter" t-if="website.social_twitter"><i class="fa fa-twitter"/></a>
|
||
<a t-att-href="website.social_linkedin" t-if="website.social_linkedin"><i class="fa fa-linkedin"/></a>
|
||
<a t-att-href="website.social_youtube" t-if="website.social_youtube"><i class="fa fa-youtube-play"/></a>
|
||
<a t-att-href="website.social_googleplus" t-if="website.social_googleplus" rel="publisher"><i class="fa fa-google-plus-square"/></a>
|
||
<a t-att-href="website.social_github" t-if="website.social_github"><i class="fa fa-github"/></a>
|
||
</h2>
|
||
</div>
|
||
<div class="col-md-4 col-lg-5 col-lg-offset-1">
|
||
<h4>
|
||
<span t-field="res_company.name" />
|
||
<small> - <a href="/page/website.aboutus">About us</a></small>
|
||
</h4>
|
||
<div>
|
||
<p>
|
||
We are a team of passionate 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 size companies willing to optimize
|
||
their performance.
|
||
</p>
|
||
</div>
|
||
<t t-call="website.language_selector"/>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</xpath>
|
||
</template>
|
||
|
||
<!-- Util template -->
|
||
<template id="publish_management">
|
||
<div groups="website.group_website_publisher" t-ignore="true" class="pull-right css_editable_mode_hidden" t-att-style="style or None">
|
||
<div t-attf-class="btn-group #{btn_class} js_publish_management #{object.website_published and 'css_published' or 'css_unpublished'}" t-att-data-id="object.id" t-att-data-object="object._name" t-att-data-controller="publish_controller">
|
||
<button class="btn btn-danger js_publish_btn">Unpublished</button>
|
||
<button class="btn btn-success js_publish_btn">Published</button>
|
||
<button type="button" t-attf-class="btn btn-default dropdown-toggle" t-att-id="'dopprod-%s' % object.id" data-toggle="dropdown">
|
||
<span class="caret"></span>
|
||
</button>
|
||
<ul class="dropdown-menu" role="menu" t-att-aria-labelledby="'dopprod-%s' % object.id">
|
||
<t t-raw="0"/>
|
||
<li t-if="publish_edit">
|
||
<a t-attf-href="/web#return_label=Website&view_type=form&model=#{object._name}&id=#{object.id}&action=#{action}"
|
||
title='Edit in backend'>Edit</a>
|
||
</li>
|
||
</ul>
|
||
</div>
|
||
</div>
|
||
</template>
|
||
|
||
<template id="publish_short">
|
||
<t groups="website.group_website_publisher" t-ignore="true">
|
||
<div t-attf-class="pull-right js_publish_management #{object.website_published and 'css_published' or 'css_unpublished'}" t-att-data-id="object.id" t-att-data-object="object._name" t-att-data-controller="publish_controller">
|
||
<button class="btn btn-danger js_publish_btn">Unpublished</button>
|
||
<button class="btn btn-success js_publish_btn">Published</button>
|
||
</div>
|
||
</t>
|
||
</template>
|
||
|
||
<template id="pager" name="Pager" inherit_id="portal.pager">
|
||
</template>
|
||
|
||
<!--
|
||
Customize Themes
|
||
|
||
Use INPUT type 'checkbox' or 'radio' or use OPTION in select box
|
||
'data-xmlid' (optional) xml id of the template to add if the input is checked.
|
||
You can set a list of xml id separate by comma (all template is enable or
|
||
disable in same time)
|
||
'data-enable' (optional) to checked one or more HTML ids, or list separate by comma
|
||
'data-disable' (optional) to unchecked one or more HTML ids, or list separate by comma
|
||
'data-reload="/"' (optional) force the reloading of the page if the url match with
|
||
the string ( = regexp).
|
||
Otherwise, only the '/web/content/web.assets_frontend' is reloaded
|
||
|
||
For the sets (data-enable and/or data-disable without data-xmlid), the set is
|
||
automatically checked if:
|
||
- all related fields are enabled for data-enable
|
||
- all related fields are disabled for data-disable
|
||
else unchecked
|
||
|
||
HTML apply classes:
|
||
- 'checked': on the parent label when input is checked
|
||
- 'in': on the container (e.g.: bootstrap modal) after added in DOM (removed together
|
||
out is added)
|
||
- 'out': on the container 1 second before removed from ths DOM
|
||
- 'loading': on the container/modal when the new css is loading
|
||
-->
|
||
<template id="website.theme_customize" name="Theme Modal for Customization">
|
||
<div id="theme_customize_modal" class="modal fade">
|
||
<div class="modal-dialog">
|
||
<div class="modal-content">
|
||
<div class="modal-header text-center">
|
||
<h4 class="modal-title">Please install a theme in order to customize your website.</h4>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</template>
|
||
|
||
<template id="kanban">
|
||
<t t-set="step"><t t-esc="step or 0"/></t>
|
||
<t t-set="scope"><t t-esc="scope or 0"/></t>
|
||
<t t-set="orderby"><t t-esc="orderby or 'name'"/></t>
|
||
<t t-raw="website.kanban(model, domain, column, template, step=step, scope=scope, orderby=orderby)"/>
|
||
</template>
|
||
|
||
<template id="kanban_contain">
|
||
<table class="table js_kanban">
|
||
<thead>
|
||
<tr>
|
||
<t t-set="width" t-valuef="{{ round(100.0 / (len(objects) if objects else 1), 2) }}%"/>
|
||
<t t-foreach="objects" t-as="obj">
|
||
<th t-att-width="width">
|
||
<div t-field="obj['column_id'].name" class="text-center"></div>
|
||
</th>
|
||
</t>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<t t-foreach="objects" t-as="obj">
|
||
<td class="js_kanban_col" t-att-data-template="template"
|
||
t-att-data-domain="obj['domain']"
|
||
t-att-data-page_count="obj['page_count']"
|
||
t-att-data-model="obj['model']"
|
||
t-att-data-step="obj['step']"
|
||
t-att-data-orderby="obj['orderby']">
|
||
<t t-foreach="obj['object_ids']" t-as="object_id">
|
||
<t t-call="#{ template }"></t>
|
||
</t>
|
||
<!-- pager -->
|
||
<div t-if="1 != obj['page_end']" class="pagination pagination-centered">
|
||
<ul>
|
||
<li t-attf-class="prev #{'active' if obj['page'] == 1 else '' }">
|
||
<a t-att-href=" '%s,%s-%s' % (obj['kanban_url'], obj['column_id'].id, (obj['page'] > 1 and obj['page']-1 or 1)) ">Prev</a></li>
|
||
<t t-foreach="range(obj['page_start'], obj['page_end']+1)" t-as="p">
|
||
<li t-att-class=" 'active' if obj['page'] == p else None ">
|
||
<a t-att-href=" '%s,%s-%s' % (obj['kanban_url'], obj['column_id'].id, p)" t-esc="p"></a></li>
|
||
</t>
|
||
<li t-attf-class="next #{'active' if obj['page'] == obj['page_end'] else '' }">
|
||
<a t-att-href=" '%s,%s-%s' % (obj['kanban_url'], obj['column_id'].id, (obj['page'] < obj['page_end'] and obj['page']+1 or obj['page_end']) )">Next</a></li>
|
||
</ul>
|
||
</div>
|
||
</td>
|
||
</t>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
</template>
|
||
|
||
<!-- Error and special pages -->
|
||
<template id="website_info" name="Odoo Information">
|
||
<t t-call="website.layout">
|
||
<div id="wrap"/>
|
||
</t>
|
||
</template>
|
||
|
||
<template id="show_website_info" inherit_id="website.website_info" customize_show="True" name="Show Odoo Information">
|
||
<xpath expr="//div[@id='wrap']" position="inside">
|
||
<div class="oe_structure">
|
||
<section class="container">
|
||
<t t-if="not version">
|
||
<meta http-equiv="refresh" content="0;URL='/website/info'" />
|
||
</t>
|
||
<t t-if="version">
|
||
<h1><t t-esc="res_company.name"/>
|
||
<small>Odoo Version <t t-raw="version.get('server_version')"/></small>
|
||
</h1>
|
||
<p>
|
||
Information about the <t t-esc="res_company.name"/> instance of Odoo, the <a target="_blank" href="https://www.odoo.com">Open Source ERP</a>.
|
||
</p>
|
||
|
||
<div class="alert alert-warning alert-dismissable mt16" groups="website.group_website_publisher">
|
||
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
|
||
<p>
|
||
Note: To hide this page, uncheck it from the top Customize menu.
|
||
</p>
|
||
</div>
|
||
<h2>Installed Applications</h2>
|
||
<dl class="dl-horizontal" t-foreach="apps" t-as="app">
|
||
<dt>
|
||
<a t-att-href="app.website" t-if="app.website">
|
||
<t t-raw="app.shortdesc"/>
|
||
</a>
|
||
<span t-raw="app.shortdesc" t-if="not app.website"/>
|
||
</dt>
|
||
<dd>
|
||
<span t-raw="app.summary"/>
|
||
</dd><dd class="text-muted" groups='base.group_no_one'>
|
||
Technical name: <span t-field="app.name"/>, updated: <span t-field="app.write_date"/>, author: <span t-field="app.author"/>
|
||
</dd>
|
||
</dl>
|
||
|
||
<div groups='base.group_no_one'>
|
||
<h2>Installed Modules</h2>
|
||
<dl class="dl-horizontal">
|
||
<t t-foreach="modules" t-as="app">
|
||
<dt>
|
||
<span t-raw="app.shortdesc"/>
|
||
</dt>
|
||
<dd t-if="app.summary">
|
||
<span t-raw="app.summary"/>
|
||
</dd><dd>
|
||
Technical name: <span t-field="app.name"/>,
|
||
updated: <span t-field="app.write_date"/>
|
||
<t t-if="app.author">
|
||
, author: <span t-field="app.author"/>
|
||
</t>
|
||
</dd>
|
||
</t>
|
||
</dl>
|
||
</div>
|
||
</t>
|
||
</section>
|
||
</div>
|
||
</xpath>
|
||
</template>
|
||
|
||
<template id="default_page">
|
||
<t t-call="website.layout">
|
||
<div id="wrap" class="oe_structure oe_empty"/>
|
||
</t>
|
||
</template>
|
||
|
||
<template id="page_404">
|
||
<t t-call="website.404">
|
||
<div class="container">
|
||
<div class="well mt32">
|
||
<p>This page does not exists, but you can create it as you are administrator of this site.</p>
|
||
<a class="btn btn-primary" t-attf-href="/website/add/#{ path }#{ from_template and '?template=%s' % from_template }">Create Page</a>
|
||
</div>
|
||
<div class="text-center text-muted">Edit the content below this line to adapt the default "page not found" page.</div>
|
||
</div>
|
||
<hr/>
|
||
</t>
|
||
</template>
|
||
|
||
<template id="http_error">
|
||
<t t-call="website.layout">
|
||
<div id="wrap">
|
||
<div class="oe_structure">
|
||
<h1 class="container mt32"><t t-esc="status_code"/>: <t t-esc="status_message"/></h1>
|
||
</div>
|
||
<t t-if="editable or request.debug">
|
||
<t t-call="website.http_error_debug"/>
|
||
</t>
|
||
</div>
|
||
</t>
|
||
</template>
|
||
|
||
<template id="http_error_debug">
|
||
<div class="container panel-group mb32 mt32" id="debug_infos">
|
||
<div class="panel panel-default" t-if="exception">
|
||
<div class="panel-heading">
|
||
<h4 class="panel-title">
|
||
<a data-toggle="collapse" data-parent="#debug_infos" href="#error_main">
|
||
Error
|
||
</a>
|
||
</h4>
|
||
</div>
|
||
<div id="error_main" class="panel-collapse collapse in">
|
||
<div class="panel-body">
|
||
<p t-if="website_controller">The following error was raised in the website controller <code t-esc="website_controller"/></p>
|
||
<p>
|
||
<strong>Error message:</strong>
|
||
<pre t-esc="exception"/>
|
||
</p>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="panel panel-default" t-if="qweb_exception">
|
||
<div class="panel-heading">
|
||
<h4 class="panel-title">
|
||
<a data-toggle="collapse" data-parent="#adebug_infos" href="#error_qweb">
|
||
QWeb
|
||
</a>
|
||
</h4>
|
||
</div>
|
||
<div id="error_qweb" class="panel-collapse collapse">
|
||
<div class="panel-body">
|
||
<p t-if="exception.qweb.get('message')">
|
||
<strong>Error message:</strong>
|
||
<pre t-esc="exception.qweb.get('message')"/>
|
||
</p>
|
||
<p>
|
||
The error occured while rendering the template <code t-esc="qweb_exception.qweb.get('template')"/>
|
||
<t t-if="'expression' in qweb_exception.qweb">and evaluating the following expression: <code t-esc="qweb_exception.qweb['expression']"/></t>
|
||
</p>
|
||
<t t-if="'node' in qweb_exception.qweb">
|
||
<pre id="exception_node" t-esc="qweb_exception.pretty_xml()"/>
|
||
</t>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="panel panel-default" t-if="traceback">
|
||
<div class="panel-heading">
|
||
<h4 class="panel-title">
|
||
<a data-toggle="collapse" data-parent="#adebug_infos" href="#error_traceback">
|
||
Traceback
|
||
</a>
|
||
</h4>
|
||
</div>
|
||
<div id="error_traceback" class="panel-collapse collapse">
|
||
<div class="panel-body">
|
||
<pre id="exception_traceback" t-esc="traceback"/>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</template>
|
||
|
||
<template id="403">
|
||
<t t-call="website.layout">
|
||
<div id="wrap">
|
||
<div class="container">
|
||
<h1 class="mt32">403: Forbidden</h1>
|
||
<p>The page you were looking for could not be authorized.</p>
|
||
<p>Maybe you were looking for one of these popular pages ?</p>
|
||
<ul>
|
||
<li><a href="/">Homepage</a></li>
|
||
<li><a href="/page/website.contactus/">Contact Us</a></li>
|
||
</ul>
|
||
</div>
|
||
<t t-if="editable or request.debug">
|
||
<t t-call="website.http_error_debug"/>
|
||
</t>
|
||
</div>
|
||
</t>
|
||
</template>
|
||
|
||
<template id="404">
|
||
<t t-call="website.layout">
|
||
<div id="wrap">
|
||
<t t-raw="0"/>
|
||
<div class="oe_structure oe_empty">
|
||
<div class="container">
|
||
<h1 class="mt32">404: Page not found!</h1>
|
||
<p>
|
||
The page you were looking for could not be found; it is possible you have
|
||
typed the address incorrectly, but it has most probably been removed due
|
||
to the recent website reorganisation.
|
||
</p>
|
||
<p>Maybe you were looking for one of these popular pages ?</p>
|
||
<ul>
|
||
<li><a href="/">Homepage</a></li>
|
||
<li><a href="/page/website.contactus/">Contact Us</a></li>
|
||
</ul>
|
||
</div>
|
||
</div>
|
||
|
||
<t t-if="request.debug">
|
||
<t t-call="website.http_error_debug"/>
|
||
</t>
|
||
</div>
|
||
</t>
|
||
</template>
|
||
|
||
<template id="500">
|
||
<!-- This template should not use any variable except those provided by website.ir_http._handle_exception -->
|
||
<html>
|
||
<head>
|
||
<title t-esc="status_message">Internal Server Error</title>
|
||
<t t-set="debug" t-value="True"/>
|
||
<t t-call-assets="web.assets_common" t-js="false"/>
|
||
<t t-call-assets="web.assets_frontend" t-js="false"/>
|
||
<t t-call-assets="web.assets_common" t-css="false"/>
|
||
<t t-call-assets="web.assets_frontend" t-css="false"/>
|
||
<script>
|
||
$(document).ready(function() {
|
||
var button = $('#reset_templates_button');
|
||
button.click(function() {
|
||
var dialog = $('#reset_template_confirmation').modal('show');
|
||
var input = dialog.find('input[type="text"]').val('').focus();
|
||
var dialog_form = dialog.find('form');
|
||
dialog_form.submit(function() {
|
||
if (input.val() == dialog.find('.confirm_word').text()) {
|
||
dialog.modal('hide');
|
||
button.prop('disabled', true).text('Working...');
|
||
$('#reset_templates_form').trigger('submit');
|
||
} else {
|
||
input.val('').focus();
|
||
}
|
||
return false;
|
||
});
|
||
return false;
|
||
});
|
||
});
|
||
</script>
|
||
</head>
|
||
<body>
|
||
<div id="reset_template_confirmation" class="modal" tabindex="-1" role="dialog" aria-hidden="true" t-ignore="true">
|
||
<div class="modal-dialog">
|
||
<form class="form-horizontal" role="form">
|
||
<div class="modal-content">
|
||
<div class="modal-header">
|
||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||
<h3 class="modal-title">Reset templates</h3>
|
||
</div>
|
||
<div class="modal-body">
|
||
<div class="form-group mb0">
|
||
<label for="page-name" class="col-sm-9">
|
||
<p>The selected templates will be reset to their factory settings.</p>
|
||
<p>Type '<i class="confirm_word">yes</i>' in the box below if you want to confirm.</p>
|
||
</label>
|
||
<div class="col-sm-3 mt16">
|
||
<input type="text" class="form-control" required="required" placeholder="yes"/>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="modal-footer">
|
||
<input type="submit" value="Confirm" class="btn btn-primary"/>
|
||
<button type="button" class="btn" data-dismiss="modal" aria-hidden="true">Cancel</button>
|
||
</div>
|
||
</div>
|
||
</form>
|
||
</div>
|
||
</div>
|
||
|
||
<div id="wrapwrap">
|
||
<header>
|
||
<div class="navbar navbar-default navbar-static-top">
|
||
<div class="container">
|
||
<div class="collapse navbar-collapse navbar-top-collapse">
|
||
<ul class="nav navbar-nav navbar-right" id="top_menu">
|
||
<li><a href="/">Home</a></li>
|
||
<li><a href="javascript: window.history.back()">Back</a></li>
|
||
</ul>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</header>
|
||
<main>
|
||
<div class="oe_structure">
|
||
<h1 class="container mt32"><t t-esc="status_code"/>: <t t-esc="status_message"/></h1>
|
||
</div>
|
||
<div class="container" t-if="views">
|
||
<div class="alert alert-danger" t-if="qweb_exception and editable">
|
||
<h4>Template fallback</h4>
|
||
<p>An error occured while rendering the template <code t-esc="qweb_exception.qweb['template']"/>.</p>
|
||
<p>If this error is caused by a change of yours in the templates, you have the possibility to reset one or more templates to their <strong>factory settings</strong>.</p>
|
||
<form action="/website/reset_templates" method="post" id="reset_templates_form">
|
||
<input type="hidden" name="csrf_token" t-att-value="request.csrf_token()"/>
|
||
<ul class="oe_template_fallback">
|
||
<li t-foreach="views" t-as="view">
|
||
<label>
|
||
<input type="checkbox" name="templates" t-att-value="view.id" t-att-checked="'checked' if view_first else None"/>
|
||
<t t-esc="view.name"/>
|
||
</label>
|
||
</li>
|
||
</ul>
|
||
<input type="hidden" name="redirect" t-att-value="request.httprequest.path"/>
|
||
<button id="reset_templates_button">Reset selected templates</button>
|
||
</form>
|
||
</div>
|
||
</div>
|
||
|
||
<t t-if="editable or request.debug">
|
||
<t t-call="website.http_error_debug"/>
|
||
</t>
|
||
</main>
|
||
</div>
|
||
</body>
|
||
</html>
|
||
</template>
|
||
|
||
<template id="robots">
|
||
User-agent: *
|
||
Sitemap: <t t-esc="url_root"/>sitemap.xml
|
||
</template>
|
||
|
||
<template id="sitemap_locs">
|
||
<url t-foreach="locs" t-as="page">
|
||
<loc><t t-esc="url_root"/><t t-esc="page['loc']"/></loc><t t-if="page.get('lastmod', False)">
|
||
<lastmod t-esc="page['lastmod']"/></t><t t-if="page.get('priority', False)">
|
||
<priority t-esc="page['priority']"/></t><t t-if="page.get('changefreq', False)">
|
||
<changefreq t-esc="page['changefreq']"/></t>
|
||
</url>
|
||
</template>
|
||
|
||
<template id="sitemap_xml"><?xml version="1.0" encoding="UTF-8"?>
|
||
<urlset t-attf-xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
||
<t t-raw="content"/>
|
||
</urlset>
|
||
</template>
|
||
|
||
<template id="sitemap_index_xml"><?xml version="1.0" encoding="UTF-8"?>
|
||
<sitemapindex t-attf-xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
||
<sitemap t-translation="off" t-foreach="pages" t-as="page">
|
||
<loc><t t-esc="url_root"/>sitemap-<t t-esc="page"/>.xml</loc>
|
||
</sitemap>
|
||
</sitemapindex>
|
||
</template>
|
||
|
||
<!-- Actual pages -->
|
||
<template id="homepage" name="Homepage" page="True" priority="29">
|
||
<t t-call="website.layout">
|
||
<t t-set="pageName" t-value="'homepage'"/>
|
||
<div id="wrap" class="oe_structure oe_empty"/>
|
||
</t>
|
||
</template>
|
||
|
||
<template id="company_description" name="Company Description">
|
||
<address itemscope="itemscope" itemtype="http://schema.org/Organization">
|
||
<!-- TODO widget contact must add itemprop attributes -->
|
||
<div t-field="res_company.partner_id" t-options='{
|
||
"widget": "contact",
|
||
"fields": ["name", "address", "phone", "mobile", "email"]}'/>
|
||
<t t-if="not res_company.google_map_img()">
|
||
<span class="fa fa-map-marker fa-fw mt16"/> <a t-att-href="res_company.google_map_link()" target="_BLANK"> Google Maps</a>
|
||
</t>
|
||
</address>
|
||
<t t-if="res_company.google_map_img()">
|
||
<a t-att-href="res_company.google_map_link()" target="_BLANK">
|
||
<img class="thumbnail img-responsive" t-att-src="res_company.google_map_img()" />
|
||
</a>
|
||
</t>
|
||
</template>
|
||
|
||
<template id="contactus" name="Contact us" page="True">
|
||
<t t-call="website.layout">
|
||
<div id="wrap">
|
||
<div class="oe_structure"/>
|
||
<div class="container">
|
||
<h1>Contact us</h1>
|
||
<div class="row">
|
||
<div class="col-md-8">
|
||
<div class="oe_structure">
|
||
<div>
|
||
<p>Contact us about anything related to our company or services.</p>
|
||
<p>We'll do our best to get back to you as soon as possible.</p>
|
||
</div>
|
||
</div>
|
||
<div class="text-center mt64" name="mail_button">
|
||
<a t-attf-href="mailto:{{ res_company.email }}" class="btn btn-primary" id="o_contact_mail">Send us an email</a>
|
||
</div>
|
||
</div>
|
||
<div class="col-md-4 mb32">
|
||
<t t-call="website.company_description"/>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="oe_structure"/>
|
||
</div>
|
||
</t>
|
||
</template>
|
||
|
||
<template id="aboutus" name="About us" page="True">
|
||
<t t-call="website.layout">
|
||
<div id="wrap">
|
||
<div class="oe_structure">
|
||
|
||
<section>
|
||
<div class="container">
|
||
<div class="row">
|
||
<div class="col-md-12">
|
||
<h1 class="text-center">About us</h1>
|
||
<h3 class="text-muted text-center">Great products for great people</h3>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</section>
|
||
|
||
<section>
|
||
<div class="container">
|
||
<div class="row">
|
||
<div class="col-md-6 mt32">
|
||
<p>
|
||
We are a team of passionate 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 size companies willing to optimize
|
||
their performance.
|
||
</p>
|
||
</div>
|
||
<div class="col-md-4 col-md-offset-2 mt16 mb16">
|
||
<img src="/website/static/src/img/library/business_conference.jpg" class="img img-responsive shadow" alt="Our Team"/>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</section>
|
||
|
||
</div>
|
||
<div class="oe_structure"></div>
|
||
</div>
|
||
</t>
|
||
</template>
|
||
|
||
<template id="website_search_box" name="Website Searchbox">
|
||
<div class="input-group">
|
||
<div class="oe_search">
|
||
<input type="text" name="search" class="search-query form-control oe_search_box" placeholder="Search..." t-att-value="search" />
|
||
</div>
|
||
<span class="input-group-btn">
|
||
<button type="submit" class="btn btn-default oe_search_button"><i class="fa fa-search"/></button>
|
||
</span>
|
||
</div>
|
||
</template>
|
||
</odoo>
|