Files
odoo_source/addons/web_editor/views/iframe.xml
T
Martin Trigaux f7130556bb [REF] *: add support for RTL languages
מזל טוב

The direction parameter will now have a real impact on the web interface and
completly switch the direction of the interface.
Add the dependency rtlcss to switch the direction with a css postprocessor.

Two different assets will be generated for ltr or rtl
/web/content/<...>/web.assets_backend.0.css
and
/web/content/<...>/rtl/web.assets_backend.0.css
to be able to differentiate it easily

Adapt the css and views to be easier to switch direction

Render graph as it is, do not move y-axis right side, as per mathematical rule
value goes left from origin are considered negative, so keep graph as it is
for right to left language

add test cases for language direction specific assets bundle
if language direction is rtl then we also store css files in assets bundle
now we store two assets bundle, one for ltr and one for rtl language direction
test two assets bundles generated, also test two assets bundle generated for en_US and ar_SY
2018-08-10 16:32:50 +02:00

81 lines
4.0 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<template id="layout" name="Editor layout">&lt;!DOCTYPE html&gt;
<html t-att-lang="lang and lang.replace('_', '-')"
t-att-data-editable="'1' if editable else None"
t-att-data-translatable="'1' if translatable else None"
t-att-data-edit_translations="'1' if edit_translations else None"
t-att-data-main-object="repr(main_object) if editable else None">
<head>
<meta charset="utf-8" />
<title>Odoo Editor layout</title>
<meta name="viewport" content="initial-scale=1"/>
<script type="text/javascript">
var callback = window.location.href.match(/callback=([^&amp;=]+)/)[1];
var odoo = {
session_info: {
is_superuser: <t t-esc="json.dumps(request.env.user._is_superuser())"/>,
is_frontend: true, // this is not really the frontend here but this key is used to detect if xml has to be manually loaded
},
_modules: ['web_editor'],
snippetsURL: '<t t-esc="snippets or ''"/>',
};
</script>
<t t-if="not dont_load_assets">
<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"/>
<t t-call-assets="web_editor.assets_editor" t-js="false"/>
<t t-call-assets="web.assets_common" t-css="false"/>
<t t-call-assets="web_editor.summernote" t-css="false"/>
<t t-call-assets="web_editor.assets_editor" t-css="false"/>
<script type="text/javascript" src="/web/static/src/js/services/session.js"></script>
<script type="text/javascript" src="/web_editor/static/src/js/content/body_manager.js"/>
<script type="text/javascript" src="/web_editor/static/src/js/root_widget.js"/>
<script type="text/javascript" src="/web_editor/static/src/js/iframe.js"></script>
<script t-if="enable_editor and inline_mode" type="text/javascript" src="/web_editor/static/src/js/inline.js"></script>
</t>
<script>
if (window.top.odoo &amp;&amp; !window.top.odoo[callback+"_updown"]) {
window.top.odoo[callback+"_updown"] = function (value, fields_values) {
var editable = document.getElementsByClassName("o_editable")[0];
if (editable &amp;&amp; value !== editable.innerHTML) {
editable.innerHTML = value;
}
};
}
if(window.odoo.define) {
odoo.define('web.csrf', function (require) {
var token = "<t t-esc="request.csrf_token(None)"/>";
var core = require('web.core');
core.csrf_token = token;
core.qweb.default_dict.csrf_token = token;
});
}
</script>
<t t-raw="head or ''"/>
</head>
<t t-set="direction" t-value="request.env['res.lang'].search([('code', '=', request.env.lang)]).direction"/>
<body id="web_editor_inside_iframe" onload="var fn=window.top.odoo &amp;&amp; window.top.odoo[callback+'_content']; if(fn) {fn();} else {console.warn('Please don\'t open iframe without the odoo backend');}" t-attf-style="direction: #{direction};">
<div id="wrapwrap">
<main>
<t t-raw="0"/>
</main>
</div>
<t t-raw="add_html or ''"/>
</body>
</html>
</template>
<template id="FieldTextHtml" name="Editor HTML">
<t t-call="web_editor.layout">
<div id="editable_area" t-att-class="'' if edit_translations else 'o_editable'"></div>
</t>
</template>
</odoo>