Merge pull request #814 from odoo-dev/master-report-translation-fix-sle
Master report translation fix sle
This commit is contained in:
commit
839a70511c
|
@ -10,22 +10,22 @@
|
||||||
<div class="row mt32 mb32">
|
<div class="row mt32 mb32">
|
||||||
<div class="col-xs-3">
|
<div class="col-xs-3">
|
||||||
<strong>Chart of Tax:</strong>
|
<strong>Chart of Tax:</strong>
|
||||||
<p t-esc="account"/>
|
<p t-esc="get_account(data)"/>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-xs-3" t-if="fiscalyear">
|
<div class="col-xs-3">
|
||||||
<strong>Fiscal Year:</strong>
|
<strong>Fiscal Year:</strong>
|
||||||
<p t-esc="fiscalyear"/>
|
<p t-esc="get_fiscalyear(data)"/>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-xs-3" t-if="period_from and period_to">
|
<div class="col-xs-3">
|
||||||
<strong>Periods:</strong>
|
<strong>Periods:</strong>
|
||||||
<p>
|
<p>
|
||||||
Start Period: <span t-esc="period_from"/><br/>
|
Start Period: <span t-esc="get_start_period(data)"/><br/>
|
||||||
End Period: <span t-esc="period_to"/>
|
End Period: <span t-esc="get_end_period(data)"/>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-xs-3">
|
<div class="col-xs-3">
|
||||||
<strong>Based On:</strong>
|
<strong>Based On:</strong>
|
||||||
<p t-esc="based_on"/>
|
<p t-esc="get_basedon(data)"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -50,7 +50,12 @@ class ReportController(Controller):
|
||||||
if data.get('options'):
|
if data.get('options'):
|
||||||
options_data = simplejson.loads(data['options'])
|
options_data = simplejson.loads(data['options'])
|
||||||
if data.get('context'):
|
if data.get('context'):
|
||||||
context.update(simplejson.loads(data['context']))
|
# Ignore 'lang' here, because the context in data is the one from the webclient *but* if
|
||||||
|
# the user explicitely wants to change the lang, this mechanism overwrites it.
|
||||||
|
data_context = simplejson.loads(data['context'])
|
||||||
|
if data_context.get('lang'):
|
||||||
|
del data_context['lang']
|
||||||
|
context.update(data_context)
|
||||||
|
|
||||||
if converter == 'html':
|
if converter == 'html':
|
||||||
html = report_obj.get_html(cr, uid, docids, reportname, data=options_data, context=context)
|
html = report_obj.get_html(cr, uid, docids, reportname, data=options_data, context=context)
|
||||||
|
|
|
@ -34,10 +34,8 @@ import lxml.html
|
||||||
import cStringIO
|
import cStringIO
|
||||||
import subprocess
|
import subprocess
|
||||||
from distutils.version import LooseVersion
|
from distutils.version import LooseVersion
|
||||||
try:
|
from functools import partial
|
||||||
from pyPdf import PdfFileWriter, PdfFileReader
|
from pyPdf import PdfFileWriter, PdfFileReader
|
||||||
except ImportError:
|
|
||||||
PdfFileWriter = PdfFileReader = None
|
|
||||||
|
|
||||||
|
|
||||||
_logger = logging.getLogger(__name__)
|
_logger = logging.getLogger(__name__)
|
||||||
|
@ -71,23 +69,6 @@ class Report(osv.Model):
|
||||||
|
|
||||||
public_user = None
|
public_user = None
|
||||||
|
|
||||||
MINIMAL_HTML_PAGE = """
|
|
||||||
<base href="{base_url}">
|
|
||||||
<!DOCTYPE html>
|
|
||||||
<html style="height: 0;">
|
|
||||||
<head>
|
|
||||||
<link href="/report/static/src/css/reset.min.css" rel="stylesheet"/>
|
|
||||||
<link href="/web/static/lib/bootstrap/css/bootstrap.css" rel="stylesheet"/>
|
|
||||||
<link href="/website/static/src/css/website.css" rel="stylesheet"/>
|
|
||||||
<link href="/web/static/lib/fontawesome/css/font-awesome.css" rel="stylesheet"/>
|
|
||||||
<style type='text/css'>{css}</style>
|
|
||||||
{subst}
|
|
||||||
</head>
|
|
||||||
<body class="container" onload="subst()">
|
|
||||||
{body}
|
|
||||||
</body>
|
|
||||||
</html>"""
|
|
||||||
|
|
||||||
#--------------------------------------------------------------------------
|
#--------------------------------------------------------------------------
|
||||||
# Extension of ir_ui_view.render with arguments frequently used in reports
|
# Extension of ir_ui_view.render with arguments frequently used in reports
|
||||||
#--------------------------------------------------------------------------
|
#--------------------------------------------------------------------------
|
||||||
|
@ -133,7 +114,9 @@ class Report(osv.Model):
|
||||||
user = self.pool['res.users'].browse(cr, uid, uid)
|
user = self.pool['res.users'].browse(cr, uid, uid)
|
||||||
website = None
|
website = None
|
||||||
if request and hasattr(request, 'website'):
|
if request and hasattr(request, 'website'):
|
||||||
website = request.website
|
if request.website is not None:
|
||||||
|
website = request.website
|
||||||
|
context.update(translatable=context.get('lang') != request.website.default_lang_code)
|
||||||
values.update(
|
values.update(
|
||||||
time=time,
|
time=time,
|
||||||
translate_doc=translate_doc,
|
translate_doc=translate_doc,
|
||||||
|
@ -141,7 +124,7 @@ class Report(osv.Model):
|
||||||
user=user,
|
user=user,
|
||||||
res_company=user.company_id,
|
res_company=user.company_id,
|
||||||
website=website,
|
website=website,
|
||||||
editable_no_editor=True,
|
editable_no_editor=_("The preferred way to edit a report is to use the HTML Editor"),
|
||||||
)
|
)
|
||||||
return view_obj.render(cr, uid, template, values, context=context)
|
return view_obj.render(cr, uid, template, values, context=context)
|
||||||
|
|
||||||
|
@ -191,13 +174,16 @@ class Report(osv.Model):
|
||||||
paperformat = report.paperformat_id
|
paperformat = report.paperformat_id
|
||||||
|
|
||||||
# Preparing the minimal html pages
|
# Preparing the minimal html pages
|
||||||
subst = "<script src='/report/static/src/js/subst.js'></script> "
|
|
||||||
css = '' # Will contain local css
|
css = '' # Will contain local css
|
||||||
headerhtml = []
|
headerhtml = []
|
||||||
contenthtml = []
|
contenthtml = []
|
||||||
footerhtml = []
|
footerhtml = []
|
||||||
base_url = self.pool['ir.config_parameter'].get_param(cr, uid, 'web.base.url')
|
base_url = self.pool['ir.config_parameter'].get_param(cr, uid, 'web.base.url')
|
||||||
|
|
||||||
|
# Minimal page renderer
|
||||||
|
view_obj = self.pool['ir.ui.view']
|
||||||
|
render_minimal = partial(view_obj.render, cr, uid, 'report.minimal_layout', context=context)
|
||||||
|
|
||||||
# The received html report must be simplified. We convert it in a xml tree
|
# The received html report must be simplified. We convert it in a xml tree
|
||||||
# in order to extract headers, bodies and footers.
|
# in order to extract headers, bodies and footers.
|
||||||
try:
|
try:
|
||||||
|
@ -208,12 +194,12 @@ class Report(osv.Model):
|
||||||
|
|
||||||
for node in root.xpath("//div[@class='header']"):
|
for node in root.xpath("//div[@class='header']"):
|
||||||
body = lxml.html.tostring(node)
|
body = lxml.html.tostring(node)
|
||||||
header = self.MINIMAL_HTML_PAGE.format(css=css, subst=subst, body=body, base_url=base_url)
|
header = render_minimal(dict(css=css, subst=True, body=body, base_url=base_url))
|
||||||
headerhtml.append(header)
|
headerhtml.append(header)
|
||||||
|
|
||||||
for node in root.xpath("//div[@class='footer']"):
|
for node in root.xpath("//div[@class='footer']"):
|
||||||
body = lxml.html.tostring(node)
|
body = lxml.html.tostring(node)
|
||||||
footer = self.MINIMAL_HTML_PAGE.format(css=css, subst=subst, body=body, base_url=base_url)
|
footer = render_minimal(dict(css=css, subst=True, body=body, base_url=base_url))
|
||||||
footerhtml.append(footer)
|
footerhtml.append(footer)
|
||||||
|
|
||||||
for node in root.xpath("//div[@class='page']"):
|
for node in root.xpath("//div[@class='page']"):
|
||||||
|
@ -230,7 +216,7 @@ class Report(osv.Model):
|
||||||
reportid = False
|
reportid = False
|
||||||
|
|
||||||
body = lxml.html.tostring(node)
|
body = lxml.html.tostring(node)
|
||||||
reportcontent = self.MINIMAL_HTML_PAGE.format(css=css, subst='', body=body, base_url=base_url)
|
reportcontent = render_minimal(dict(css=css, subst=False, body=body, base_url=base_url))
|
||||||
|
|
||||||
# FIXME: imo the best way to extract record id from html reports is by using the
|
# FIXME: imo the best way to extract record id from html reports is by using the
|
||||||
# qweb branding. As website editor is not yet splitted in a module independant from
|
# qweb branding. As website editor is not yet splitted in a module independant from
|
||||||
|
@ -254,11 +240,10 @@ class Report(osv.Model):
|
||||||
specific_paperformat_args[attribute[0]] = attribute[1]
|
specific_paperformat_args[attribute[0]] = attribute[1]
|
||||||
|
|
||||||
# Run wkhtmltopdf process
|
# Run wkhtmltopdf process
|
||||||
pdf = self._generate_wkhtml_pdf(
|
return self._run_wkhtmltopdf(
|
||||||
cr, uid, headerhtml, footerhtml, contenthtml, context.get('landscape'),
|
cr, uid, headerhtml, footerhtml, contenthtml, context.get('landscape'),
|
||||||
paperformat, specific_paperformat_args, save_in_attachment
|
paperformat, specific_paperformat_args, save_in_attachment
|
||||||
)
|
)
|
||||||
return pdf
|
|
||||||
|
|
||||||
def get_action(self, cr, uid, ids, report_name, data=None, context=None):
|
def get_action(self, cr, uid, ids, report_name, data=None, context=None):
|
||||||
"""Return an action of type ir.actions.report.xml.
|
"""Return an action of type ir.actions.report.xml.
|
||||||
|
@ -329,7 +314,7 @@ class Report(osv.Model):
|
||||||
def _check_wkhtmltopdf(self):
|
def _check_wkhtmltopdf(self):
|
||||||
return wkhtmltopdf_state
|
return wkhtmltopdf_state
|
||||||
|
|
||||||
def _generate_wkhtml_pdf(self, cr, uid, headers, footers, bodies, landscape, paperformat, spec_paperformat_args=None, save_in_attachment=None):
|
def _run_wkhtmltopdf(self, cr, uid, headers, footers, bodies, landscape, paperformat, spec_paperformat_args=None, save_in_attachment=None):
|
||||||
"""Execute wkhtmltopdf as a subprocess in order to convert html given in input into a pdf
|
"""Execute wkhtmltopdf as a subprocess in order to convert html given in input into a pdf
|
||||||
document.
|
document.
|
||||||
|
|
||||||
|
|
|
@ -1,55 +1,31 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<openerp>
|
<openerp>
|
||||||
<data>
|
<data>
|
||||||
|
<template id="layout" inherit_id="web.layout" primary="True">
|
||||||
|
<!-- Add report attributes -->
|
||||||
|
<xpath expr="//html" position="attributes">
|
||||||
|
<attribute name="t-att-data-report-margin-top">data_report_margin_top if data_report_margin_top else None</attribute>
|
||||||
|
<attribute name="t-att-data-report-header-spacing">data_report_header_spacing if data_report_header_spacing else None</attribute>
|
||||||
|
<attribute name="t-att-data-report-dpi">data_report_dpi if data_report_dpi else None</attribute>
|
||||||
|
</xpath>
|
||||||
|
<!-- Add report style -->
|
||||||
|
<xpath expr="//head" position="inside">
|
||||||
|
<link href="/web/static/lib/bootstrap/css/bootstrap.css" rel="stylesheet"/>
|
||||||
|
<link href="/website/static/src/css/website.css" rel="stylesheet"/>
|
||||||
|
<link href="/web/static/lib/fontawesome/css/font-awesome.css" rel="stylesheet"/>
|
||||||
|
<style type="text/css">
|
||||||
|
<t t-call="report.style"/>
|
||||||
|
</style>
|
||||||
|
</xpath>
|
||||||
|
<!-- Remove conflicting style -->
|
||||||
|
<xpath expr="//head/link[@href='/web/static/src/css/full.css']" position="replace"></xpath>
|
||||||
|
</template>
|
||||||
|
|
||||||
<template id="html_container">
|
<template id="html_container">
|
||||||
<!DOCTYPE html>
|
<t t-set="body_classname" t-value="'container'"/>
|
||||||
<html t-att-lang="lang and lang.replace('_', '-')"
|
<t t-call="report.layout">
|
||||||
t-att-data-editable="'1' if editable else None"
|
<t t-raw="0"/>
|
||||||
t-att-data-view-xmlid="xmlid if editable else None"
|
</t>
|
||||||
t-att-data-main-object="repr(main_object) if editable else None"
|
|
||||||
t-att-data-report-margin-top="data_report_margin_top if data_report_margin_top else None"
|
|
||||||
t-att-data-report-header-spacing="data_report_header_spacing if data_report_header_spacing else None"
|
|
||||||
t-att-data-report-dpi="data_report_dpi if data_report_dpi else None"
|
|
||||||
t-att-data-oe-company-name="res_company.name">
|
|
||||||
<head>
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
|
||||||
|
|
||||||
<t t-if="main_object and 'website_meta_title' in main_object">
|
|
||||||
<t t-set="title" t-value="main_object.website_meta_title"/>
|
|
||||||
</t>
|
|
||||||
<t t-if="not title and main_object and 'name' in main_object">
|
|
||||||
<t t-set="additional_title" t-value="main_object.name"/>
|
|
||||||
</t>
|
|
||||||
<meta name="description" t-att-value="main_object and 'website_meta_description' in main_object
|
|
||||||
and main_object.website_meta_description or website_meta_description"/>
|
|
||||||
<meta name="keywords" t-att-value="main_object and 'website_meta_keywords' in main_object
|
|
||||||
and main_object.website_meta_keywords or website_meta_keywords"/>
|
|
||||||
|
|
||||||
<link id="bootstrap_css" rel='stylesheet' href='/web/static/lib/bootstrap/css/bootstrap.css' t-ignore="true"/>
|
|
||||||
<link rel="stylesheet" type="text/css" href='/website/static/src/css/website.css'/>
|
|
||||||
<style type="text/css">
|
|
||||||
<t t-call="report.style"/>
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<link rel='stylesheet' href='/web/static/lib/fontawesome/css/font-awesome.css'/>
|
|
||||||
|
|
||||||
<script type="text/javascript" src="/web/static/lib/es5-shim/es5-shim.min.js"></script>
|
|
||||||
<script type="text/javascript" src="/web/static/lib/underscore/underscore.js"></script>
|
|
||||||
<script type="text/javascript" src="/web/static/lib/underscore.string/lib/underscore.string.js"></script>
|
|
||||||
<script type="text/javascript" src="/web/static/lib/jquery/jquery.js"></script>
|
|
||||||
<script type="text/javascript" src="/web/static/lib/bootstrap/js/bootstrap.js"></script>
|
|
||||||
<script type="text/javascript" src="/web/static/lib/qweb/qweb2.js"></script>
|
|
||||||
<script type="text/javascript" src="/web/static/src/js/openerpframework.js"></script>
|
|
||||||
<script type="text/javascript" src="/website/static/src/js/website.js"></script>
|
|
||||||
<script t-if="not translatable" type="text/javascript" src="/website/static/src/js/website.snippets.animation.js"></script>
|
|
||||||
<t t-raw="head or ''" name='layout_head'/>
|
|
||||||
</head>
|
|
||||||
<body class="container">
|
|
||||||
<div id="wrapwrap">
|
|
||||||
<t t-raw="0"/>
|
|
||||||
</div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template id="style">
|
<template id="style">
|
||||||
|
@ -164,5 +140,25 @@
|
||||||
<t t-raw="0" />
|
<t t-raw="0" />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
<template id="minimal_layout">
|
||||||
|
<t t-raw="'<base href=%s>' % base_url"/>
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html style="height: 0;">
|
||||||
|
<head>
|
||||||
|
<link href="/report/static/src/css/reset.min.css" rel="stylesheet"/>
|
||||||
|
<link href="/web/static/lib/bootstrap/css/bootstrap.css" rel="stylesheet"/>
|
||||||
|
<link href="/website/static/src/css/website.css" rel="stylesheet"/>
|
||||||
|
<link href="/web/static/lib/fontawesome/css/font-awesome.css" rel="stylesheet"/>
|
||||||
|
<style type='text/css'><t t-raw="css"/></style>
|
||||||
|
<t t-if="subst is True">
|
||||||
|
<script src='/report/static/src/js/subst.js'></script>
|
||||||
|
</t>
|
||||||
|
</head>
|
||||||
|
<body class="container" onload="subst()">
|
||||||
|
<t t-raw="body"/>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
</template>
|
||||||
|
|
||||||
</data>
|
</data>
|
||||||
</openerp>
|
</openerp>
|
||||||
|
|
|
@ -65,7 +65,7 @@
|
||||||
<tbody class="sale_tbody">
|
<tbody class="sale_tbody">
|
||||||
<tr t-foreach="o.order_line" t-as="l">
|
<tr t-foreach="o.order_line" t-as="l">
|
||||||
<td>
|
<td>
|
||||||
<span t-field="l.name"/>
|
<span t-field="l.name"/>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<span t-esc="', '.join(map(lambda x: x.name, l.tax_id))"/>
|
<span t-esc="', '.join(map(lambda x: x.name, l.tax_id))"/>
|
||||||
|
|
|
@ -244,7 +244,7 @@ class website(osv.osv):
|
||||||
return is_website_publisher
|
return is_website_publisher
|
||||||
|
|
||||||
def is_user(self, cr, uid, ids, context=None):
|
def is_user(self, cr, uid, ids, context=None):
|
||||||
return self.pool['res.users'].has_group(cr, request.uid, 'base.group_user')
|
return self.pool['res.users'].has_group(cr, uid, 'base.group_user')
|
||||||
|
|
||||||
def get_template(self, cr, uid, ids, template, context=None):
|
def get_template(self, cr, uid, ids, template, context=None):
|
||||||
if isinstance(template, (int, long)):
|
if isinstance(template, (int, long)):
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
<!-- Front-end/Back-end integration -->
|
<!-- Front-end/Back-end integration -->
|
||||||
<template id="user_navbar" inherit_id="website.layout" groups="base.group_user">
|
<template id="user_navbar" inherit_id="website.layout" groups="base.group_user">
|
||||||
<xpath expr="//body/div['id=wrawrap']" position="before">
|
<xpath expr="//body/div['id=wrawrap']" position="before">
|
||||||
|
<t t-if="website and menu_data">
|
||||||
<nav id="oe_main_menu_navbar" class="navbar navbar-inverse" role="navigation">
|
<nav id="oe_main_menu_navbar" class="navbar navbar-inverse" role="navigation">
|
||||||
<div class="navbar-header">
|
<div class="navbar-header">
|
||||||
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#oe_applications">
|
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#oe_applications">
|
||||||
|
@ -79,6 +80,7 @@
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</nav>
|
</nav>
|
||||||
|
</t>
|
||||||
</xpath>
|
</xpath>
|
||||||
</template>
|
</template>
|
||||||
</data>
|
</data>
|
||||||
|
|
|
@ -57,7 +57,7 @@
|
||||||
|
|
||||||
<template id="layout" name="Main layout"><!DOCTYPE html>
|
<template id="layout" name="Main layout"><!DOCTYPE html>
|
||||||
<html t-att-lang="lang and lang.replace('_', '-')"
|
<html t-att-lang="lang and lang.replace('_', '-')"
|
||||||
t-att-data-website-id="website.id if editable else None"
|
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-editable="'1' if editable else None"
|
||||||
t-att-data-editable-no-editor="editable_no_editor or None"
|
t-att-data-editable-no-editor="editable_no_editor or None"
|
||||||
t-att-data-translatable="'1' if translatable else None"
|
t-att-data-translatable="'1' if translatable else None"
|
||||||
|
@ -82,10 +82,10 @@
|
||||||
and main_object.website_meta_keywords or website_meta_keywords"/>
|
and main_object.website_meta_keywords or website_meta_keywords"/>
|
||||||
<title><t t-esc="title"/></title>
|
<title><t t-esc="title"/></title>
|
||||||
|
|
||||||
<t t-set="languages" t-value="website.get_languages()"/>
|
<t t-set="languages" t-value="website.get_languages() if website else None"/>
|
||||||
<t t-if="request.website_multilang">
|
<t t-if="request and request.website_multilang">
|
||||||
<t t-foreach="languages" t-as="lg">
|
<t t-foreach="languages" t-as="lg">
|
||||||
<t t-set="force_lang" t-value="lg[0] if lg[0] != website.default_lang_code else None"/>
|
<t t-set="force_lang" t-value="lg[0] if website and lg[0] != website.default_lang_code else None"/>
|
||||||
<link rel="alternate" t-att-href="url_for(request.httprequest.path + '?' + keep_query(), lang=force_lang)" t-att-hreflang="lg[0].replace('_', '-').lower()" />
|
<link rel="alternate" t-att-href="url_for(request.httprequest.path + '?' + keep_query(), lang=force_lang)" t-att-hreflang="lg[0].replace('_', '-').lower()" />
|
||||||
</t>
|
</t>
|
||||||
</t>
|
</t>
|
||||||
|
@ -150,7 +150,7 @@
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
</div>
|
</div>
|
||||||
<t t-if="website.google_analytics_key">
|
<t t-if="website and website.google_analytics_key">
|
||||||
<script>
|
<script>
|
||||||
(function(b,o,i,l,e,r){b.GoogleAnalyticsObject=l;b[l]||(b[l]=
|
(function(b,o,i,l,e,r){b.GoogleAnalyticsObject=l;b[l]||(b[l]=
|
||||||
function(){(b[l].q=b[l].q||[]).push(arguments)});b[l].l=+new Date;
|
function(){(b[l].q=b[l].q||[]).push(arguments)});b[l].l=+new Date;
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
<template id="header" inherit_id="website.layout" name="LiveChat Import (internal) Scripts">
|
<template id="header" inherit_id="website.layout" name="LiveChat Import (internal) Scripts">
|
||||||
<xpath expr="//head" position="inside">
|
<xpath expr="//head" position="inside">
|
||||||
<t t-if="website.channel_id">
|
<t t-if="website and website.channel_id">
|
||||||
<t t-raw="website.channel_id.script_internal"/>
|
<t t-raw="website.channel_id.script_internal"/>
|
||||||
</t>
|
</t>
|
||||||
</xpath>
|
</xpath>
|
||||||
|
|
|
@ -1,92 +1,47 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<openerp>
|
<openerp>
|
||||||
<data>
|
<data>
|
||||||
<template id="editor_head" inherit_id="report.html_container" name="Editor" groups="base.group_website_publisher">
|
|
||||||
|
<template id="layout" inherit_id="website.layout" primary="True">
|
||||||
|
<!-- Add report attributes -->
|
||||||
<xpath expr="//html" position="attributes">
|
<xpath expr="//html" position="attributes">
|
||||||
<attribute name="t-att-data-website-id">website.id if editable and website else None</attribute>
|
<attribute name="t-att-data-report-margin-top">data_report_margin_top if data_report_margin_top else None</attribute>
|
||||||
<attribute name="t-att-data-translatable">'1' if translatable else None</attribute>
|
<attribute name="t-att-data-report-header-spacing">data_report_header_spacing if data_report_header_spacing else None</attribute>
|
||||||
|
<attribute name="t-att-data-report-dpi">data_report_dpi if data_report_dpi else None</attribute>
|
||||||
|
</xpath>
|
||||||
|
<!-- Add report style -->
|
||||||
|
<xpath expr="//head" position="inside">
|
||||||
|
<style type="text/css">
|
||||||
|
<t t-call="report.style"/>
|
||||||
|
</style>
|
||||||
</xpath>
|
</xpath>
|
||||||
|
|
||||||
<xpath expr="//body" position="attributes">
|
<xpath expr="//body" position="attributes">
|
||||||
<attribute name="style">padding-top: 51px;</attribute>
|
<attribute name="class">container</attribute>
|
||||||
</xpath>
|
</xpath>
|
||||||
<xpath expr="//body" position="inside">
|
<xpath expr="//header" position="replace"/>
|
||||||
<div id="website-top-navbar-placeholder" class="navbar navbar-inverse navbar-fixed-top hidden-xs">
|
<xpath expr="//footer" position="replace">
|
||||||
<div class="navbar-header">
|
<ul class="list-inline js_language_selector mt16" t-if="(request and request.website_multilang and len(languages) > 1) or (website and editable)">
|
||||||
<form class="navbar-form navbar-left">
|
<li t-foreach="languages" t-as="lg">
|
||||||
<button type="button" class="btn btn-primary">Edit</button>
|
<a t-att-href="url_for(request.httprequest.path + '?' + keep_query(), lang=lg[0])"
|
||||||
</form>
|
t-att-data-default-lang="editable and 'true' if website and lg[0] == website.default_lang_code else None">
|
||||||
</div>
|
<t t-esc="lg[1].split('/').pop()"/>
|
||||||
<div class="collapse navbar-collapse navbar-edit-collapse">
|
</a>
|
||||||
<ul class="nav navbar-nav navbar-right">
|
</li>
|
||||||
<li><a href="#" onclick="return false;"><i class="fa fa-mobile" title="Mobile preview"/></a></li>
|
<li groups="base.group_website_publisher">
|
||||||
<li class="divider-vertical"/>
|
<t t-set="url_return" t-value="url_for('', '[lang]') + '?' + keep_query()"/>
|
||||||
<li><a href="#" onclick="return false;"><span title="Promote page on the web">Promote</span></a></li>
|
<a t-attf-href="/web#action=base.action_view_base_language_install&website_id=#{website.id if website else ''}&url_return=#{url_return}">
|
||||||
<li class="dropdown">
|
<i class="fa fa-plus-circle"/>
|
||||||
<a href="#" onclick="return false;">Content <span class="caret"/></a>
|
Add a language...
|
||||||
</li>
|
</a>
|
||||||
<li class="dropdown">
|
</li>
|
||||||
<a href="#" onclick="return false;">Customize <span class="caret"/></a>
|
</ul>
|
||||||
</li>
|
|
||||||
<li class="dropdown">
|
|
||||||
<a href="#" onclick="return false;">Help <span class="caret"/></a>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</xpath>
|
</xpath>
|
||||||
<xpath expr='//t[@name="layout_head"]' position="before">
|
</template>
|
||||||
<link rel='stylesheet' href='/website/static/src/css/snippets.css'/>
|
|
||||||
<link rel='stylesheet' href='/website/static/src/css/editor.css'/>
|
|
||||||
|
|
||||||
|
<template id="website_html_container" inherit_id="report.html_container">
|
||||||
<link rel="stylesheet" href="/web/static/lib/select2/select2.css"/>
|
<xpath expr="//t[@t-call='report.layout']" position="replace">
|
||||||
<link rel="stylesheet" href="/website/static/lib/select2-bootstrap-css/select2-bootstrap.css"/>
|
<t t-call="website_report.layout">
|
||||||
<link rel='stylesheet' href="/web/static/lib/jquery.ui/css/smoothness/jquery-ui-1.9.1.custom.css"/>
|
<t t-raw="0"/>
|
||||||
|
|
||||||
<script type="text/javascript" src="/web/static/lib/select2/select2.js"></script>
|
|
||||||
<script type="text/javascript" src="/web/static/lib/ckeditor/ckeditor.js"></script>
|
|
||||||
<script type="text/javascript" src="/website/static/lib/ace/ace.js"></script>
|
|
||||||
<script type="text/javascript" src="/website/static/lib/vkbeautify/vkbeautify.0.99.00.beta.js"></script>
|
|
||||||
<script type="text/javascript" src="/web/static/lib/jquery.ui/js/jquery-ui-1.9.1.custom.js"></script>
|
|
||||||
<!-- mutation observers shim backed by mutation events (8 < IE < 11, Safari < 6, FF < 14, Chrome < 17) -->
|
|
||||||
<script type="text/javascript" src="/website/static/lib//jquery.mjs.nestedSortable/jquery.mjs.nestedSortable.js"></script>
|
|
||||||
<script type="text/javascript" src="/website/static/lib/MutationObservers/test/sidetable.js"></script>
|
|
||||||
<script type="text/javascript" src='/website/static/lib/nearest/jquery.nearest.js'></script>
|
|
||||||
<script type="text/javascript" src="/website/static/lib/MutationObservers/MutationObserver.js"></script>
|
|
||||||
|
|
||||||
<script type="text/javascript" src="/website/static/lib/jquery.placeholder/jquery.placeholder.js"></script>
|
|
||||||
|
|
||||||
<script type="text/javascript" src="/website/static/src/js/website.editor.js"></script>
|
|
||||||
<script type="text/javascript" src="/website/static/src/js/website.menu.js"></script>
|
|
||||||
<script type="text/javascript" src="/website/static/src/js/website.editor.newpage.js"></script> <!-- groups="base.group_website_designer" -->
|
|
||||||
<script type="text/javascript" src="/website/static/src/js/website.contentMenu.js"></script> <!-- groups="base.group_website_designer" -->
|
|
||||||
<script type="text/javascript" src="/website/static/src/js/website.mobile.js"></script>
|
|
||||||
<script type="text/javascript" src="/website/static/src/js/website.seo.js"></script>
|
|
||||||
<script type="text/javascript" src="/website/static/src/js/website.snippets.editor.js"></script>
|
|
||||||
<script type="text/javascript" src="/website/static/src/js/website.ace.js"></script>
|
|
||||||
<script type="text/javascript" src="/website/static/src/js/website.translator.js"></script>
|
|
||||||
<script type="text/javascript" src="/website/static/src/js/jQuery.transfo.js"></script>
|
|
||||||
</xpath>
|
|
||||||
|
|
||||||
<xpath expr='//body[@class="container"]/div[@id="wrapwrap"]' position="before">
|
|
||||||
<t t-set="languages" t-value="website.get_languages() if website else None"/>
|
|
||||||
<t t-if="languages">
|
|
||||||
<ul class="list-inline js_language_selector mt16" t-if="(len(languages) > 1 or editable)">
|
|
||||||
<li t-foreach="languages" t-as="lg">
|
|
||||||
<a t-att-href="url_for('', lang=lg[0]) + '?' + keep_query()"
|
|
||||||
t-att-data-default-lang="editable and 'true' if lg[0] == website.default_lang_code else None">
|
|
||||||
<t t-esc="lg[1].split('/').pop()"/>
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
<li groups="base.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}&url_return=#{url_return}">
|
|
||||||
<i class="fa fa-plus-circle"/>
|
|
||||||
Add a language...
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</t>
|
</t>
|
||||||
</xpath>
|
</xpath>
|
||||||
</template>
|
</template>
|
||||||
|
|
Loading…
Reference in New Issue