You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

210 lines
13 KiB

<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<!-- Blog menu-->
<template id="theme_levelup_blog" inherit_id="website_blog.blog_post_short">
<xpath expr="//div[@id='o_wblog_blog_top']" position="replace">
<!-- Banner -->
<section class="banner_about">
<div class="wrapper">
<div class="container">
<div class="banner_content">
Latest Blog
<div class="c_wrapper">
Blog
</div>
</div>
</div>
</div>
</section>
</xpath>
</template>
<template id="levelup_blog_post_loop" inherit_id="website_blog.posts_loop">
<xpath expr="//div[@id='o_wblog_posts_loop']" position="replace">
<div class="oe_structure"/>
<div id="o_wblog_posts_loop"
t-att-class="'o_wblog_list_view' if opt_blog_list_view else ''">
<!-- Allow to filter post by published state. Visible only in edit-mode
and if both published/unpublished number is > 0 -->
<t t-if="state_info" t-set="state"
t-value="state_info['state']"/>
<!-- Check for active options -->
<t t-set="opt_posts_loop_show_cover"
t-value="request.website.viewref('website_blog.opt_posts_loop_show_cover').active"/>
<t t-set="opt_posts_loop_show_author"
t-value="request.website.viewref('website_blog.opt_posts_loop_show_author').active"/>
<t t-set="opt_posts_loop_show_stats"
t-value="request.website.viewref('website_blog.opt_posts_loop_show_stats').active"/>
<t t-set="opt_posts_loop_show_teaser"
t-value="request.website.viewref('website_blog.opt_posts_loop_show_teaser').active"/>
<div groups="website.group_website_designer"
t-if="state_info and (state_info['published'] > 0 and state_info['unpublished'] > 0)">
<div class="bg-200 py-2 mb-4 alert alert-dismissable">
<button type="button" class="close" data-dismiss="alert"
aria-label="Close">&#215;
</button>
<span class="mr-1">Show:</span>
<div class="btn-group btn-group-sm">
<a t-attf-class="btn #{state == 'published' and 'btn-success' or 'btn-default bg-white border'}"
t-attf-href="#{state == 'published' and blog_url(state='') or blog_url(state='published')}">
<i t-attf-class="fa mr-1 #{state == 'published' and 'fa-check-square-o' or 'fa-square-o'}"/>
Published (<t t-esc="state_info['published']"/>)
</a>
<a t-attf-class="btn #{state == 'unpublished' and 'btn-success' or 'btn-default bg-white border'}"
t-attf-href="#{state == 'unpublished' and blog_url(state='') or blog_url(state='unpublished')}">
<i t-attf-class="fa mr-1 #{state == 'unpublished' and 'fa-check-square-o' or 'fa-square-o'}"/>
Unpublished (<t
t-esc="state_info['unpublished']"/>)
</a>
</div>
<div class="pt-1 font-italic small">This box will not be
visible to your visitors
</div>
</div>
</div>
<!-- No blog post yet -->
<div t-if="not posts and not first_post" class="row">
<div class="col">
<h2>No blog post yet.</h2>
<div class="alert alert-info"
groups="website.group_website_designer">
Click on "<b>New</b>" in the top-right corner to
write your first blog post.
</div>
</div>
</div>
<div t-if="posts"
t-attf-class="row #{'mx-n2' if not opt_blog_readable else ''}">
<!-- If posts are filtered by date or tags, show applyed filters -->
<div t-if="tag or date_begin" class="col-12 mb-3">
<div class="h4 mb-3">
<t t-esc="len(posts)"/>
<t t-if="len(posts) &lt; 2">Article</t>
<t t-else="">Articles</t>
</div>
<t t-if="tag">
<!-- Show active tags with a category set -->
<t t-foreach="tag_category" t-as="nav_tag_category">
<t t-call="website_blog.tags_list">
<t t-set='tags'
t-value='nav_tag_category.tag_ids'/>
<t t-set='dismissibleBtn' t-value="True"/>
</t>
</t>
<!-- Show active tags without a category set -->
<t t-call="website_blog.tags_list">
<t t-set='tags' t-value='other_tags'/>
<t t-set='dismissibleBtn' t-value="True"/>
</t>
</t>
<span t-if="date_begin"
class="align-items-baseline border d-inline-flex pl-2 rounded mb-2">
<i class="fa fa-calendar-o mr-2 text-muted"/>
<t t-esc="date_begin"
t-options="{'widget': 'date', 'format': 'MMM yyyy'}"/>
<a t-attf-href="#{blog_url(date_begin=False, date_end=False)}"
class="btn border-0 py-1">
&#215;
</a>
</span>
<hr class="mt-2"/>
</div>
<!-- Define 'colWidth' qWeb variable, to be assigned later.
Adjust accordingly if sidebar and/or readability modes are active. -->
<t t-if="not opt_blog_list_view">
<t t-if="opt_blog_readable">
<t t-if="opt_blog_sidebar_show" t-set="colWidth"
t-value="'col-md-6'"/>
<t t-else="" t-set="colWidth"
t-value="'col-md-6 col-xl-4'"/>
</t>
<t t-else="">
<t t-if="opt_blog_sidebar_show" t-set="colWidth"
t-value="'px-2 col-md-6 col-xl-4'"/>
<t t-else="" t-set="colWidth"
t-value="'px-2 col-sm-6 col-lg-4 col-xl-3'"/>
</t>
</t>
<!-- Loop through posts: exclude the first one if already displayed as top banner -->
<!-- blog started here-->
<t t-set="count" t-value="0"/>
<section class="blog_page">
<div class="wrapper">
<div class="container">
<div class="row">
<div class="col-12 col-lg-8">
<t t-foreach="posts" t-as="blog_post">
<div class="card"
style="overflow: unset !important">
<div class="card_image">
<a t-attf-href="/blog/#{slug(blog_post.blog_id)}/post/#{slug(blog_post)}">
<t t-call="website.record_cover">
<t t-set="_record"
t-value="blog_post"/>
<t t-set="additionnal_classes"
t-value="'o_list_cover o_not_editable ' + (not opt_blog_cards_design and ' rounded overflow-hidden shadow mb-3' or '')"/>
</t>
</a>
</div>
<div class="card-body">
<h5 class="card-title">
<t t-call="website_blog.post_heading"/>
</h5>
<a t-attf-href="/blog/#{slug(blog_post.blog_id)}/#{slug(blog_post)}"
class="text-decoration-none">
<p class="card-text">
<t t-esc="blog_post.teaser"/>
</p>
</a>
</div>
</div>
<!-- List-View Design, add <hr> after post -->
<div t-if="opt_blog_list_view and not blog_post_last"
class="col-12 mt-2 mb-5 px-2">
<hr/>
</div>
</t>
</div>
<div class="col-12 col-lg-4">
<div class="blog_sidebar">
<div class="s_wrapper">
<h4 class="sidebar_heading">
Popular Feeds
</h4>
<t t-foreach="posts"
t-as="blog_post">
<div class="populor_feed">
<div class="img_wrapper">
<a t-attf-href="/blog/#{slug(blog_post.blog_id)}/post/#{slug(blog_post)}">
<t t-call="website.record_cover">
<t t-set="_record"
t-value="blog_post"/>
<t t-set="additionnal_classes"
t-value="'o_list_cover o_not_editable ' + (not opt_blog_cards_design and ' rounded overflow-hidden shadow mb-3' or '')"/>
</t>
</a>
</div>
<div class="p_f_detials">
<div class="date">
<t t-esc="blog_post.post_date"/>
</div>
<a href=""
class="feed_caption">
<h5 class="card-title">
<t t-call="website_blog.post_heading"/>
</h5>
</a>
</div>
</div>
</t>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
</div>
</div>
</xpath>
</template>
</odoo>