[FIX] website: create button and help (fix inherit_id in modules)
[odoo/odoo.git] / addons / website_blog / views / website_blog_templates.xml
1 <?xml version="1.0" encoding="utf-8"?>
2 <openerp>
3 <data>
4     <template id="secure_layout" inherit_id="website.secure_layout">
5         <xpath expr="//t[@id='editable_scripts_hook']" position="inside">
6             <script type="text/javascript" src="/website_blog/static/src/js/website_blog.editor.js" t-ignore="true"></script>
7             <script type="text/javascript" src="/website_blog/static/src/js/website.tour.blog.js" t-ignore="true"></script>
8         </xpath>
9     </template>
10
11     <!-- Layout add nav and footer -->
12     <template id="header_footer_custom" inherit_id="website.layout" name="Footer News Blog Link">
13         <xpath expr="//footer//div[@name='info']/ul" position="inside">
14             <li><a t-href="/blog/%(website_blog.blog_category_1)d/">News</a></li>
15         </xpath>
16     </template>
17
18     <!-- Blog Post Summary -->
19     <template id="latest_blogs" name="Latest Blogs">
20         <t t-call="website.layout">
21             <div id="wrap">
22                 <div class="oe_structure"/>
23                 <section t-if="editable">
24                     <div class="container text-center mt16">
25                         <div class="alert alert-warning alert-dismissable">
26                            <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&amp;times;</button>
27                            <p>
28                            This page is great to improve your <strong>Search Engine Optimization</strong>;
29                            You can review titles, keywords and descriptions of all blogs at once.
30                            </p><p>
31                            You should <strong>add a banner on the top</strong> as it is a frequent landing page for new visitors.
32                            <span class="text-muted">This box will not be visible to your visitors.</span>
33                            </p>
34                         </div>
35                     </div>
36                 </section>
37                 <section class="container">
38                     <t t-call="website.pager" >
39                         <t t-set="classname">pull-right</t>
40                     </t>
41                 </section>
42                 <section data-snippet-id="title" class="container">
43                     <div class="row">
44                         <div class="col-md-12 text-center">
45                             <h1>Latest Blogs</h1>
46                         </div>
47                     </div>
48                 </section>
49                 <section class="container">
50                     <div class="row">
51                         <t t-set="count" t-value="0"/>
52                         <t t-foreach="blogs" t-as="blog">
53                           <div class="col-md-4">
54                             <h4>
55                                 <a t-href="/blogpost/#{ slug(blog) }?#{ tag and 'tag=%s' % tag.id or '' }#{tag and date and '&amp;' or ''}#{ date and 'date=%s' % date or ''}" t-field="blog.name"></a>
56                                 <span t-if="not blog.website_published" class="text-warning">
57                                     &amp;nbsp;
58                                     <span class="fa fa-warning" title="Not published"/>
59                                 </span>
60                             </h4>
61                             <div class="text-muted">
62                                 <span class="fa fa-calendar"> <span t-field="blog.create_date"/> &amp;nbsp;</span>
63                                 <span class="fa fa-folder-open"> In
64                                     <a t-href="/blog/#{ slug(blog.category_id) }">
65                                     <span t-field="blog.category_id"/>
66                                     </a> &amp;nbsp;
67                                 </span>
68                             </div>
69                             <div class="text-muted fa fa-tags">
70                                 <span t-field="blog.website_meta_keywords"/>
71                                 <span t-if="editable and not blog.website_meta_keywords" class="label label-danger">
72                                     No keywords defined!
73                                 </span>
74                             </div>
75                             <div class="text-muted" t-if="len(blog.message_ids) &gt; 0">
76                                 <span class="fa fa-comment-o">
77                                     <a t-href="/blogpost/#{ slug(blog) }/?#{ tag and 'tag=%s' % tag.id or '' }#{tag and date and '&amp;' or ''}#{ date and 'date=%s' % date or ''}#comment">
78                                         <t t-if="len(blog.message_ids) &lt;= 1" ><t t-esc="len(blog.message_ids)"/> comment</t>
79                                         <t t-if="len(blog.message_ids) > 1"><t t-esc="len(blog.message_ids)"/> comments</t>
80                                     </a>
81                                 </span>
82                             </div>
83                             <div class="text-muted mb16" t-field="blog.website_meta_description"/>
84                           </div>
85                           <t t-set="count" t-value="count+1"/>
86                           <div class="clearfix" t-if="(count % 3) == 0"/>
87                         </t>
88                     </div>
89                 </section>
90                 <div class="oe_structure"/>
91             </div>
92         </t>
93     </template>
94
95
96     <!-- Blog Post Summary -->
97     <template id="blog_post_short" name="Blog Post Summary">
98         <t t-call="website_blog.index">
99         <div t-if="not blog_posts">
100             <h1>
101                 No blog post yet!
102             </h1>
103             <p t-if="editable">
104                 To create a new blog post, use the top-right menu <em>Content</em>
105                 and select the menuitem <em>New Blog Post</em>.
106             </p>
107
108         </div>
109         <t t-foreach="blog_posts" t-as="blog_post">
110           <div t-att-data-publish="blog_post.website_published and 'on' or 'off'">
111             <h2 class="text-center">
112                 <a t-href="/blogpost/#{ slug(blog_post) }/?#{ tag and 'tag=%s' % tag.id or '' }#{tag and date and '&amp;' or ''}#{ date and 'date=%s' % date or ''}" t-field="blog_post.name"></a>
113             </h2>
114             <p class="post-meta text-muted text-center" name='blog_post_data'>
115                 <span class="fa fa-calendar oe_date"> <span t-field="blog_post.create_date"/> &amp;nbsp;</span>
116                 <span t-if="len(blog_post.message_ids) &gt; 0" class="fa fa-comment-o">
117                     <a t-href="/blogpost/#{ slug(blog_post) }/?#{ tag and 'tag=%s' % tag.id or '' }#{tag and date and '&amp;' or ''}#{ date and 'date=%s' % date or ''}#comment">
118                         <t t-if="len(blog_post.message_ids) &lt;= 1" ><t t-esc="len(blog_post.message_ids)"/> comment</t>
119                         <t t-if="len(blog_post.message_ids) > 1"><t t-esc="len(blog_post.message_ids)"/> comments</t>
120                     </a>
121                 </span>
122                 <span t-if="not blog_post.website_published" class="label label-danger">not published</span>
123             </p>
124             <div t-raw="blog_post.shortened_content" class="blog_content"/>
125             <hr/>
126           </div>
127
128         </t>
129         </t>
130     </template>
131
132     <!-- Options: Blog Post Summary: hide author -->
133     <template id="opt_blog_post_short_author" name="Author"
134             inherit_option_id="website_blog.blog_post_short">
135         <xpath expr="//span[@class*='oe_date']" position="after">
136             <span class="fa fa-user"> By <span t-field="blog_post.create_uid"/> &amp;nbsp;</span>
137         </xpath>
138     </template>
139
140     <!-- Option: Blog Post Summary: show tags -->
141     <template id="opt_blog_post_short_tags" name="Tags"
142             inherit_option_id="website_blog.blog_post_short" inherit_id="website_blog.blog_post_short">
143         <xpath expr="//p[@name='blog_post_data']" position="after">
144             <p class="post-meta text-muted text-center" t-if="len(blog_post.tag_ids)">
145                 <span class="fa fa-tags"/>
146                 <t t-foreach="blog_post.tag_ids" t-as="tag">
147                     <a t-href="/blog/#{ slug(category) }/tag/#{ slug(tag) }" t-esc="tag.name"/> &amp;nbsp;
148                 </t>
149             </p>
150         </xpath>
151     </template>
152
153     <!-- Blog Post Complete -->
154     <template id="blog_post_complete" name="Blog Post">
155         <t t-call="website_blog.index">
156
157         <div class="row">
158           <div class="col-sm-9">
159               <ol class="breadcrumb">
160                   <li><a t-href="/blog/#{ slug(category) }"><span t-field="category.name"/></a></li>
161                   <li t-if="tag"><a t-href="/blog/#{ slug(category) }/tag/#{ slug(tag) }"><span t-field="tag.name"/></a></li>
162                   <li t-if="tag and date"><a t-href="/blog/#{ slug(category) }/tag/#{ slug(tag) }/date/#{ date }" t-esc="date_name"/></li>
163                   <li t-if="not tag and date"><a t-href="/blog/#{ slug(category) }/date/#{ date }" t-esc="date_name"/></li>
164                   <li class="active"><span t-field="blog_post.name"/></li>
165               </ol>
166           </div><div class="col-sm-3">
167             <t t-call="website.publish_management">
168                 <t t-set="object" t-value="blog_post"/>
169                 <t t-set="publish_edit" t-value="True"/>
170                 <li t-ignore="True">
171                     <form class="duplicate hidden" action="/blogpost/duplicate">
172                         <input name="blog_post_id" t-att-value="blog_post.id"/>
173                     </form>
174                     <a href="#" class="duplicate" onclick="$(this).prev('form').submit()">Duplicate</a>
175                 </li>
176             </t>
177           </div>
178         </div>
179
180         <div class="clearfix"/>
181
182         <h1 class="text-center" t-field="blog_post.name"/>
183         <p class="post-meta text-muted text-center" name="blog_post_data">
184             <span class="fa fa-calendar"> <span t-field="blog_post.create_date"/> &amp;nbsp;</span>
185             <span t-if="len(blog_post.message_ids) &gt; 0" class="fa fa-comment-o"> With
186                 <a t-attf-href="#comments">
187                     <t t-if="len(blog_post.message_ids) &lt;= 1" ><t t-esc="len(blog_post.message_ids)"/> comment</t>
188                     <t t-if="len(blog_post.message_ids) > 1"><t t-esc="len(blog_post.message_ids)"/> comments</t>
189                 </a>
190             </span>
191         </p>
192
193         <div t-field="blog_post.content" class="mt16"/>
194         <hr class="mb32"/>
195
196         <a id="comments"/>
197         <ul class="media-list" id="comments-list">
198             <li t-foreach="blog_post.website_message_ids" t-as="message" class="media">
199                 <div class="media-body">
200                     <img class="media-object pull-left" t-att-src="'/website/image?model=res.partner&amp;field=image_small&amp;id='+str(message.author_id.id)" style="width: 50px; margin-right: 10px;"/>
201                     <div class="media-body">
202                         <t t-call="website.publish_short">
203                             <t t-set="object" t-value="message"/>
204                         </t>
205                         <h5 class="media-heading">
206                             <span t-field="message.author_id"/> <small>on <span t-field="message.date"/></small>
207                         </h5>
208                         <div t-field="message.body"/>
209                     </div>
210                 </div>
211             </li>
212         </ul>
213         </t>
214     </template>
215
216     <!-- Options: Blog Post: user can reply -->
217     <template id="opt_blog_post_complete_comment" name="Allow Comments"
218             inherit_option_id="website_blog.blog_post_complete" inherit_id="website_blog.blog_post_complete"
219             groups="website_mail.group_comment">
220         <xpath expr="//ul[@id='comments-list']" position="after">
221             <section class="mb32">
222                 <form id="comment" t-attf-action="/blogpost/#{blog_post.id}/comment"
223                         method="POST">
224                     <img class="img pull-left img-rounded" t-att-src="'/website/image?model=res.partner&amp;field=image_small&amp;id='+str(user_id.partner_id.id)" style="width: 50px; margin-right: 10px;"/>
225                     <div class="pull-left mb32" style="width: 75%%">
226                         <textarea rows="3" name="comment" class="form-control" placeholder="Write a comment..."></textarea>
227                         <button type="submit" class="btn btn-primary mt8">Post</button>
228                     </div>
229                 </form>
230             </section>
231             <div class="clearfix"/>
232         </xpath>
233     </template>
234
235     <!-- Options: Blog Post: hide author -->
236     <template id="opt_blog_post_complete_author" name="Authors"
237             inherit_option_id="website_blog.blog_post_complete">
238         <xpath expr="//span[@class*='oe_date']" position="after">
239             <span class="fa fa-user"> By <span t-field="blog_post.create_uid"/> &amp;nbsp;</span>
240         </xpath>
241     </template>
242
243     <!-- Options: Blog Post: show category -->
244     <template id="opt_blog_post_complete_category" name="Blog Category"
245             inherit_option_id="website_blog.blog_post_complete">
246         <xpath expr="//span[@class*='oe_date']" position="after">
247             <span class="fa fa-folder-open"> In <span t-field="blog_post.category_id"/> &amp;nbsp;</span>
248         </xpath>
249     </template>
250
251     <!-- Options: Blog Post: show tags -->
252     <template id="opt_blog_post_complete_tags" name="Tags"
253             inherit_option_id="website_blog.blog_post_complete" inherit_id="website_blog.blog_post_complete">
254         <xpath expr="//p[@name='blog_post_data']" position="after">
255             <p class="post-meta text-muted text-center" t-if="len(blog_post.tag_ids)">
256                 <span class="fa fa-tags"/>
257                 <t t-foreach="blog_post.tag_ids" t-as="tag">
258                     <a t-href="/blog/#{ slug(category) }/tag/#{ slug(tag) }" t-esc="tag.name"/> &amp;nbsp;
259                 </t>
260             </p>
261         </xpath>
262     </template>
263
264     <!-- Page -->
265     <template id="index" name="Blog Navigation">
266         <t t-call="website.layout">
267             <t t-set="head">
268                 <link rel='stylesheet' href='/website_blog/static/src/css/website_blog.css'/>
269             </t>
270             <div id="wrap">
271                 <div class="oe_structure"></div>
272                 <div class="container mt16 js_website_blog">
273                     <div class="row">
274                         <div class="col-lg-12 col-sm-12" id="blog_left_column">
275                             <t t-raw="0"/>
276                         </div>
277                         <div class="col-lg-3 col-lg-offset-1 col-sm-4" id="blog_right_column"/>
278                     </div>
279                 </div>
280                 <div class="oe_structure"></div>
281             </div>
282         </t>
283     </template>
284
285     <!-- Option: Right Column: tags -->
286     <template id="opt_blog_rc_tags" name="Tags"
287             inherit_option_id="website_blog.index" inherit_id="website_blog.index">
288         <xpath expr="//div[@id='blog_right_column']" position="inside">
289             <section class="mt32">
290             <h4>Tags</h4>
291             <ul class="nav nav-pills nav-stacked">
292                 <t t-foreach="tags" t-as="tag_id">
293                 <li t-att-class="tag and tag_id.id == tag.id and 'active' or None" style="display: inline-block;">
294                     <a t-href="/blog/#{ slug(category) }/tag/#{ slug(tag_id) }"><span t-field="tag_id.name"/></a>
295                 </li>
296                 </t>
297             </ul>
298             </section>
299         </xpath>
300     </template>
301
302     <!-- Option: Right Column: archives -->
303     <template id="opt_blog_rc_history" name="Archives"
304             inherit_option_id="website_blog.index" inherit_id="website_blog.index">
305         <xpath expr="//div[@id='blog_left_column']" position="attributes">
306             <attribute name="class">col-lg-8 col-sm-8</attribute>
307         </xpath>
308         <xpath expr="//div[@id='blog_right_column']" position="inside">
309             <section class="mt32">
310             <h4>Archives</h4>
311             <ul class="nav nav-pills nav-stacked">
312                 <t t-foreach="nav_list" t-as="months">
313                 <li t-att-class="months['date'] == date and 'active' or None">
314                     <a t-ignore="True" t-href="/blog/#{ slug(category) }/#{ tag and 'tag/%s/' % slug(tag) or '' }date/#{ months['date'] }"><t t-esc="months['create_date']"/><span class="pull-right badge" t-esc="months['create_date_count']"/></a>
315                 </li>
316                 </t>
317             </ul>
318             </section>
319         </xpath>
320     </template>
321
322     <!-- Option: Right Column: about us -->
323     <template id="opt_blog_rc_about_us" name="About Us" priority="2"
324             inherit_option_id="website_blog.index" inherit_id="website_blog.index">
325         <xpath expr="//div[@id='blog_left_column']" position="attributes">
326             <attribute name="class">col-lg-8 col-sm-8</attribute>
327         </xpath>
328         <xpath expr="//div[@id='blog_right_column']" position="inside">
329             <section class="mt32">
330             <h4>About us</h4>
331             <p>
332                 Write here a small text for <b>new visitors</b> finding your website
333                 through your <b>blog entries</b>, referenced in Google.
334             </p>
335             <div>
336                 <a href="/page/website.contactus"><button class="btn btn-primary">Contact us</button></a>
337             </div>
338             </section>
339         </xpath>
340     </template>
341
342     <!-- Option: Right Column: follow us -->
343     <template id="opt_blog_rc_follow_us" name="Follow us" priority="4"
344             inherit_option_id="website_blog.index" inherit_id="website_blog.index">
345         <xpath expr="//div[@id='blog_left_column']" position="attributes">
346             <attribute name="class">col-lg-8 col-sm-8</attribute>
347         </xpath>
348         <xpath expr="//div[@id='blog_right_column']" position="inside">
349             <section class="mt32">
350                 <h4>Follow us<small t-if="category">: <t t-esc="category.name"/></small></h4>
351                 <t t-if="category">
352                     <t t-call="website_mail.follow">
353                         <t t-set="email" t-value="user_id.email"/>
354                         <t t-set="object" t-value="category"/>
355                     </t>
356                 </t>
357                 <p class="text-muted mb0 mt16">
358                     Participate on our social stream.
359                 </p>
360                 <h2 class="mt4">
361                     <a t-att-href="website.social_facebook" t-if="website.social_facebook"><i class="fa fa-facebook-square"/></a>
362                     <a t-att-href="website.social_twitter" t-if="website.social_twitter"><i class="fa fa-twitter"/></a>
363                     <a t-att-href="website.social_linkedin" t-if="website.social_linkedin"><i class="fa fa-linkedin"/></a>
364                     <a t-att-href="website.social_youtube" t-if="website.social_youtube"><i class="fa fa-youtube-play"/></a>
365                     <a t-att-href="website.social_googleplus" t-if="website.social_googleplus"><i class="fa fa-google-plus-square"/></a>
366                     <a t-att-href="website.social_github" t-if="website.social_github"><i class="fa fa-github"/></a>
367                 </h2>
368             </section>
369         </xpath>
370     </template>
371
372     <!-- Option: Right Column: categories -->
373     <template id="opt_blog_rc_categories" name="Our Blogs" priority="6"
374             inherit_option_id="website_blog.index">
375         <xpath expr="//div[@id='blog_left_column']" position="attributes">
376             <attribute name="class">col-lg-8 col-sm-8</attribute>
377         </xpath>
378         <xpath expr="//div[@id='blog_right_column']" position="inside">
379             <section class="mt32 mb32">
380             <h4>Our Blogs</h4>
381             <ul class="nav nav-pills nav-stacked">
382                 <t t-foreach="categories" t-as="nav_category">
383                     <li t-att-class="nav_category.id == category.id and 'active' or ''">
384                         <a t-href="/blog/#{ slug(nav_category) }">
385                             <span t-field="nav_category.name"/>
386                         </a>
387                     </li>
388                 </t>
389             </ul>
390             </section>
391         </xpath>
392     </template>
393
394 </data>
395 </openerp>