diff --git a/doc/howto/howto_website.rst b/doc/howto/howto_website.rst index 192f7f1b9c8..bb2d0ee5554 100644 --- a/doc/howto/howto_website.rst +++ b/doc/howto/howto_website.rst @@ -24,6 +24,8 @@ create a module: .. todo:: output directory probably shouldn't be ``.`` +.. todo:: ``oe`` v ``./oe``? + .. code-block:: console $ oe scaffold Academy . diff --git a/doc/howto/howto_website/basic-page b/doc/howto/howto_website/basic-page index 765522cbbbc..5e053dcdea2 100644 --- a/doc/howto/howto_website/basic-page +++ b/doc/howto/howto_website/basic-page @@ -1,24 +1,17 @@ # HG changeset patch -# Parent d06b1f422ac5672c4a4c34bb3a50e98df42f3e31 +# Parent b96cd22d25cfa9a67f451d091f5c4896997d350d diff --git a/controllers/academy.py b/controllers/academy.py --- a/controllers/academy.py +++ b/controllers/academy.py -@@ -6,4 +6,16 @@ from openerp.addons.web.controllers impo +@@ -6,4 +6,9 @@ from openerp.addons.web.controllers impo class academy(main.Home): @http.route('/', auth='none') def index(self): - return "Hello, world!" + return """ -+ -+ -+ AcademyAcademy -+ -+ -+ -+

Introduction to a thing

-+

Course description

-+

Course introduction

-+ -+ ++ ++ ++

Introduction to a thing

++ +""" diff --git a/doc/howto/howto_website/lectures-model-add b/doc/howto/howto_website/lectures-model-add index 5fc1a7c592a..5dccc34aedb 100644 --- a/doc/howto/howto_website/lectures-model-add +++ b/doc/howto/howto_website/lectures-model-add @@ -1,5 +1,5 @@ # HG changeset patch -# Parent fef5ecf2dad4b7bdcc9a760545c2689187bb15f9 +# Parent dc6e1146075f61db66b1f7d2b7d3b8e76341e7bb diff --git a/__openerp__.py b/__openerp__.py --- a/__openerp__.py @@ -17,7 +17,7 @@ diff --git a/controllers/academy.py b/controllers/academy.py +++ b/controllers/academy.py @@ -6,10 +6,15 @@ from openerp.addons.web.controllers impo class academy(main.Home): - @http.route('/', auth='public') + @http.route('/', auth='public', website=True) def index(self): + cr, uid, context = http.request.cr, http.request.uid, http.request.context + Lectures = http.request.registry['academy.lectures'] diff --git a/doc/howto/howto_website/ta-controller b/doc/howto/howto_website/ta-controller index 71a86d7311b..e3fef6d3486 100644 --- a/doc/howto/howto_website/ta-controller +++ b/doc/howto/howto_website/ta-controller @@ -1,10 +1,10 @@ # HG changeset patch -# Parent e95e38d7a1c75741d1f7babf1fe6590b8227888e +# Parent a110c540b0769ee849a404324cf8594d116cc982 diff --git a/controllers/academy.py b/controllers/academy.py --- a/controllers/academy.py +++ b/controllers/academy.py -@@ -3,9 +3,22 @@ +@@ -3,12 +3,45 @@ from openerp import http from openerp.addons.web.controllers import main @@ -25,18 +25,14 @@ diff --git a/controllers/academy.py b/controllers/academy.py + ] + return """ - - -@@ -16,6 +29,26 @@ class academy(main.Home): -

Introduction to a thing

-

Course description

-

Course introduction

-+

Teaching Assistants

-+ - - + + +

Introduction to a thing

++

Teaching Assistants

