[IMP] models: move prefetching of records back to method _prefetch_field
[odoo/odoo.git] / doc / howto / howto_website / website-layoutify
1 # HG changeset patch
2 # Parent 22cbd107041dde59f904e94ea8c740fca5965fc0
3
4 diff --git a/controllers/academy.py b/controllers/academy.py
5 --- a/controllers/academy.py
6 +++ b/controllers/academy.py
7 @@ -12,12 +12,12 @@ teaching_assistants = [
8  ]
9  
10  class academy(main.Home):
11 -    @http.route('/', auth='none')
12 +    @http.route('/', auth='public', website=True)
13      def index(self):
14          return http.request.render('academy.index', {
15              'tas': teaching_assistants,
16          })
17  
18 -    @http.route('/tas/<int:id>/', auth='none')
19 +    @http.route('/tas/<int:id>/', auth='public', website=True)
20      def ta(self, id):
21          return http.request.render('academy.ta', teaching_assistants[id])
22 diff --git a/views/templates.xml b/views/templates.xml
23 --- a/views/templates.xml
24 +++ b/views/templates.xml
25 @@ -1,42 +1,46 @@
26  <openerp>
27      <data>
28 -<template id="index" name="Index">
29 -    <html>
30 -        <head>
31 -            <title>AcademyAcademy</title>
32 -            <link href="/web/static/lib/bootstrap/css/bootstrap.min.css" rel="stylesheet"/>
33 -        </head>
34 -        <body class="container">
35 -            <h1>Introduction to a thing</h1>
36 -            <h2>Course description</h2>
37 -            <p>
38 -                This course will provide a basic introduction to a thing, for
39 -                motivated students with no prior experience in things. The course
40 -                will focus on the discovery of things and the planning and
41 -                organization necessary to handle things.
42 -            </p>
43 -            <h2>Teaching Assistants</h2>
44 -            <ul>
45 -                <li t-foreach="tas" t-as="ta">
46 -                    <a t-att-href="url_for('/tas/%d/' % ta_index)">
47 -                        <t t-esc="ta['name']"/>
48 -                    </a>
49 -                </li>
50 -            </ul>
51 -        </body>
52 -    </html>
53 +<template id="academy.index" name="Index">
54 +    <t t-call="website.layout">
55 +        <div id="wrap">
56 +            <div class="oe_structure"/>
57 +            <div class="oe_structure">
58 +                <div class="container">
59 +                    <h1>Introduction to a thing</h1>
60 +                    <h2>Course description</h2>
61 +                    <p>
62 +                        This course will provide a basic introduction to a thing, for
63 +                        motivated students with no prior experience in things. The course
64 +                        will focus on the discovery of things and the planning and
65 +                        organization necessary to handle things.
66 +                    </p>
67 +                    <h2>Teaching Assistants</h2>
68 +                    <ul>
69 +                        <li t-foreach="tas" t-as="ta">
70 +                            <a t-att-href="url_for('/tas/%d/' % ta_index)">
71 +                                <t t-esc="ta['name']"/>
72 +                            </a>
73 +                        </li>
74 +                    </ul>
75 +                </div>
76 +            </div>
77 +            <div class="oe_structure"/>
78 +        </div>
79 +    </t>
80  </template>
81  
82 -<template id="ta" name="Teaching Assistant">
83 -    <html>
84 -        <head>
85 -            <title>AcademyAcademy TA <t t-esc="name"/></title>
86 -            <link href="/web/static/lib/bootstrap/css/bootstrap.min.css" rel="stylesheet"/>
87 -        </head>
88 -        <body class="container">
89 -            <h1><t t-esc="name"/></h1>
90 -        </body>
91 -    </html>
92 +<template id="academy.ta" name="Teaching Assistant">
93 +    <t t-call="website.layout">
94 +        <div id="wrap">
95 +            <div class="oe_structure"/>
96 +            <div class="oe_structure">
97 +                <div class="container">
98 +                    <h1><t t-esc="name"/></h1>
99 +                </div>
100 +            </div>
101 +            <div class="oe_structure"/>
102 +        </div>
103 +    </t>
104  </template>
105  
106      </data>