[FIX] wrap the wrapper in order to allow RTE on all of the page (except the toolbar)
CKEditor does not work directly on body, and it's a bad idea anyway (editing the edition toolbar won't end well). A big wrapper around all of the page's content can be used as RTE hook to give access to the body as well as the header and footers. bzr revid: xmo@openerp.com-20130918145028-6ppi9sro2un0quh5
This commit is contained in:
parent
fe630f7f93
commit
e0662b11d0
|
@ -1,4 +1,3 @@
|
|||
@charset "utf-8";
|
||||
/* THIS CSS FILE IS FOR WEBSITE THEMING CUSTOMIZATION ONLY
|
||||
*
|
||||
* css for editor buttons, openerp widget included in the website and other
|
||||
|
@ -97,12 +96,12 @@
|
|||
}
|
||||
|
||||
/* ----- BOOTSTRAP HACK FOR STICKY FOOTER ----- */
|
||||
html, body {
|
||||
html, body, #wrapwrap {
|
||||
box-sizing: border-box;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
body {
|
||||
#wrapwrap {
|
||||
display: table;
|
||||
width: 100%;
|
||||
}
|
||||
|
|
|
@ -64,11 +64,11 @@
|
|||
|
||||
/* ----- BOOTSTRAP HACK FOR STICKY FOOTER ----- */
|
||||
|
||||
html,body
|
||||
html,body, #wrapwrap
|
||||
box-sizing: border-box
|
||||
height: 100%
|
||||
|
||||
body
|
||||
#wrapwrap
|
||||
display: table
|
||||
width: 100%
|
||||
|
||||
|
@ -110,8 +110,7 @@ footer
|
|||
.nav-hierarchy
|
||||
padding-left: 16px
|
||||
|
||||
div#wrap
|
||||
.carousel
|
||||
div#wrap .carousel
|
||||
top: -20px
|
||||
|
||||
/* -- Hack for removing double scrollbar from mobile preview -- */
|
||||
|
@ -122,8 +121,7 @@ div#mobile-preview.modal
|
|||
ul.nav-stacked > li > a
|
||||
padding: 2px 15px
|
||||
|
||||
#customize-menu
|
||||
.dropdown-header
|
||||
#customize-menu .dropdown-header
|
||||
text-transform: uppercase
|
||||
|
||||
/* ---- PUBLISH ---- */
|
||||
|
|
|
@ -310,8 +310,7 @@
|
|||
start_edition: function ($elements) {
|
||||
var self = this;
|
||||
// create a single editor for the whole page
|
||||
// FIXME: is not the whole page, ckeditor can't handle body
|
||||
var root = document.getElementById('wrap');
|
||||
var root = document.getElementById('wrapwrap');
|
||||
root.setAttribute('data-cke-editable', 'true');
|
||||
this.editor = CKEDITOR.inline(root, self._config());
|
||||
this.editor.on('instanceReady', function () {
|
||||
|
|
|
@ -55,34 +55,42 @@ class view(osv.osv):
|
|||
def extract_embedded_fields(self, cr, uid, arch, context=None):
|
||||
return arch.xpath('//*[@data-oe-model != "ir.ui.view"]')
|
||||
|
||||
def convert_embedded_field(self, cr, uid, el, column, context=None):
|
||||
def convert_embedded_field(self, cr, uid, el, column,
|
||||
type_override=None, context=None):
|
||||
""" Converts the content of an embedded field to a value acceptable
|
||||
for writing in the column
|
||||
|
||||
:param etree._Element el: embedded field being saved
|
||||
:param fields._column column: column object corresponding to the field
|
||||
:param type type_override: column type to dispatch on instead of the
|
||||
column's actual type (for proxy column types
|
||||
e.g. relateds)
|
||||
:return: converted value
|
||||
"""
|
||||
if isinstance(column, fields.html):
|
||||
column_type = type_override or type(column)
|
||||
|
||||
if issubclass(column_type, fields.html):
|
||||
# FIXME: multiple children?
|
||||
return html.tostring(el[0])
|
||||
elif isinstance(column, fields.integer):
|
||||
elif issubclass(column_type, fields.integer):
|
||||
return int(el.text_content())
|
||||
elif isinstance(column, fields.float):
|
||||
elif issubclass(column_type, fields.float):
|
||||
return float(el.text_content())
|
||||
elif isinstance(column, (fields.char, fields.text,
|
||||
elif issubclass(column_type, (fields.char, fields.text,
|
||||
fields.date, fields.datetime)):
|
||||
return el.text_content()
|
||||
# TODO: fields.selection
|
||||
# TODO: fields.many2one
|
||||
elif isinstance(column, fields.function):
|
||||
elif issubclass(column_type, fields.function):
|
||||
# FIXME: special-case selection as in get_pg_type?
|
||||
return self.convert_embedded_field(
|
||||
cr, uid, el, getattr(fields, column._type), context=context)
|
||||
cr, uid, el, column,
|
||||
type_override=getattr(fields, column._type),
|
||||
context=context)
|
||||
# TODO?: fields.many2many, fields.one2many
|
||||
# TODO?: fields.reference
|
||||
else:
|
||||
raise TypeError("Un-convertable column type %s" % column)
|
||||
raise TypeError("Un-convertable column type %s" % column_type)
|
||||
|
||||
def save_embedded_field(self, cr, uid, el, context=None):
|
||||
Model = self.pool[el.get('data-oe-model')]
|
||||
|
|
|
@ -57,6 +57,7 @@
|
|||
<link rel='stylesheet' href='/web/static/lib/fontawesome/css/font-awesome.css'/>
|
||||
</head>
|
||||
<body>
|
||||
<div id="wrapwrap">
|
||||
<header>
|
||||
<div class="navbar navbar-default navbar-static-top">
|
||||
<div class="container">
|
||||
|
@ -150,6 +151,7 @@
|
|||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
</template>
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<!-- Layout add nav and footer -->
|
||||
|
||||
<template id="footer_custom" inherit_id="website.layout" name="Custom Footer">
|
||||
<xpath expr="//body/footer//div[@name='info']/ul" position="inside">
|
||||
<xpath expr="//footer//div[@name='info']/ul" position="inside">
|
||||
<li><a href="/references/">References</a></li>
|
||||
</xpath>
|
||||
</template>
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<!-- Layout add nav and footer -->
|
||||
|
||||
<template id="footer_custom" inherit_id="website.layout" name="Custom Footer">
|
||||
<xpath expr="//body/footer//div[@name='info']/ul" position="inside">
|
||||
<xpath expr="//footer//div[@name='info']/ul" position="inside">
|
||||
<li><a href="/partners/">Partners</a></li>
|
||||
</xpath>
|
||||
</template>
|
||||
|
|
|
@ -5,10 +5,10 @@
|
|||
<!-- Layout add nav and footer -->
|
||||
|
||||
<template id="header_footer" inherit_id="website_sale.header_footer">
|
||||
<xpath expr="//body/header//ul[@id='top_menu']/li" position="before">
|
||||
<xpath expr="//header//ul[@id='top_menu']/li" position="before">
|
||||
<li><a href="/event">Events</a></li>
|
||||
</xpath>
|
||||
<xpath expr="//body/footer//ul[@name='products']/li" position="after">
|
||||
<xpath expr="//footer//ul[@name='products']/li" position="after">
|
||||
<li><a href="/event">Events</a></li>
|
||||
</xpath>
|
||||
</template>
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
<!-- Layout add nav and footer -->
|
||||
|
||||
<template id="footer_custom" inherit_id="website.layout" name="Custom Footer">
|
||||
<xpath expr="//body/footer//div[@name='info']/ul" position="inside">
|
||||
<xpath expr="//footer//div[@name='info']/ul" position="inside">
|
||||
<li><a href="/blog/%(website_hr.website_mail_job)d/">Jobs</a></li>
|
||||
</xpath>
|
||||
</template>
|
||||
|
|
|
@ -13,10 +13,10 @@
|
|||
<!-- Layout add nav and footer -->
|
||||
|
||||
<template id="header_footer_custom" inherit_id="website.layout">
|
||||
<xpath expr="//body/header//ul[@id='top_menu']/li[last()]" position="before">
|
||||
<xpath expr="//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//div[@name='info']/ul" position="inside">
|
||||
<xpath expr="//footer//div[@name='info']/ul" position="inside">
|
||||
<li><a href="/blog/%(website_mail.website_mail_blog)d/">News</a></li>
|
||||
</xpath>
|
||||
</template>
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<!-- Layout add nav and footer -->
|
||||
|
||||
<template id="footer_custom" inherit_id="website.layout" name="Custom Footer">
|
||||
<xpath expr="//body/footer//div[@name='info']/ul" position="inside">
|
||||
<xpath expr="//footer//div[@name='info']/ul" position="inside">
|
||||
<li><a href="/members/">Members</a></li>
|
||||
</xpath>
|
||||
</template>
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<!-- Layout add nav and footer -->
|
||||
|
||||
<template id="footer_custom" inherit_id="website.layout" name="Custom Footer">
|
||||
<xpath expr="//body/footer//ul[@name='products']" position="inside">
|
||||
<xpath expr="//footer//ul[@name='products']" position="inside">
|
||||
<li t-foreach="website_project_ids" t-as="project"><a t-attf-href="/project/#{ project.id }/"><t t-esc="project.name"/></a></li>
|
||||
</xpath>
|
||||
</template>
|
||||
|
|
|
@ -43,7 +43,7 @@
|
|||
<!-- Layout add nav and footer -->
|
||||
|
||||
<template id="header_footer" inherit_id="website.layout" name="Custom Footer">
|
||||
<xpath expr="//body/header//ul[@id='top_menu']/li" position="before">
|
||||
<xpath expr="//header//ul[@id='top_menu']/li" position="before">
|
||||
<li><a href="/shop/">Shop</a></li>
|
||||
<li>
|
||||
<a href="/shop/mycart/">
|
||||
|
@ -53,7 +53,7 @@
|
|||
</a>
|
||||
</li>
|
||||
</xpath>
|
||||
<xpath expr="//body/footer//ul[@name='products']" position="inside">
|
||||
<xpath expr="//footer//ul[@name='products']" position="inside">
|
||||
<li><a href="/shop/">Shop</a></li>
|
||||
<li>
|
||||
<a href="/shop/mycart/">
|
||||
|
|
Loading…
Reference in New Issue