website_blog_templates.xml 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <odoo>
  3. <!-- ====== Overall pages layout ===========================================
  4. ============================================================================ -->
  5. <template id="index" name="Blog Navigation">
  6. <t t-call="website.layout">
  7. <div id="wrap" class="js_blog website_blog">
  8. <t t-out="0"/>
  9. <!-- Droppable-area shared across all blog's pages -->
  10. <t t-set="oe_structure_blog_footer_description">Visible in all blogs' pages</t>
  11. <div class="oe_structure oe_empty oe_structure_not_nearest"
  12. id="oe_structure_blog_footer"
  13. t-att-data-editor-sub-message="oe_structure_blog_footer_description"/>
  14. </div>
  15. </t>
  16. </template>
  17. <!-- ====== Blog(s) Index : Displaying a list of Blog Posts ===================
  18. Used by 'All blogs' and 'blog' (to share the same layout options) and to display
  19. list of filtered posts (by date or tag).
  20. ============================================================================ -->
  21. <template id="blog_post_short" name="Blog Posts">
  22. <t t-call="website_blog.index">
  23. <t t-set="head">
  24. <link t-if="blog" t-att-href="'/blog/%s/feed' % (blog.id)" type="application/atom+xml" rel="alternate" title="Atom Feed"/>
  25. <meta t-if="active_tag_ids" name="robots" t-attf-content="none"/>
  26. </t>
  27. <!-- Check for active options: the stored value may be used in sub-templates too -->
  28. <t t-set="opt_blog_cards_design" t-value="is_view_active('website_blog.opt_blog_cards_design')"/>
  29. <t t-set="opt_blog_list_view" t-value="is_view_active('website_blog.opt_blog_list_view')"/>
  30. <t t-set="opt_blog_readable" t-value="is_view_active('website_blog.opt_blog_readable')"/>
  31. <t t-set="opt_blog_sidebar_show" t-value="is_view_active('website_blog.opt_blog_sidebar_show')"/>
  32. <div id="o_wblog_blog_top">
  33. <!-- Selectively display droppable-areas for 'all blogs' or single-blog pages -->
  34. <t t-if="not tag and not date_begin">
  35. <div id="o_wblog_blog_top_droppable">
  36. <t t-if="blog">
  37. <t t-set="oe_structure_blog_single_header_description">Edit the '<t t-esc="blog.name"/>' page header.</t>
  38. <div t-field="blog.content"
  39. class="oe_structure"
  40. t-attf-id="oe_structure_blog_single_header_#{blog.id}"
  41. t-att-data-editor-sub-message="oe_structure_blog_single_header_description"/>
  42. </t>
  43. <t t-elif="blogs">
  44. <t t-set="oe_structure_blog_all_header_description">Edit the 'All Blogs' page header.</t>
  45. <div class="oe_structure"
  46. id="oe_structure_blog_all_header"
  47. t-att-data-editor-sub-message="oe_structure_blog_all_header_description"/>
  48. </t>
  49. </div>
  50. </t>
  51. <t t-else="">
  52. <!-- Droppable-area for filtered results (tags or date) -->
  53. <t t-set="oe_structure_blog_filtered_header_description">Edit the 'Filter Results' page header.</t>
  54. <div class="oe_structure"
  55. id="oe_structure_blog_filtered_header"
  56. t-att-data-editor-sub-message="oe_structure_blog_filtered_header_description"/>
  57. </t>
  58. </div>
  59. <t t-call="website_blog.blogs_nav">
  60. <t t-set="search" t-value="original_search or search"/>
  61. </t>
  62. <section id="o_wblog_index_content" t-att-class="opt_blog_cards_design and 'o_wblog_page_cards_bg'">
  63. <div class="container py-4">
  64. <div t-if="original_search and posts" class="alert alert-warning mt8">
  65. No results found for '<span t-esc="original_search"/>'. Showing results for '<span t-esc="search"/>'.
  66. </div>
  67. <div t-attf-class="row #{opt_blog_sidebar_show and 'justify-content-between' or 'justify-content-center'}">
  68. <div id="o_wblog_posts_loop_container" t-attf-class="col #{'o_container_small mx-0' if opt_blog_list_view else ''}">
  69. <t t-call="website_blog.posts_loop">
  70. <t t-if="not blog" t-set="posts_list_show_parent_blog" t-value="True"/>
  71. </t>
  72. <t t-call="website.pager" >
  73. <t t-set="classname" t-valuef="justify-content-center"/>
  74. <t t-set="extraLinkClass" t-valuef="post_link"/>
  75. </t>
  76. </div>
  77. </div>
  78. </div>
  79. </section>
  80. </t>
  81. </template>
  82. <!-- (Option) Blog: Show latest-post as top banner
  83. Replace top-banner content with the latest published post
  84. -->
  85. <template id="opt_blog_cover_post" name="Top banner - Name / Latest Post" inherit_id="website_blog.blog_post_short" active="True">
  86. <xpath expr="//div[@id='o_wblog_blog_top_droppable']" position="replace">
  87. <div t-if="first_post or blog" class="container">
  88. <div class="row py-4">
  89. <div t-attf-class="mb-3 mb-md-0 #{'col-md-5' if (not opt_blog_list_view and not opt_blog_sidebar_show) else 'col-md-6'}">
  90. <t t-call="website.record_cover">
  91. <t t-set="_record" t-value="blog or first_post"/>
  92. <t t-set="additionnal_classes" t-value="'h-100 py-5 py-md-0 overflow-hidden rounded shadow'"/>
  93. </t>
  94. </div>
  95. <div t-att-class="'col-md-7' if (not opt_blog_list_view and not opt_blog_sidebar_show) else 'col-md-6'">
  96. <div class="container position-relative h-100 d-flex flex-column justify-content-around pt-1 pb-2">
  97. <div t-attf-class="o_wblog_post_title #{'js_tweet' if opt_blog_post_select_to_tweet else ''} #{'js_comment' if opt_blog_post_select_to_comment else ''}">
  98. <t t-if="blog">
  99. <span t-field="blog.name" class="h1 d-block" placeholder="Blog's Title"/>
  100. <div t-field="blog.subtitle" class="h4" placeholder="Subtitle"/>
  101. </t>
  102. <t t-else="first_post">
  103. <div t-if="not date and not tag" class="h4 mb-3 bg-o-color-3 px-2 rounded-1 d-inline-block me-auto">Latest</div>
  104. <a t-attf-href="/blog/#{slug(first_post.blog_id)}/#{slug(first_post)}"
  105. t-field="first_post.name" class="h1 d-block" t-att-data-blog-id="first_post.id" placeholder="Blog Post Title"/>
  106. <div t-field="first_post.subtitle" class="h4" placeholder="Subtitle"/>
  107. <div t-if="not blog" class="d-flex">
  108. <div class="small mt-2 mb-3 me-1">
  109. in <i class="fa fa-folder-open text-muted"/> <a t-attf-href="#{blog_url(blog=first_post.blog_id)}" t-field="first_post.blog_id"/>
  110. </div>
  111. </div>
  112. <div t-field="first_post.teaser" class="mb-4 lead" placeholder=""/>
  113. <div>
  114. <a t-attf-href="/blog/#{slug(first_post.blog_id)}/#{slug(first_post)}" class="btn btn-primary">Read more</a>
  115. </div>
  116. </t>
  117. </div>
  118. </div>
  119. </div>
  120. <div class="col-12 mt-3"> <hr/> </div>
  121. </div>
  122. </div>
  123. </xpath>
  124. </template>
  125. <!-- (Option) Blog: Show latest-post as top banner : 'Full Width' design -->
  126. <template id="opt_blog_cover_post_fullwidth_design" name="Full-Width Cover" inherit_id="website_blog.opt_blog_cover_post" active="True">
  127. <xpath expr="//div[hasclass('container')]" position="replace">
  128. <t t-if="blog or first_post" t-call="website.record_cover">
  129. <t t-set="_record" t-value="blog or first_post"/>
  130. <t t-set="use_filters" t-value="True"/>
  131. <t t-set="use_text_align" t-value="True"/>
  132. <t t-set="additionnal_classes" t-value="'o_wblog_post_page_cover o_record_has_cover cover_auto'"/>
  133. <div class="container position-relative h-100 d-flex flex-column justify-content-around" t-cache="_record">
  134. <div t-attf-class="o_wblog_post_title #{'js_tweet' if opt_blog_post_select_to_tweet else ''} #{'js_comment' if opt_blog_post_select_to_comment else ''}">
  135. <div t-if="not date and not tag and not blog" class="h4 bg-o-color-3 px-2 d-inline-block rounded-1">Latest</div>
  136. <a t-if="not blog and first_post" t-attf-href="/blog/#{slug(first_post.blog_id)}/#{slug(first_post)}" t-att-title="first_post.name" class="text-white text-decoration-none">
  137. <div t-field="first_post.name" id="o_wblog_post_name" t-att-data-blog-id="first_post.id" placeholder="Blog Post Title"/>
  138. <div t-field="first_post.subtitle" id="o_wblog_post_subtitle" placeholder="Subtitle"/>
  139. </a>
  140. <span t-elif="blog" t-att-title="blog.name" class="text-white text-decoration-none">
  141. <div t-field="blog.name" id="o_wblog_post_name" placeholder="Blog Title"/>
  142. <div t-field="blog.subtitle" id="o_wblog_post_subtitle" placeholder="Blog Subtitle"/>
  143. </span>
  144. <div>
  145. <span t-if="not blog and blog_post" class="text-white small mt-2 mb-3">
  146. in <i class="fa fa-folder-open text-white-75"/><a t-attf-href="#{blog_url(blog=blog_post.blog_id)}" class="text-white" t-field="blog_post.blog_id"/>
  147. </span>
  148. <span t-else="">&amp;nbsp;</span>
  149. </div>
  150. </div>
  151. </div>
  152. </t>
  153. </xpath>
  154. </template>
  155. <!-- (Option) Blog: Sidebar : Show -->
  156. <template id="opt_blog_sidebar_show" name="Show Sidebar" inherit_id="website_blog.blog_post_short" active="False">
  157. <xpath expr="//div[@id='o_wblog_posts_loop_container']" position="after">
  158. <div t-if="opt_blog_list_view" class="border-end d-none d-lg-block" style="opacity: 0.5"/>
  159. <div t-attf-class="col-12 col-md-3 d-flex #{opt_blog_list_view and 'col-lg-4' or 'ms-lg-5'}">
  160. <t t-call="website_blog.sidebar_blog_index"/>
  161. </div>
  162. </xpath>
  163. </template>
  164. <!-- (Option) Blog: Posts List: Cards design
  165. Wrap posts in a standard bts cards components
  166. -->
  167. <template id="opt_blog_cards_design" name="'Cards' Design" inherit_id="website_blog.blog_post_short" active="False"/>
  168. <!-- (Option) Blog: Show Posts in list-view
  169. Display post in a list rather than a grid
  170. -->
  171. <template id="opt_blog_list_view" name="List View" inherit_id="website_blog.blog_post_short" active="False"/>
  172. <!-- (Option) Blog: Increase readability
  173. Increase font-size, adapt layout
  174. -->
  175. <template id="opt_blog_readable" name="Increase Readability" inherit_id="website_blog.blog_post_short" active="True"/>
  176. <!-- ====== Blog Post Complete Layout ==========================================
  177. ============================================================================ -->
  178. <template id="website_blog.blog_post_complete" name="Blog Post" track="1">
  179. <t t-call="website_blog.index">
  180. <!-- Check for active options: the stored value may be used in sub-templates too -->
  181. <t t-set="opt_blog_post_readable" t-value="is_view_active('website_blog.opt_blog_post_readable')"/>
  182. <t t-set="opt_blog_post_sidebar" t-value="is_view_active('website_blog.opt_blog_post_sidebar')"/>
  183. <t t-set="opt_blog_post_regular_cover" t-value="is_view_active('website_blog.opt_blog_post_regular_cover')"/>
  184. <t t-set="opt_blog_post_breadcrumb" t-value="is_view_active('website_blog.opt_blog_post_breadcrumb')"/>
  185. <t t-set="opt_blog_post_select_to_tweet" t-value="is_view_active('website_blog.opt_blog_post_select_to_tweet')"/>
  186. <t t-set="opt_blog_post_select_to_comment" t-value="is_view_active('website_blog.opt_blog_post_select_to_comment')"/>
  187. <section id="o_wblog_post_top">
  188. <div id="title" class="blog_header" t-ignore="True">
  189. <t t-call="website.record_cover">
  190. <t t-set="_record" t-value="blog_post"/>
  191. <t t-set="snippet_autofocus" t-value="True"/>
  192. <t t-set="use_filters" t-value="True"/>
  193. <t t-set="use_size" t-value="True"/>
  194. <t t-set="display_opt_name">Blog Post Cover</t>
  195. <t t-set="additionnal_classes" t-value="'o_wblog_post_page_cover'"/>
  196. <div class="container text-center position-relative h-100 d-flex flex-column flex-grow-1 justify-content-around">
  197. <div t-attf-class="o_wblog_post_title #{opt_blog_post_select_to_tweet and 'js_tweet'} #{opt_blog_post_select_to_comment and 'js_comment'}">
  198. <h1 t-field="blog_post.name" id="o_wblog_post_name" class="o_editable_no_shadow" data-oe-expression="blog_post.name" t-att-data-blog-id="blog_post.id" placeholder="Blog Post Title"/>
  199. <div t-field="blog_post.subtitle" id="o_wblog_post_subtitle" class="o_editable_no_shadow" placeholder="Subtitle"/>
  200. </div>
  201. <t t-set="resize_classes" t-value="set(json.loads(_record.cover_properties).get('resize_class', '').split(' '))"/>
  202. <a t-if="{'o_full_screen_height', 'o_half_screen_height', 'cover_full', 'cover_mid'}.intersection(resize_classes)"
  203. id="o_wblog_post_content_jump" href="#o_wblog_post_main"
  204. class="css_editable_mode_hidden justify-content-center align-items-center rounded-circle mx-auto mb-5 text-decoration-none">
  205. <i class="fa fa-angle-down fa-3x text-white" aria-label="To blog content" title="To blog content"/>
  206. </a>
  207. </div>
  208. </t>
  209. </div>
  210. </section>
  211. <section id="o_wblog_post_main" t-attf-class="container pt-4 pb-5 #{'anim' in request.params and 'o_wblog_post_main_transition'}">
  212. <!-- Sidebar-enabled Layout -->
  213. <div t-if="opt_blog_post_sidebar" t-attf-class="mx-auto #{opt_blog_post_readable and 'o_wblog_read_with_sidebar'}">
  214. <div t-attf-class="d-flex flex-column flex-lg-row #{opt_blog_post_readable and 'justify-content-between'}">
  215. <div id="o_wblog_post_content" t-attf-class="#{opt_blog_post_readable and 'o_container_small mx-0 w-100 flex-shrink-0' or 'w-lg-75'}">
  216. <t t-call="website_blog.blog_post_content"/>
  217. </div>
  218. <div id="o_wblog_post_sidebar_col" t-attf-class="ps-lg-5 #{not opt_blog_post_readable and 'flex-grow-1 w-lg-25'}">
  219. <t t-call="website_blog.blog_post_sidebar"/>
  220. </div>
  221. </div>
  222. </div>
  223. <!-- No-Sidebar Layout -->
  224. <div t-if="not opt_blog_post_sidebar" t-attf-class="#{opt_blog_post_readable and 'o_container_small'}">
  225. <div class="d-flex flex-column flex-lg-row">
  226. <div id="o_wblog_post_content" t-attf-class=" #{opt_blog_post_readable and 'o_container_small w-100 flex-shrink-0'}">
  227. <t t-call="website_blog.blog_post_content"/>
  228. </div>
  229. </div>
  230. </div>
  231. </section>
  232. <section id="o_wblog_post_footer"/>
  233. </t>
  234. </template>
  235. <!-- ====== Blog Post Content ==================================================
  236. ============================================================================ -->
  237. <template id="blog_post_content" name="Blog post content">
  238. <t t-if="opt_blog_post_breadcrumb and not opt_blog_post_regular_cover" t-call="website_blog.post_breadcrumbs">
  239. <t t-set="additionnal_classes" t-value="'mb-3 bg-transparent'"></t>
  240. </t>
  241. <div t-field="blog_post.content"
  242. data-editor-message="WRITE HERE OR DRAG BUILDING BLOCKS"
  243. t-attf-class="o_wblog_post_content_field #{'js_tweet' if opt_blog_post_select_to_tweet else ''} #{'js_comment' if opt_blog_post_select_to_comment else ''} #{'o_wblog_read_text' if opt_blog_post_readable else ''}"/>
  244. <div t-if="len(blogs) > 1 or len(blog_post.tag_ids) > 0" class="css_editable_mode_hidden text-muted">
  245. <div t-if="len(blogs) > 1">in <a t-attf-href="#{blog_url(blog=blog_post.blog_id)}"><b t-field="blog.name"/></a></div>
  246. <div t-if="len(blog_post.tag_ids) > 0">#
  247. <t t-foreach="blog_post.tag_ids" t-as="one_tag">
  248. <a class="badge text-primary border me-1 post_link" t-attf-href="#{blog_url(tag=slug(one_tag), date_begin=False, date_end=False)}" t-esc="one_tag.name"/>
  249. </t>
  250. </div>
  251. </div>
  252. </template>
  253. <!-- (Option) Post: Increase readability
  254. Increase font-size, adapt content width
  255. -->
  256. <template id="opt_blog_post_readable" name="Increase Readability" inherit_id="website_blog.blog_post_complete" active="True"/>
  257. <!-- (Option) Post: Show Sidebar
  258. Show sidebar beside the post content
  259. -->
  260. <template id="opt_blog_post_sidebar" name="Show Sidebar" inherit_id="website_blog.blog_post_complete" active="False"/>
  261. <!-- (Option) Post: Regular Cover
  262. Use 'regular cover' design rather than the fullwidth one
  263. -->
  264. <template id="opt_blog_post_regular_cover" name="'Regular' Cover" inherit_id="website_blog.blog_post_complete" active="False">
  265. <xpath expr="//div[@id='title']" position="replace">
  266. <div class="container">
  267. <t t-set="readableClass" t-if="opt_blog_post_readable and opt_blog_post_sidebar" t-value="'o_wblog_read_with_sidebar mx-auto'"/>
  268. <t t-set="readableClass" t-elif="opt_blog_post_readable" t-value="'container'"/>
  269. <div id="title" t-attf-class="blog_header o_wblog_regular_cover_container #{readableClass}">
  270. <t t-if="opt_blog_post_breadcrumb" t-call="website_blog.post_breadcrumbs">
  271. <t t-set="additionnal_classes" t-value="'mt-4 mb-3 bg-transparent'"></t>
  272. </t>
  273. <div t-att-class="not opt_blog_post_breadcrumb and 'pt-4'">
  274. <div t-attf-class="o_wblog_post_title mb-3 #{'js_tweet' if opt_blog_post_select_to_tweet else ''} #{'js_comment' if opt_blog_post_select_to_comment else ''}" t-ignore="False">
  275. <h1 t-field="blog_post.name" id="o_wblog_post_name" data-oe-expression="blog_post.name" t-att-data-blog-id="blog_post.id" placeholder="Title"/>
  276. <div t-field="blog_post.subtitle" id="o_wblog_post_subtitle" placeholder="Subtitle"/>
  277. </div>
  278. <div class="text-muted mb-2">
  279. <i class="fa fa-clock-o fa-fw"/>
  280. <span t-field="blog_post.post_date" class="text-muted" t-options="{'format': 'long', 'date_only': 'true'}"/>
  281. <span>by
  282. <t t-call="website_blog.post_author">
  283. <t t-set="additionnal_classes" t-value="'d-inline-flex me-2'"/>
  284. <t t-set="hide_date" t-value="True"/>
  285. </t>
  286. </span>
  287. <span t-if="len(blog_post.message_ids) > 0" class="text-nowrap ps-2 o_not_editable">|
  288. <i class="fa fa-comment text-muted me-1"/>
  289. <a href="#discussion">
  290. <t t-esc="len(blog_post.message_ids)"/>
  291. <t t-if="len(blog_post.message_ids)>1">Comments</t>
  292. <t t-else="">Comment</t>
  293. </a>
  294. </span>
  295. <span t-elif="is_view_active('website_blog.opt_blog_post_comment')">| No comments yet</span>
  296. </div>
  297. </div>
  298. <t t-call="website.record_cover">
  299. <t t-set="_record" t-value="blog_post"/>
  300. <t t-set="additionnal_classes" t-value="'o_wblog_post_page_cover o_wblog_post_page_cover_regular rounded shadow overflow-hidden'"/>
  301. <t t-set="use_size" t-value="True"/>
  302. </t>
  303. </div>
  304. </div>
  305. </xpath>
  306. </template>
  307. <!-- (Option) Post: Show Breadcrumb
  308. Display navigation breadcrumbs before the post content
  309. -->
  310. <template id="opt_blog_post_breadcrumb" name="Show Breadcrumb" inherit_id="website_blog.blog_post_complete" active="True"/>
  311. <!-- (Option) Post: Select text to Tweet
  312. Allow to select text to tweet it
  313. -->
  314. <template id="opt_blog_post_select_to_tweet" name="Select to Tweet" inherit_id="website_blog.blog_post_complete" active="False"/>
  315. <!-- (Option) Post: Comments
  316. Enable comments
  317. -->
  318. <template id="opt_blog_post_comment" name="Allow Comments" inherit_id="website_blog.blog_post_complete" active="False">
  319. <xpath expr="//section[@id='o_wblog_post_main']" position="inside">
  320. <t t-set="readableClass" t-if="opt_blog_post_readable and opt_blog_post_sidebar" t-value="'o_wblog_read_with_sidebar'"/>
  321. <t t-set="readableClass" t-elif="opt_blog_post_readable" t-value="'o_container_small'"/>
  322. <div class="container">
  323. <div t-attf-class="mx-auto #{readableClass}">
  324. <div id="o_wblog_post_comments" t-attf-class="pt-4 o_container_small">
  325. <div groups="base.group_public" class="small mb-4">
  326. <a t-attf-href="/web/login?redirect=/blog/{{slug(blog_post.blog_id)}}/{{slug(blog_post)}}#discussion" class="btn btn-sm btn-primary"><b>Sign in</b></a> to leave a comment
  327. </div>
  328. <t t-call="portal.message_thread">
  329. <t t-set="object" t-value="blog_post"/>
  330. </t>
  331. </div>
  332. </div>
  333. </div>
  334. </xpath>
  335. </template>
  336. <!-- (Option) Post: Comments: Select text to Comment
  337. Allow to select text to comment it
  338. -->
  339. <template id="opt_blog_post_select_to_comment" name="Select to Comment" inherit_id="website_blog.opt_blog_post_comment" active="False"/>
  340. <!-- (Option) Post : Read Next Article
  341. Show 'read next' banner at the bottom of the page
  342. -->
  343. <template id="opt_blog_post_read_next" name="Read Next Article" inherit_id="website_blog.blog_post_complete" active="True">
  344. <xpath expr="//section[@id='o_wblog_post_footer']" position="inside">
  345. <div t-if="next_post" class="mt-5">
  346. <t t-if="opt_blog_post_regular_cover">
  347. <t t-if="opt_blog_post_sidebar" t-set="readableClass" t-value="'o_wblog_read_with_sidebar'"/>
  348. <t t-else="" t-set="readableClass" t-value="'o_container_small'"/>
  349. <div class="container">
  350. <div t-attf-class="mb-4 mx-auto #{ readableClass if opt_blog_post_readable else ''}">
  351. <hr/>
  352. <div class="d-flex text-end py-4">
  353. <div class="flex-grow-1 pe-3">
  354. <span class="bg-o-color-3 h6 d-inline-block py-1 px-2 rounded-1">Read Next</span>
  355. <a t-att-href="'/blog/' + slug(next_post.blog_id) + '/' + slug(next_post)" t-att-title="'Read next' + next_post.name">
  356. <div t-field="next_post.name" id="o_wblog_post_name" t-att-data-blog-id="next_post.id" placeholder="Blog Post Title" class="h2"/>
  357. <div t-field="next_post.subtitle" id="o_wblog_post_subtitle" placeholder="Subtitle" class="lead"/>
  358. </a>
  359. </div>
  360. <a t-att-href="'/blog/' + slug(next_post.blog_id) + '/' + slug(next_post)" t-att-title="'Read next' + next_post.name" class="w-25">
  361. <t t-call="website.record_cover">
  362. <t t-set="_record" t-value="next_post"/>
  363. <t t-set="additionnal_classes" t-value="'rounded shadow-sm overflow-hidden h-100'"/>
  364. </t>
  365. </a>
  366. </div>
  367. </div>
  368. </div>
  369. </t>
  370. <t t-else="">
  371. <div id="o_wblog_next_container" class="d-flex flex-column" t-cache="next_post">
  372. <t t-call="website.record_cover">
  373. <t t-set="_record" t-value="next_post"/>
  374. <t t-set="_cp" t-value="json.loads(_record.cover_properties)"/>
  375. <t t-set="use_filters" t-value="True"/>
  376. <t t-set="additionnal_classes" t-value="'o_wblog_post_page_cover o_wblog_post_page_cover_footer o_record_has_cover'"/>
  377. <a id="o_wblog_next_post_info" class="d-none"
  378. t-att-data-size="_cp.get('resize_class')"
  379. t-att-data-url="'/blog/' + slug(next_post.blog_id) + '/' + slug(next_post) + '?anim'"/>
  380. <t t-set="next_cover_is_full" t-value="bool({'o_full_screen_height', 'cover_full'}.intersection(_cp.get('resize_class', '').split(' ')))"/>
  381. <t t-set="next_cover_is_auto" t-value="'cover_auto' in _cp.get('resize_class', '')"/>
  382. <div class="container text-center position-relative h-100 d-flex flex-column flex-grow-1 justify-content-around">
  383. <div t-attf-class="o_wblog_post_title">
  384. <div t-field="next_post.name" id="o_wblog_post_name" t-att-data-blog-id="next_post.id" placeholder="Blog Post Title" class="h1"/>
  385. <div t-field="next_post.subtitle" id="o_wblog_post_subtitle" placeholder="Subtitle"/>
  386. </div>
  387. <div t-attf-class="o_wblog_toggle #{next_cover_is_full and 'mb-n5'}">
  388. <span class="h4 d-inline-block py-1 px-2 rounded-1 text-white">
  389. <i class="fa fa-angle-right fa-3x text-white" aria-label="Read next" title="Read Next"/>
  390. </span>
  391. </div>
  392. <!-- Emulate the next post's cover's height. For non-auto covers,
  393. the room that will be occupied by the 'scroll-down' link is temporary
  394. occupied by the loader circle. For auto covers, an empty <div>
  395. creates enought separation.
  396. -->
  397. <div t-if="not next_cover_is_auto" class="o_wblog_next_loader o_wblog_toggle justify-content-center align-items-center mx-auto position-relative d-none">
  398. <div class="rounded-circle bg-black-50"/>
  399. </div>
  400. <div t-else="" class="o_wblog_next_fake_btn d-flex o_wblog_toggle"/>
  401. </div>
  402. </t>
  403. </div>
  404. </t>
  405. </div>
  406. </xpath>
  407. </template>
  408. <!-- ====== Technical Templates ============================================
  409. ============================================================================ -->
  410. <!-- Atom Feed -->
  411. <template id="blog_feed">&lt;?xml version="1.0" encoding="utf-8"?&gt;
  412. <feed t-att-xmlns="'http://www.w3.org/2005/Atom'">
  413. <title t-esc="blog.name"/>
  414. <link t-att-href="'%s/blog/%s' % (base_url ,blog.id)"/>
  415. <id t-esc="'%s/blog/%s' % (base_url, blog.id)"/>
  416. <updated t-esc="str(posts[0].post_date).replace(' ', 'T') + 'Z' if posts else ''"/>
  417. <entry t-foreach="posts" t-as="post">
  418. <title t-esc="post.name"/>
  419. <link t-att-href="'%s%s' % (base_url, post.website_url)"/>
  420. <id t-esc="'%s%s' % (base_url, post.website_url)"/>
  421. <author><name t-esc="post.sudo().author_id.name"/></author>
  422. <summary t-esc="html2plaintext(post.teaser)"/>
  423. <updated t-esc="str(post.post_date).replace(' ', 'T') + 'Z'"/>
  424. </entry>
  425. </feed>
  426. </template>
  427. </odoo>