website_blog_templates.xml 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <openerp>
  3. <data>
  4. <template id="assets_editor" inherit_id="website.assets_editor" name="Blog Editor" groups="base.group_website_publisher">
  5. <xpath expr="." position="inside">
  6. <script type="text/javascript" src="/website_blog/static/src/js/website_blog.editor.js"></script>
  7. <script type="text/javascript" src="/website_blog/static/src/js/website.tour.blog.js"></script>
  8. </xpath>
  9. </template>
  10. <!-- Layout add nav and footer -->
  11. <template id="header_footer_custom" inherit_id="website.footer_default" name="Footer News Blog Link">
  12. <xpath expr="//div[@id='info']/ul" position="inside">
  13. <li><a t-attf-href="/blog/%(website_blog.blog_blog_1)d">News</a></li>
  14. </xpath>
  15. </template>
  16. <!-- Overview of all blog posts -->
  17. <template id="latest_blogs" name="Latest Blogs">
  18. <t t-call="website.layout">
  19. <div id="wrap">
  20. <div class="oe_structure"/>
  21. <section class="container">
  22. <div class="alert alert-warning alert-dismissable mt16" groups="base.group_website_publisher">
  23. <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&amp;times;</button>
  24. <p>
  25. This page is great to improve your <strong>Search Engine Optimization</strong>;
  26. You can review titles, keywords and descriptions of all blogs at once.
  27. </p><p>
  28. You should <strong>add a banner on the top</strong> as it is a frequent landing page for new visitors.
  29. <span class="text-muted">This box will not be visible to your visitors.</span>
  30. </p>
  31. </div>
  32. <t t-call="website.pager" >
  33. <t t-set="classname">pull-right</t>
  34. </t>
  35. </section>
  36. <section data-snippet-id="title" class="container">
  37. <div class="row">
  38. <div class="col-md-12 text-center">
  39. <h1>Latest Posts</h1>
  40. </div>
  41. </div>
  42. </section>
  43. <section class="container">
  44. <div class="row">
  45. <t t-set="count" t-value="0"/>
  46. <t t-foreach="posts" t-as="post">
  47. <div class="col-md-4">
  48. <h4>
  49. <a t-attf-href="#{blog_url('', ['blog', 'post'], blog=post.blog_id, post=post)}" t-field="post.name"></a>
  50. <span t-if="not post.website_published" class="text-warning">
  51. &amp;nbsp;
  52. <span class="fa fa-warning" title="Not published"/>
  53. </span>
  54. </h4>
  55. <div class="text-muted">
  56. <span class="fa fa-calendar"> <span t-field="post.create_date"/> &amp;nbsp;</span>
  57. <span class="fa fa-folder-open"> In
  58. <a t-attf-href="#{blog_url(blog=post.blog_id)}">
  59. <span t-field="post.blog_id"/>
  60. </a> &amp;nbsp;
  61. </span>
  62. </div>
  63. <div class="text-muted fa fa-tags">
  64. <span t-field="post.website_meta_keywords"/>
  65. <span t-if="editable and not post.website_meta_keywords" class="label label-danger">
  66. No keywords defined!
  67. </span>
  68. </div>
  69. <div class="text-muted" t-if="len(post.message_ids) &gt; 0">
  70. <span class="fa fa-comment-o">
  71. <a t-attf-href="#{blog_url('', ['blogpost'], blogpost=post)}#comments">
  72. <t t-if="len(post.message_ids) &lt;= 1" ><t t-esc="len(post.message_ids)"/> comment</t>
  73. <t t-if="len(post.message_ids) > 1"><t t-esc="len(post.message_ids)"/> comments</t>
  74. </a>
  75. </span>
  76. </div>
  77. <div class="text-muted mb16" t-field="post.website_meta_description"/>
  78. </div>
  79. <t t-set="count" t-value="count+1"/>
  80. <div class="clearfix" t-if="(count % 3) == 0"/>
  81. </t>
  82. </div>
  83. </section>
  84. <div class="oe_structure"/>
  85. </div>
  86. </t>
  87. </template>
  88. <!-- Blog Post List: Displaying a list of Blog Posts -->
  89. <template id="blog_post_short" name="Blog Posts">
  90. <t t-call="website_blog.index">
  91. <div class="oe_structure">
  92. <section class="mb0">
  93. <div class="container">
  94. <div class="row">
  95. <t t-call="website.pager" >
  96. <t t-set="classname">pull-right</t>
  97. </t>
  98. <div class="col-md-12 mb32 mt16 text-center">
  99. <h1 t-field="blog.name"/>
  100. <h3 class="text-muted" t-field="blog.subtitle"/>
  101. </div>
  102. </div>
  103. </div>
  104. </section>
  105. </div>
  106. <div class="container">
  107. <div class="row">
  108. <div class="col-md-8 col-md-offset-2" t-ignore="True" id="main_column">
  109. <div t-if="not blog_posts" class="container mb64">
  110. <p class="css_editable_hidden">
  111. <h1>No blog post yet.</h1>
  112. </p>
  113. <p groups="base.group_document_user">
  114. Click on "Content" on the top menu to write your first blog post.
  115. </p>
  116. </div>
  117. <div t-foreach="blog_posts" t-as="blog_post" class="mb32">
  118. <span t-field="blog_post.author_avatar" t-field-options='{"widget": "image", "class": "img-circle pull-right mt16 media-object"}' />
  119. <a t-attf-href="/blog/#{ slug(blog_post.blog_id) }/post/#{ slug(blog_post) }">
  120. <h2 t-field="blog_post.name" class="mb4"/>
  121. </a>
  122. <div class="text-muted">
  123. <h4
  124. t-field="blog_post.subtitle"
  125. class="mb4 mt4"/>
  126. <div name='blog_post_data' class='mb0'>
  127. <span t-field="blog_post.author_id" style="display: inline-block;" t-field-options='{
  128. "widget": "contact",
  129. "fields": ["name"]
  130. }'/>
  131. &#5760; <span t-field="blog_post.create_date" t-field-options='{"format": "MMMM yyyy"}'/>
  132. <span t-if="len(blog_post.message_ids) &gt; 0">
  133. &#5760; <t t-esc="len(blog_post.message_ids)"/>
  134. <t t-if="len(blog_post.message_ids) &lt;= 1" >comment</t>
  135. <t t-if="len(blog_post.message_ids) > 1">comments</t>
  136. </span>
  137. <span t-if="not blog_post.website_published" class="label label-danger">not published</span>
  138. </div>
  139. </div>
  140. </div>
  141. </div>
  142. </div>
  143. </div>
  144. <div class="oe_structure"/>
  145. </t>
  146. </template>
  147. <!-- Option: Blog Post List: show tags -->
  148. <template id="opt_blog_post_short_tags" name="Tags"
  149. customize_show="True" inherit_id="website_blog.blog_post_short">
  150. <xpath expr="//*[@name='blog_post_data']" position="inside">
  151. <p class="post-meta text-muted text-center" t-if="len(blog_post.tag_ids)">
  152. <span class="fa fa-tags"/>
  153. <t t-foreach="blog_post.tag_ids" t-as="one_tag">
  154. <a t-attf-href="#{blog_url(tag=one_tag)}" t-esc="one_tag.name"/> &amp;nbsp;
  155. </t>
  156. </p>
  157. </xpath>
  158. </template>
  159. <!-- Blog Post Complete -->
  160. <template id="blog_post_complete" name="Blog Post">
  161. <t t-call="website_blog.index">
  162. <div class="cover js_fullheight" id="title" t-attf-style="background-image: url(#{blog_post.background_image})" t-ignore="True">
  163. <div class="container">
  164. <div class="container text-right mt16">
  165. <div class="btn-group css_non_editable_mode_hidden">
  166. <a id="change_cover" class="btn btn-primary">
  167. Change Cover
  168. </a>
  169. <a id="clear_cover" class="btn btn-danger">
  170. <span class="fa fa-times"/>
  171. </a>
  172. </div>
  173. <div class="cover-storage oe_hidden"></div>
  174. <t t-call="website.publish_management">
  175. <t t-set="object" t-value="blog_post"/>
  176. <t t-set="publish_edit" t-value="True"/>
  177. <li>
  178. <form class="duplicate hidden" action="/blogpost/duplicate">
  179. <input name="blog_post_id" t-att-value="blog_post.id"/>
  180. </form>
  181. <a href="#" class="duplicate" onclick="$(this).prev('form').submit()">Duplicate</a>
  182. </li>
  183. </t>
  184. </div>
  185. </div>
  186. <div class="blog_title">
  187. <h1 t-field="blog_post.name" id="blog_post_name" t-att-data-blog-id="blog_post.id"/>
  188. <h2 t-field="blog_post.subtitle"/>
  189. <p class="post-meta text-muted text-center" name="blog_post_data"/>
  190. <div>
  191. <span t-field="blog_post.author_avatar" t-field-options='{"widget": "image", "class": "img-circle", "style":"width: 30px; margin-right: 10px; display:inline"}' />
  192. <span t-field="blog_post.author_id" style="display: inline-block;" t-field-options='{
  193. "widget": "contact",
  194. "fields": ["name"]
  195. }'/>
  196. </div>
  197. <div t-if="blog_post.background_image" id="blog_angle_down">
  198. <strong><a href="#blog_content" class="fa fa-angle-down fa-3x fa-inverse mt32"/></strong>
  199. </div>
  200. </div>
  201. </div>
  202. <div id="blog_content" t-field="blog_post.content" class="mt32"/>
  203. <section id="comments" class="read_width">
  204. <hr/>
  205. <ul class="media-list" id="comments-list">
  206. <li t-foreach="comments" t-as="message" class="media">
  207. <span class="pull-left">
  208. <img class="media-object img img-circle" t-att-src="website.image_url(message, 'author_avatar')" style="width: 30px"/>
  209. </span>
  210. <div class="media-body">
  211. <t t-call="website.publish_short">
  212. <t t-set="object" t-value="message"/>
  213. </t>
  214. <!-- <strong t-field="message.author_id"/> -->
  215. <span t-field="message.author_id" style="display: inline-block;" t-field-options='{
  216. "widget": "contact",
  217. "fields": ["name"]
  218. }'/>
  219. <span class="text-muted">on <span t-field="message.date"/></span>
  220. <div t-field="message.body" class="discussion_scroll_post"/>
  221. </div>
  222. </li>
  223. </ul>
  224. </section>
  225. <t t-if="next_post">
  226. <div class="cover cover_footer mb0 text-center" t-attf-style="background-image: url(#{next_post.background_image})" t-ignore="True">
  227. <div class="blog_title">
  228. <a class="hidden js_next" t-attf-href="/blog/#{ slug(next_post.blog_id) }/post/#{ slug(next_post) }/#wrap"/>
  229. <h1 t-field="next_post.name"/>
  230. <h2 t-field="next_post.subtitle"/>
  231. <div>
  232. <span t-field="next_post.author_avatar" t-field-options='{"widget": "image", "class": "img-circle", "style":"width: 30px; margin-right: 10px; display:inline"}' />
  233. <span t-field="next_post.author_id" style="display: inline-block;" t-field-options='{
  234. "widget": "contact",
  235. "fields": ["name"]
  236. }'/>
  237. </div>
  238. <p class="mt32">Read Next <span class="fa fa-long-arrow-right"/></p>
  239. </div>
  240. </div>
  241. </t>
  242. </t>
  243. </template>
  244. <!-- Options: Blog Post: breadcrumb -->
  245. <template id="blog_breadcrumb" name="Breadcrumb"
  246. inherit_id="website_blog.blog_post_complete" active="False" customize_show="True">
  247. <xpath expr="//div[@id='title']" position="before">
  248. <div class="container">
  249. <div class="row">
  250. <div class="col-sm-9">
  251. <ol class="breadcrumb">
  252. <li><a t-attf-href="#{blog_url(tag=None, date_begin=None, date_end=None)}"><span t-field="blog.name"/></a></li>
  253. <li t-if="tag"><a t-attf-href="#{blog_url(date_begin=None, date_end=None)}"><span t-field="tag.name"/></a></li>
  254. <li t-if="date"><a t-attf-href="#{blog_url(tag=None)}" t-esc="date"/></li>
  255. <li class="active"><span t-field="blog_post.name"/></li>
  256. </ol>
  257. </div><div class="col-sm-3">
  258. </div>
  259. </div>
  260. </div>
  261. </xpath>
  262. </template>
  263. <!-- Options: Blog Post: user can reply -->
  264. <template id="opt_blog_post_complete_comment" name="Allow blog post comment"
  265. inherit_id="website_blog.blog_post_complete" active="False" customize_show="True"
  266. groups="website_mail.group_comment">
  267. <xpath expr="//ul[@id='comments-list']" position="before">
  268. <section class="mb32 read_width css_editable_mode_hidden">
  269. <form id="comment" t-attf-action="/blogpost/comment" method="POST">
  270. <div class="media">
  271. <span class="pull-left">
  272. <img class="img img-circle media-object" t-att-src="website.image_url(user_id.partner_id, 'image_small')" style="width: 30px"/>
  273. </span>
  274. <div class="media-body">
  275. <input name="blog_post_id" t-att-value="blog_post.id" type="hidden"/>
  276. <textarea rows="3" name="comment" class="form-control" placeholder="Write a comment..."></textarea>
  277. <button type="submit" class="btn btn-primary mt8">Post</button>
  278. </div>
  279. </div>
  280. </form>
  281. </section>
  282. </xpath>
  283. </template>
  284. <!-- Options: Blog Post: user can select text for tweet -->
  285. <template id="opt_blog_post_select_to_tweet" name="Select to Tweet"
  286. inherit_id="website_blog.blog_post_complete" active="False" customize_show="True">
  287. <xpath expr="//div[@id='blog_content']" position="attributes">
  288. <attribute name="class">js_tweet mt32</attribute>
  289. </xpath>
  290. <xpath expr="//div[@id='title']//div[@class='blog_title']" position="attributes">
  291. <attribute name="class">blog_title js_tweet</attribute>
  292. </xpath>
  293. </template>
  294. <!-- Options: Blog Post: user can add Inline Discussion -->
  295. <template id="opt_blog_post_inline_discussion" name="Allow comment in text"
  296. inherit_id="website_blog.blog_post_complete" active="False" customize_show="True">
  297. <xpath expr="//div[@id='blog_content']" position="attributes">
  298. <attribute name="enable_chatter_discuss">True</attribute>
  299. </xpath>
  300. </template>
  301. <!-- Options: Blog Post: show tags -->
  302. <template id="opt_blog_post_complete_tags" name="Tags"
  303. customize_show="True" inherit_id="website_blog.blog_post_complete">
  304. <xpath expr="//p[@name='blog_post_data']" position="after">
  305. <p class="post-meta text-muted text-center" t-if="len(blog_post.tag_ids)">
  306. <span class="fa fa-tags"/>
  307. <t t-foreach="blog_post.tag_ids" t-as="one_tag">
  308. <a t-attf-href="#{blog_url(tag=one_tag)}" t-esc="one_tag.name"/> &amp;nbsp;
  309. </t>
  310. </p>
  311. </xpath>
  312. </template>
  313. <!-- Page -->
  314. <template id="assets_frontend" inherit_id="website.assets_frontend" name="website_blog assets" >
  315. <xpath expr="/t" position="inside">
  316. <link rel='stylesheet' href='/website_blog/static/src/css/website_blog.css'/>
  317. <script type="text/javascript" src="/website_blog/static/src/js/website_blog.inline.discussion.js"></script>
  318. <script type="text/javascript" src="/website_blog/static/src/js/website_blog.js"/>
  319. <script type="text/javascript" src="/website_blog/static/lib/contentshare.js"/>
  320. </xpath>
  321. </template>
  322. <template id="index" name="Blog Navigation">
  323. <t t-call="website.layout">
  324. <div id="wrap" class="js_blog website_blog">
  325. <t t-raw="0"/>
  326. </div>
  327. </t>
  328. </template>
  329. <!-- Option:Right Column for extra info -->
  330. <template id="index_right" name="Right Column"
  331. inherit_id="website_blog.blog_post_short" active="False" customize_show="True">
  332. <xpath expr="//div[@id='main_column']" position="attributes">
  333. <attribute name="class">col-sm-8</attribute>
  334. </xpath>
  335. <xpath expr="//div[@id='main_column']" position="after">
  336. <div class="col-lg-3 col-lg-offset-1 col-sm-4" id="blog_right_column"/>
  337. </xpath>
  338. </template>
  339. <!-- Option:Right Column: tags -->
  340. <template id="opt_blog_rc_tags" name="Tags"
  341. inherit_id="website_blog.index_right" active="False" customize_show="True">
  342. <xpath expr="//div[@id='blog_right_column']" position="inside">
  343. <section class="mt32">
  344. <h4>Tags</h4>
  345. <ul class="nav nav-pills nav-stacked">
  346. <t t-foreach="tags" t-as="nav_tag">
  347. <li t-att-class="tag and tag.id == nav_tag.id and 'active' or None" style="display: inline-block;">
  348. <a t-attf-href="#{blog_url(tag=nav_tag)}"><span t-field="nav_tag.name"/></a>
  349. </li>
  350. </t>
  351. </ul>
  352. </section>
  353. </xpath>
  354. </template>
  355. <!-- Option:Right Column: archives -->
  356. <template id="opt_blog_rc_history" name="Archives"
  357. inherit_id="website_blog.index_right" active="False" customize_show="True">
  358. <xpath expr="//div[@id='blog_right_column']" position="inside">
  359. <section class="mt32">
  360. <h4>Archives</h4>
  361. <ul class="nav nav-pills nav-stacked">
  362. <t t-foreach="nav_list" t-as="months">
  363. <li t-att-class="months['date_begin'] == date and 'active' or None">
  364. <a t-ignore="True" t-attf-href="#{blog_url(date_begin=months['date_begin'], date_end=months['date_end'])}"><t t-esc="months['create_date']"/><span class="pull-right badge" t-esc="months['create_date_count']"/></a>
  365. </li>
  366. </t>
  367. </ul>
  368. </section>
  369. </xpath>
  370. </template>
  371. <!-- Option:Right Column: about us -->
  372. <template id="opt_blog_rc_about_us" name="About Us" priority="2"
  373. inherit_id="website_blog.index_right" active="False" customize_show="True">
  374. <xpath expr="//div[@id='blog_right_column']" position="inside">
  375. <section class="mt32">
  376. <h4>About us</h4>
  377. <p>
  378. Write a small text here for when <b>new visitors</b> find your website
  379. through your <b>blog entries</b>, referenced in Google.
  380. </p>
  381. <div>
  382. <a href="/page/website.contactus"><button class="btn btn-primary">Contact us</button></a>
  383. </div>
  384. </section>
  385. </xpath>
  386. </template>
  387. <!-- Option:Right Column: follow us -->
  388. <template id="opt_blog_rc_follow_us" name="Follow us" priority="4"
  389. inherit_id="website_blog.index_right" active="False" customize_show="True">
  390. <xpath expr="//div[@id='blog_right_column']" position="inside">
  391. <section class="mt32">
  392. <h4>Follow us<small t-if="blog">: <t t-esc="blog.name"/></small></h4>
  393. <t t-if="blog">
  394. <t t-call="website_mail.follow">
  395. <t t-set="email" t-value="user_id.email"/>
  396. <t t-set="object" t-value="blog"/>
  397. </t>
  398. </t>
  399. <p class="text-muted mb0 mt16">
  400. Participate on our social stream.
  401. </p>
  402. <h2 class="mt4">
  403. <a t-att-href="website.social_facebook" t-if="website.social_facebook"><i class="fa fa-facebook-square"/></a>
  404. <a t-att-href="website.social_twitter" t-if="website.social_twitter"><i class="fa fa-twitter"/></a>
  405. <a t-att-href="website.social_linkedin" t-if="website.social_linkedin"><i class="fa fa-linkedin"/></a>
  406. <a t-att-href="website.social_youtube" t-if="website.social_youtube"><i class="fa fa-youtube-play"/></a>
  407. <a t-att-href="website.social_googleplus" t-if="website.social_googleplus"><i class="fa fa-google-plus-square"/></a>
  408. <a t-att-href="website.social_github" t-if="website.social_github"><i class="fa fa-github"/></a>
  409. </h2>
  410. </section>
  411. </xpath>
  412. </template>
  413. <!-- Option:Right Column: blogs -->
  414. <template id="opt_blog_rc_blogs" name="Our Blogs" priority="6"
  415. inherit_id="website_blog.index_right" active="False" customize_show="True">
  416. <xpath expr="//div[@id='blog_right_column']" position="inside">
  417. <section class="mt32 mb32">
  418. <h4>Our Blogs</h4>
  419. <ul class="nav nav-pills nav-stacked">
  420. <t t-foreach="blogs" t-as="nav_blog">
  421. <li t-att-class="nav_blog.id == blog.id and 'active' or ''">
  422. <a t-attf-href="#{blog_url(blog=nav_blog)}">
  423. <span t-field="nav_blog.name"/>
  424. </a>
  425. </li>
  426. </t>
  427. </ul>
  428. </section>
  429. </xpath>
  430. </template>
  431. <!-- User Navbar -->
  432. <template id="content_new_blogpost" inherit_id="website.user_navbar" groups="base.group_document_user">
  433. <xpath expr="//ul[@id='oe_systray']/li/ul[@class='dropdown-menu oe_content_menu']" position="inside">
  434. <li><a href="#" data-action="new_blog_post">New Blog Post</a></li>
  435. </xpath>
  436. </template>
  437. </data>
  438. </openerp>