1 <?xml version="1.0" encoding="utf-8"?>
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>
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>
18 <!-- Blog Post Summary -->
19 <template id="latest_blogs" name="Latest Blogs">
20 <t t-call="website.layout">
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">&times;</button>
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.
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>
37 <section class="container">
38 <t t-call="website.pager" >
39 <t t-set="classname">pull-right</t>
42 <section data-snippet-id="title" class="container">
44 <div class="col-md-12 text-center">
49 <section class="container">
51 <t t-set="count" t-value="0"/>
52 <t t-foreach="blogs" t-as="blog">
53 <div class="col-md-4">
55 <a t-href="/blogpost/#{ slug(blog) }?#{ tag and 'tag=%s' % tag.id or '' }#{tag and date and '&' or ''}#{ date and 'date=%s' % date or ''}" t-field="blog.name"></a>
56 <span t-if="not blog.website_published" class="text-warning">
58 <span class="fa fa-warning" title="Not published"/>
61 <div class="text-muted">
62 <span class="fa fa-calendar"> <span t-field="blog.create_date"/> &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"/>
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">
75 <div class="text-muted" t-if="len(blog.message_ids) > 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 '&' or ''}#{ date and 'date=%s' % date or ''}#comment">
78 <t t-if="len(blog.message_ids) <= 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>
83 <div class="text-muted mb16" t-field="blog.website_meta_description"/>
85 <t t-set="count" t-value="count+1"/>
86 <div class="clearfix" t-if="(count % 3) == 0"/>
90 <div class="oe_structure"/>
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">
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>.
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 '&' or ''}#{ date and 'date=%s' % date or ''}" t-field="blog_post.name"></a>
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"/> &nbsp;</span>
116 <span t-if="len(blog_post.message_ids) > 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 '&' or ''}#{ date and 'date=%s' % date or ''}#comment">
118 <t t-if="len(blog_post.message_ids) <= 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>
122 <span t-if="not blog_post.website_published" class="label label-danger">not published</span>
124 <div t-raw="blog_post.shortened_content" class="blog_content"/>
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"/> &nbsp;</span>
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"/> &nbsp;
153 <!-- Blog Post Complete -->
154 <template id="blog_post_complete" name="Blog Post">
155 <t t-call="website_blog.index">
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>
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"/>
171 <form class="duplicate hidden" action="/blogpost/duplicate">
172 <input name="blog_post_id" t-att-value="blog_post.id"/>
174 <a href="#" class="duplicate" onclick="$(this).prev('form').submit()">Duplicate</a>
180 <div class="clearfix"/>
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"/> &nbsp;</span>
185 <span t-if="len(blog_post.message_ids) > 0" class="fa fa-comment-o"> With
186 <a t-attf-href="#comments">
187 <t t-if="len(blog_post.message_ids) <= 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>
193 <div t-field="blog_post.content" class="mt16"/>
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&field=image_small&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"/>
205 <h5 class="media-heading">
206 <span t-field="message.author_id"/> <small>on <span t-field="message.date"/></small>
208 <div t-field="message.body"/>
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"
224 <img class="img pull-left img-rounded" t-att-src="'/website/image?model=res.partner&field=image_small&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>
231 <div class="clearfix"/>
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"/> &nbsp;</span>
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"/> &nbsp;</span>
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"/> &nbsp;
265 <template id="index" name="Blog Navigation">
266 <t t-call="website.layout">
268 <link rel='stylesheet' href='/website_blog/static/src/css/website_blog.css'/>
271 <div class="oe_structure"></div>
272 <div class="container mt16 js_website_blog">
274 <div class="col-lg-12 col-sm-12" id="blog_left_column">
277 <div class="col-lg-3 col-lg-offset-1 col-sm-4" id="blog_right_column"/>
280 <div class="oe_structure"></div>
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">
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>
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>
308 <xpath expr="//div[@id='blog_right_column']" position="inside">
309 <section class="mt32">
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>
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>
328 <xpath expr="//div[@id='blog_right_column']" position="inside">
329 <section class="mt32">
332 Write here a small text for <b>new visitors</b> finding your website
333 through your <b>blog entries</b>, referenced in Google.
336 <a href="/page/website.contactus"><button class="btn btn-primary">Contact us</button></a>
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>
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>
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"/>
357 <p class="text-muted mb0 mt16">
358 Participate on our social stream.
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>
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>
378 <xpath expr="//div[@id='blog_right_column']" position="inside">
379 <section class="mt32 mb32">
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"/>