diff --git a/addons/website/static/src/css/editor.css b/addons/website/static/src/css/editor.css index eb4c5b2851c..4e9038837f3 100644 --- a/addons/website/static/src/css/editor.css +++ b/addons/website/static/src/css/editor.css @@ -106,6 +106,15 @@ content: "Press The Top-Left Edit Button" !important; } +[data-oe-type=html].oe_no_empty:empty:before { + content: "" !important; +} + +[data-oe-type=html].oe_no_empty:empty { + background-image: none !important; + height: 16px !important; +} + /* ---- EDITOR BAR ---- {{{ */ table.editorbar-panel { cursor: pointer; diff --git a/addons/website/static/src/css/editor.sass b/addons/website/static/src/css/editor.sass index fb80fa47277..53eb89a4341 100644 --- a/addons/website/static/src/css/editor.sass +++ b/addons/website/static/src/css/editor.sass @@ -86,6 +86,13 @@ .oe_structure.oe_empty:empty:before, [data-oe-type=html]:empty:before, .oe_structure.oe_empty > .oe_drop_zone.oe_insert:only-child:before, [data-oe-type=html] > .oe_drop_zone.oe_insert:only-child:before content: 'Press The Top-Left Edit Button' !important +[data-oe-type=html].oe_no_empty:empty:before + content: '' !important + +[data-oe-type=html].oe_no_empty:empty + background-image: none !important + height: 16px !important + // }}} /* ---- EDITOR BAR ---- {{{ */ diff --git a/addons/website_forum/views/website_forum.xml b/addons/website_forum/views/website_forum.xml index 1a6a982fb93..2af673eb188 100644 --- a/addons/website_forum/views/website_forum.xml +++ b/addons/website_forum/views/website_forum.xml @@ -100,30 +100,6 @@
-
-
-

Question tools

-
-
- -
- follower(s) -
-
-
-

Stats

-
-
- - - - -
Asked:
Seen: - times - time -
Last updated:
-
-
diff --git a/addons/website_forum_doc/controllers/main.py b/addons/website_forum_doc/controllers/main.py index 4c92f3d0e71..cd8b48ff195 100644 --- a/addons/website_forum_doc/controllers/main.py +++ b/addons/website_forum_doc/controllers/main.py @@ -18,28 +18,34 @@ from openerp.addons.website.models.website import slug # controllers = controllers() class WebsiteDoc(http.Controller): - @http.route(['/forum/how-to', '/forum/how-to/'], type='http', auth="public", website=True, multilang=True) + @http.route(['/forum/how-to', '/forum/how-to/'], type='http', auth="public", website=True, multilang=True) def toc(self, toc=None, **kwargs): cr, uid, context, toc_id = request.cr, request.uid, request.context, False if toc: - toc = [toc] + sections = toc.child_ids + forum = toc.forum_id else: toc_obj = request.registry['forum.documentation.toc'] obj_ids = toc_obj.search(cr, uid, [('parent_id', '=', False)], context=context) - toc = toc_obj.browse(cr, uid, obj_ids, context=context) + sections = toc_obj.browse(cr, uid, obj_ids, context=context) + forum = sections and sections[0].forum_id or False value = { - 'sections': toc, + 'toc': toc, + 'forum': forum, + 'sections': sections, } return request.website.render("website_forum_doc.documentation", value) - @http.route(['/forum/how-to//'], type='http', auth="public", website=True, multilang=True) - def how_to(self, toc, post, **kwargs): - assert post.documentation_toc_id.id == toc.id, "Wrong post, should implement a redirect here" + @http.route(['/forum/how-to//'], type='http', auth="public", website=True, multilang=True) + def post(self, toc, post, **kwargs): + # TODO: implement a redirect instead of crash + assert post.documentation_toc_id.id == toc.id, "Wrong post!" value = { - 'section': toc, - 'post': post + 'toc': toc, + 'post': post, + 'forum': post.forum_id } - return request.website.render("website_forum_doc.documentation.post", value) + return request.website.render("website_forum_doc.documentation_post", value) #--------------------- diff --git a/addons/website_forum_doc/data/doc_demo.xml b/addons/website_forum_doc/data/doc_demo.xml index acccca2f522..0b98c483782 100644 --- a/addons/website_forum_doc/data/doc_demo.xml +++ b/addons/website_forum_doc/data/doc_demo.xml @@ -5,54 +5,79 @@ Functional Documentation + +

+ This documentation is produced using the best posts from the + community forum. +

+
+
Sales Management + +

+ Tracks leads, boost opportunities and close deals. + This serie of how-to will help you develop your business. +

+
+
Customers + Sales orders + Sales & Warehouse + Customer Relationship Management + Lead & Opportunity + Claims + After-sale communication + Website + CMS & eCommerce + Human Resources Management + Employee Contract + diff --git a/addons/website_forum_doc/models/documentation.py b/addons/website_forum_doc/models/documentation.py index 25c12b8dea5..956367994da 100644 --- a/addons/website_forum_doc/models/documentation.py +++ b/addons/website_forum_doc/models/documentation.py @@ -13,11 +13,13 @@ class Documentation(osv.Model): _columns = { 'sequence': fields.integer('Sequence'), 'name': fields.char('Name', required=True, translate=True), + 'introduction': fields.html('Introduction', translate=True), 'parent_id': fields.many2one('forum.documentation.toc', 'Parent Table Of Content'), 'child_ids': fields.one2many('forum.documentation.toc', 'parent_id', 'Children Table Of Content'), 'parent_left': fields.integer('Left Parent', select=True), 'parent_right': fields.integer('Right Parent', select=True), 'post_ids': fields.one2many('forum.post', 'documentation_toc_id', 'Posts'), + 'forum_id': fields.many2one('forum.forum', 'Forum', required=True), } _constraints = [ (osv.osv._check_recursion, 'Error ! You cannot create recursive categories.', ['parent_id']) diff --git a/addons/website_forum_doc/views/doc.xml b/addons/website_forum_doc/views/doc.xml index 177caf0445a..814a24fe10f 100644 --- a/addons/website_forum_doc/views/doc.xml +++ b/addons/website_forum_doc/views/doc.xml @@ -11,6 +11,7 @@ + diff --git a/addons/website_forum_doc/views/website_doc.xml b/addons/website_forum_doc/views/website_doc.xml index 7c00e5013ed..b0fbb15e423 100644 --- a/addons/website_forum_doc/views/website_doc.xml +++ b/addons/website_forum_doc/views/website_doc.xml @@ -11,52 +11,141 @@ + + + +