++ + -""" +""" % { + 'tas': '\n'.join(tas) @@ -48,7 +44,7 @@ diff --git a/controllers/academy.py b/controllers/academy.py + + + AcademyAcademy TA %(name)s -+ ++ + + +

%(name)s

diff --git a/doc/howto/howto_website/ta-model b/doc/howto/howto_website/ta-model index f5fd1013ec6..d3b79299e9c 100644 --- a/doc/howto/howto_website/ta-model +++ b/doc/howto/howto_website/ta-model @@ -1,5 +1,5 @@ # HG changeset patch -# Parent 21954f9743a937b8185a5e717fe6af0e92660c55 +# Parent e8b98f4c8f9070f7d5b91936381324cd1fe12e17 diff --git a/controllers/academy.py b/controllers/academy.py --- a/controllers/academy.py @@ -17,7 +17,7 @@ diff --git a/controllers/academy.py b/controllers/academy.py -] - class academy(main.Home): - @http.route('/', auth='public') + @http.route('/', auth='public', website=True) def index(self): + tas = http.request.registry['academy.tas'].search_read( + http.request.cr, http.request.uid, context=http.request.context) diff --git a/doc/howto/howto_website/templates-basic b/doc/howto/howto_website/templates-basic index f7c63664fef..b857b214f94 100644 --- a/doc/howto/howto_website/templates-basic +++ b/doc/howto/howto_website/templates-basic @@ -1,5 +1,5 @@ # HG changeset patch -# Parent 5342fd2d61587d3ab2c29f88e813b9a402eaa808 +# Parent 93586905ed9663bf48ef33ca6476a537a8f96ac8 diff --git a/__openerp__.py b/__openerp__.py --- a/__openerp__.py @@ -19,7 +19,7 @@ diff --git a/__openerp__.py b/__openerp__.py diff --git a/controllers/academy.py b/controllers/academy.py --- a/controllers/academy.py +++ b/controllers/academy.py -@@ -14,41 +14,18 @@ teaching_assistants = [ +@@ -14,34 +14,17 @@ teaching_assistants = [ class academy(main.Home): @http.route('/', auth='none') def index(self): @@ -30,35 +30,28 @@ diff --git a/controllers/academy.py b/controllers/academy.py ] - return """ -- -- -- AcademyAcademy -- -- -- --

Introduction to a thing

--

Course description

--

Course introduction

--

Teaching Assistants

-- -- -- +- +- +-

Introduction to a thing

+-

Teaching Assistants

+- +- -""" % { - 'tas': '\n'.join(tas) - } +- + return http.request.registry['ir.ui.view'].render(cr, uid, 'academy.index', { + 'tas': '\n'.join(tas) + }, context=context) - @http.route('/tas//', auth='none') def ta(self, id): - return """ - - - AcademyAcademy TA %(name)s -- +- - - -

%(name)s

@@ -67,7 +60,7 @@ diff --git a/controllers/academy.py b/controllers/academy.py -""" % teaching_assistants[id] + cr, uid, context = http.request.cr, http.request.uid, http.request.context + return http.request.registry['ir.ui.view'].render( -+ cr, uid, "academy.ta", teaching_assistants[id], context=context) ++ cr, uid, 'academy.ta', teaching_assistants[id], context=context) diff --git a/views/templates.xml b/views/templates.xml new file mode 100644 --- /dev/null @@ -79,7 +72,7 @@ new file mode 100644 + + + AcademyAcademy -+ ++ + + +

Introduction to a thing

@@ -102,7 +95,7 @@ new file mode 100644 + + + AcademyAcademy TA <t t-esc="name"/> -+ ++ + + +

diff --git a/doc/howto/howto_website/website-dependency b/doc/howto/howto_website/website-dependency index ae310ee4935..37c14e8f2c2 100644 --- a/doc/howto/howto_website/website-dependency +++ b/doc/howto/howto_website/website-dependency @@ -1,5 +1,5 @@ # HG changeset patch -# Parent dce817856f7995c3220ef7261c26b83006c3627e +# Parent 0fdf3e29ce5bb1dd39479f157eeac5bdfd3cffb0 diff --git a/__openerp__.py b/__openerp__.py --- a/__openerp__.py @@ -16,9 +16,12 @@ diff --git a/__openerp__.py b/__openerp__.py diff --git a/controllers/academy.py b/controllers/academy.py --- a/controllers/academy.py +++ b/controllers/academy.py -@@ -14,18 +14,10 @@ teaching_assistants = [ +@@ -12,19 +12,12 @@ teaching_assistants = [ + ] + class academy(main.Home): - @http.route('/', auth='none') +- @http.route('/', auth='none') ++ @http.route('/', auth='none', website=True) def index(self): - cr, uid, context = http.request.cr, http.request.uid, http.request.context - tas = [ @@ -32,13 +35,12 @@ diff --git a/controllers/academy.py b/controllers/academy.py - return http.request.registry['ir.ui.view'].render(cr, uid, 'academy.index', { - 'tas': '\n'.join(tas) - }, context=context) -- - @http.route('/tas//', auth='none') + @http.route('/tas//', auth='none', website=True) def ta(self, id): - cr, uid, context = http.request.cr, http.request.uid, http.request.context - return http.request.registry['ir.ui.view'].render( -- cr, uid, "academy.ta", teaching_assistants[id], context=context) +- cr, uid, 'academy.ta', teaching_assistants[id], context=context) + return http.request.website.render('academy.ta', teaching_assistants[id]) diff --git a/views/templates.xml b/views/templates.xml --- a/views/templates.xml diff --git a/doc/howto/howto_website/website-layoutify b/doc/howto/howto_website/website-layoutify index 2d6aafbcf05..d4ed9647dd5 100644 --- a/doc/howto/howto_website/website-layoutify +++ b/doc/howto/howto_website/website-layoutify @@ -1,5 +1,5 @@ # HG changeset patch -# Parent 006b3182bb96e16310fd6fc4be808bd5698f1ab6 +# Parent 69c500d7634c0e5287508cfaffa14174cc47d800 diff --git a/controllers/academy.py b/controllers/academy.py --- a/controllers/academy.py @@ -8,8 +8,8 @@ diff --git a/controllers/academy.py b/controllers/academy.py ] class academy(main.Home): -- @http.route('/', auth='none') -+ @http.route('/', auth='public') +- @http.route('/', auth='none', website=True) ++ @http.route('/', auth='public', website=True) def index(self): return http.request.website.render('academy.index', { 'tas': teaching_assistants, @@ -29,7 +29,7 @@ diff --git a/views/templates.xml b/views/templates.xml - - - AcademyAcademy -- +- - - -

Introduction to a thing

@@ -83,7 +83,7 @@ diff --git a/views/templates.xml b/views/templates.xml - - - AcademyAcademy TA <t t-esc="name"/> -- +- - - -