<?xml version="1.0" encoding="utf-8"?>
<odoo>

<template id="_assets_primary_variables" inherit_id="web._assets_primary_variables">
    <xpath expr="//link[last()]" position="after">
        <link rel="stylesheet" type="text/scss" href="/website_blog/static/src/scss/primary_variables.scss"/>
    </xpath>
</template>

<template id="assets_editor" inherit_id="website.assets_editor" name="Blog Editor">
    <xpath expr="." position="inside">
        <script type="text/javascript" src="/website_blog/static/src/js/website_blog.editor.js"></script>
        <script type="text/javascript" src="/website_blog/static/src/js/s_latest_posts_editor.js"/>
        <script type="text/javascript" src="/website_blog/static/src/js/website.tour.blog.js"></script>
    </xpath>
</template>

<template id="assets_frontend" inherit_id="website.assets_frontend" name="Blog Front-end assets">
    <xpath expr="." position="inside">
        <link rel="stylesheet" type="text/scss" href="/website_blog/static/src/scss/website_blog.scss"/>

        <script type="text/javascript" src="/website_blog/static/src/js/contentshare.js"/>
        <script type="text/javascript" src="/website_blog/static/src/js/website_blog.js"/>
        <script type="text/javascript" src="/website_blog/static/src/js/s_latest_posts_frontend.js"/>
    </xpath>
</template>

<!-- Overview of all blog posts -->
<template id="latest_blogs" name="Latest Blogs">
    <t t-call="website.layout">
        <div id="wrap">
            <div class="oe_structure" id="oe_structure_website_blog_latest_blogs_1"/>
            <section class="container">
                <div class="alert alert-warning alert-dismissable mt16" groups="website.group_website_publisher" role="status">
                   <button type="button" class="close" data-dismiss="alert" aria-label="Close">&amp;times;</button>
                   <p>
                   This page is great to improve your <strong>Search Engine Optimization</strong>;
                   You can review titles, keywords and descriptions of all blogs at once.
                   </p><p>
                   You should <strong>add a banner on the top</strong> as it is a frequent landing page for new visitors.
                   <span class="text-muted">This box will not be visible to your visitors.</span>
                   </p>
                </div>
                <t t-call="website.pager" >
                    <t t-set="classname">float-right</t>
                </t>
            </section>
            <section class="container">
                <div class="row">
                    <div class="col-lg-12 text-center">
                        <h1>Latest Posts</h1>
                    </div>
                </div>
            </section>
            <section class="container">
                <div class="row">
                    <t t-set="count" t-value="0"/>
                    <t t-foreach="posts" t-as="post">
                      <div class="col-lg-4">
                        <h4>
                            <a t-attf-href="#{blog_url('', ['blog', 'post'], blog=post.blog_id, post=post)}" t-field="post.name"></a>
                            <span t-if="not post.website_published" class="text-warning">
                                <span class="fa fa-exclamation-triangle ml8" title="Unpublished" role="img" aria-label="Unpublished"/>
                            </span>
                        </h4>
                        <div class="text-muted">
                            <span class="fa fa-calendar mr8" role="img" aria-label="Post date" title="Post date" />
                            <span t-field="post.post_date"/>
                            <span class="fa fa-folder-open" /> In
                            <a class="mr8" t-attf-href="#{blog_url(blog=post.blog_id)}">
                            <span t-field="post.blog_id"/>
                            </a>
                        </div>
                        <div class="text-muted">
                            <span t-if="editable or post.tag_ids" class="fa fa-tags" role="img" aria-label="Tags" title="Tags"/>
                            <t t-foreach="post.tag_ids" t-as="one_tag">
                              <a class="badge badge-primary mr8" t-attf-href="#{blog_url('', ['blog', 'post'], blog=post.blog_id, tag=one_tag.id)}" t-esc="one_tag.name"/>
                            </t>
                            <span t-if="editable and not post.tag_ids" class="badge badge-danger">
                                No tags defined!
                            </span>
                        </div>
                        <div class="text-muted" t-if="len(post.message_ids) &gt; 0">
                            <span class="fa fa-comment-o"/>
                            <a t-attf-href="#{blog_url('', ['blogpost'], blogpost=post)}#comments">
                                <t t-if="len(post.message_ids) &lt;= 1" ><t t-esc="len(post.message_ids)"/> comment</t>
                                <t t-if="len(post.message_ids) > 1"><t t-esc="len(post.message_ids)"/> comments</t>
                            </a>
                        </div>
                        <div class="text-muted mb16" t-field="post.website_meta_description"/>
                      </div>
                      <t t-set="count" t-value="count+1"/>
                      <div class="clearfix" t-if="(count % 3) == 0"/>
                    </t>
                </div>
            </section>
            <div class="oe_structure" id="oe_structure_website_blog_latest_blogs_2"/>
        </div>
    </t>
</template>

<!-- Blog Post List: Displaying a list of Blog Posts -->
<template id="blog_post_short" name="Blog Posts">
    <t t-call="website_blog.index">
        <t t-set="head">
            <link t-att-href="'/blog/%s/feed' % (blog.id)" type="application/atom+xml" rel="alternate" title="Atom Feed"/>
            <meta t-if="len(active_tag_ids) > 0" name="robots" t-attf-content="#{len(active_tag_ids) > 1 and 'noindex,'} nofollow"/>
        </t>
        <div class="oe_structure" id="oe_structure_website_blog_post_short_1"/>
        <div class="container">
            <t t-call="website.pager" >
                <t t-set="classname">float-right</t>
            </t>
        </div>
        <div class="oe_structure">
            <section class="mb0">
                <div class="container">
                    <div class="row">
                        <div class="col-lg-12 mb32 mt16 text-center">
                            <h1 t-field="blog.name"/>
                            <h3 class="text-muted" t-field="blog.subtitle"/>
                        </div>
                    </div>
                </div>
            </section>
        </div>
        <div class="container">
            <div class="row">
              <div class="col-lg-8 offset-lg-2" t-ignore="True" id="main_column">

                <div t-if="not blog_posts" class="container mb64">
                    <p class="css_editable_hidden">
                        <h1>No blog post yet.</h1>
                    </p>
                  <p groups="website.group_website_designer">
                        Click on "New Page" in the top-right corner to write your first blog post.
                    </p>
                </div>

                <div t-foreach="blog_posts" t-as="blog_post" class="mb32" name="blog_post">
                    <a t-attf-href="/blog/#{ slug(blog_post.blog_id) }/post/#{ slug(blog_post) }">
                        <h2 t-field="blog_post.name" class="mb4 o_blog_post_title">Untitled Post</h2>
                    </a>
                    <div class="text-muted">
                        <div t-field="blog_post.teaser" class="mb12 mt12 o_blog_post_teaser"/>
                        <div name='blog_post_data' class='mb0'>
                            <span t-field="blog_post.author_id" style="display: inline-block;" t-options='{
                                "widget": "contact",
                                "fields": ["name"]
                            }'/>
                            &amp;mdash; <span t-field="blog_post.post_date" t-options='{"format": "MMMM yyyy"}'/>
                            <span t-if="len(blog_post.message_ids) &gt; 0">
                                &amp;mdash; <t t-esc="len(blog_post.message_ids)"/>
                                <t t-if="len(blog_post.message_ids) &lt;= 1" >comment</t>
                                <t t-if="len(blog_post.message_ids) &gt; 1">comments</t>
                            </span>
                            <span t-if="blog_post.visits &gt; 0">
                                &amp;mdash; <t t-esc="blog_post.visits"/>
                                <t t-if="blog_post.visits &lt;= 1" >view</t>
                                <t t-if="blog_post.visits &gt; 1">views</t>
                            </span>
                            <span t-if="not blog_post.website_published" class="badge badge-danger">unpublished</span>
                            <span class="fa fa-tags" role="img" aria-label="Tags" title="Tags"/>

                            <!-- To display tags //no options -->
                            <t t-foreach="blog_post.tag_ids" t-as="one_tag">
                                <a class="mr8" t-attf-href="#{blog_url(tag=one_tag.id, date_begin=False, date_end=False)}" t-esc="one_tag.name"/>
                            </t>
                            <div class="o_sharing_links">
                                <a class="fa fa-twitter-square o_twitter" aria-label="Twitter" title="Twitter"></a>
                                <a class="fa fa-facebook-square o_facebook" aria-label="Facebook" title="Facebook"></a>
                                <a class="fa fa-linkedin-square o_linkedin" aria-label="LinkedIn" title="LinkedIn"></a>
                                <a class="fa fa-google-plus-square o_google" aria-label="Google Plus" title="Google Plus"></a>
                            </div>
                            <hr/>
                        </div>
                    </div>
                </div>
              </div>
            </div>
        </div>

        <div class="oe_structure" id="oe_structure_website_blog_post_short_2"/>
    </t>
</template>

<template id="blog_cover">
    <div t-attf-class="o_blog_cover_container #{cover_properties.get('resize_class')} #{additionnal_classes or ''}">
        <div class="o_blog_cover_component o_blog_cover_image" t-attf-style="background-image: #{cover_properties.get('background-image')};"/>
        <div t-attf-class="o_blog_cover_component o_blog_cover_filter #{cover_properties.get('background-color')}" t-attf-style="opacity: #{cover_properties.get('opacity', 0.0)};"/>
        <t t-raw="0"/>
    </div>
</template>

<!-- Option: Blog Post List: cover image -->
<template id="opt_blog_post_cover_image" name="Cover image"
        customize_show="True" active="True" inherit_id="website_blog.blog_post_short">
    <xpath expr="//h2[@t-field='blog_post.name']/.." position="before">
        <t t-call="website_blog.blog_cover">
            <t t-set="cover_properties" t-value="blog_posts_cover_properties[blog_post_index]"/>
            <t t-set="additionnal_classes" t-value="'o_list_cover mt16 mb32'"/>
        </t>
    </xpath>
</template>

<!-- Option: Blog Post List: grid layout -->
<template id="opt_blog_post_grid_layout" name="Grid view"
        customize_show="True" active="False" inherit_id="website_blog.blog_post_short">
    <xpath expr="//div[@name='blog_post']" position="attributes">
        <attribute name="class" add="col-md-5 o_grid" separator=" "/>
    </xpath>
</template>

<!-- Option: Blog Post List: display the author avatar -->
<template id="opt_blog_post_author_avatar" name="Author avatar"
        customize_show="True" active="False" inherit_id="website_blog.blog_post_short">
    <xpath expr="//span[@t-field='blog_post.author_id']" position="before">
        <t t-if="blog_post.author_avatar">
            <div t-field="blog_post.author_avatar" class="o_not_editable" style="display:inline" t-options='{"widget": "image", "class": "rounded-circle o_author_avatar_little "}' />
        </t>
    </xpath>
</template>

<!-- Blog Post Complete -->
<template id="blog_edit_options" inherit_id="website.user_navbar" name="Edit Blog Options">
    <xpath expr="//a[@id='edit-in-backend']" position="after">
        <t groups="website.group_website_designer" t-if="main_object._name == 'blog.post'">
            <form class="duplicate d-none" action="/blog/post_duplicate" method="POST">
                <input type="hidden" name="csrf_token" t-att-value="request.csrf_token()"/>
                <input name="blog_post_id" t-att-value="blog_post.id if blog_post else None"/>
            </form>
            <a href="#" class="duplicate dropdown-item" onclick="$(this).prev('form').submit()">Duplicate</a>
        </t>
    </xpath>
</template>
<template id="blog_post_complete" name="Blog Post">
    <t t-call="website_blog.index">
        <div id="title" class="blog_header" t-ignore="True">
            <t t-call="website_blog.blog_cover">
                <t t-set="cover_properties" t-value="blog_post_cover_properties"/>

                <div class="blog_title">
                    <h1 t-field="blog_post.name" id="blog_post_name" t-att-data-blog-id="blog_post.id" placeholder="Blog Post Title"/>
                    <h2 t-field="blog_post.subtitle" placeholder="Subtitle"/>
                    <p class="post-meta text-muted text-center" name="blog_post_data"/>
                    <p class="post-meta text-muted text-center" t-if="len(blog_post.tag_ids)">
                        <span class="fa fa-tags" role="img" aria-label="Tags" title="Tags"/>
                        <t t-foreach="blog_post.tag_ids" t-as="one_tag">
                            <a class="badge badge-primary mr8" t-attf-href="#{blog_url(tag=one_tag.id)}" t-esc="one_tag.name"/>
                        </t>
                    </p>
                    <div t-if="'cover_full' in blog_post_cover_properties.get('resize_class', '')" id="blog_angle_down">
                        <strong><a href="#blog_content" class="fa fa-angle-down fa-3x fa-inverse mt4" aria-label="To blog content" title="To blog content"/></strong>
                    </div>
                </div>
            </t>
        </div>

        <div id="blog_content" t-field="blog_post.content" class="blog_content mt32"/>

        <div class="o_blog_post_complete o_sharing_links">
            <a class="fa fa-twitter-square o_twitter_complete" id="o_twitter_complete" aria-label="Twitter" title="Twitter"></a>
            <a class="fa fa-facebook-square o_facebook_complete" id="o_facebook_complete" aria-label="Facebook" title="Facebook"></a>
            <a class="fa fa-linkedin-square o_linkedin_complete" id="o_linkedin_complete" aria-label="LinkedIn" title="LinkedIn"></a>
            <a class="fa fa-google-plus-square o_google_complete" id="o_google_complete" aria-label="Google Plus" title="Google Plus"></a>
        </div>
    </t>
</template>

<!-- Options: Blog Post: breadcrumb -->
<template id="blog_breadcrumb" name="Breadcrumb"
        inherit_id="website_blog.blog_post_complete" active="False" customize_show="True">
    <xpath expr="//div[@id='title']" position="before">
        <div class="container">
          <div class="row">
            <div class="col-md-9">
                <ol class="breadcrumb">
                    <li class="breadcrumb-item"><a t-attf-href="#{blog_url(tag=None, date_begin=None, date_end=None)}"><span t-field="blog.name"/></a></li>
                    <li t-if="tag" class="breadcrumb-item"><a t-attf-href="#{blog_url(date_begin=None, date_end=None)}"><span t-field="tag.name"/></a></li>
                    <li t-if="date" class="breadcrumb-item"><a t-attf-href="#{blog_url(tag=None)}" t-esc="date"/></li>
                    <li class="breadcrumb-item active"><span t-field="blog_post.name"/></li>
                </ol>
            </div><div class="col-md-3">
            </div>
          </div>
        </div>
    </xpath>
</template>

<!-- Options: Blog Post: user can reply -->
<template id="opt_blog_post_complete_comment" name="Allow blog post comment" inherit_id="website_blog.blog_post_complete" active="False" customize_show="True">
    <xpath expr="//div[hasclass('o_blog_post_complete','o_sharing_links')]" position="after">
        <section id="comments" class="read_width">
            <t t-call="portal.message_thread">
              <t t-set="object" t-value="blog_post"/>
            </t>
        </section>
    </xpath>
</template>

<!-- Options: Blog Post : Read Next Article  -->
<template id="opt_blog_post_complete_read_next" name="Read next article"
        inherit_id="website_blog.blog_post_complete" active="True" customize_show="True">
    <xpath expr="//div[@id='comments']|//div[hasclass('o_blog_post_complete','o_sharing_links')]" position="after">
        <t t-if="next_post">
            <t t-call="website_blog.blog_cover">
                <t t-set="cover_properties" t-value="next_post_cover_properties"/>
                <t t-set="additionnal_classes" t-value="'cover_footer'"/>

                <div class="blog_title">
                    <a class="d-none js_next" t-attf-href="/blog/#{ slug(next_post.blog_id) }/post/#{ slug(next_post) }/#wrap"/>
                    <h1 t-field="next_post.name" placeholder="Blog Post Title"/>
                    <h2 t-field="next_post.subtitle" placeholder="Subtitle"/>
                    <div>
                        <t t-if="next_post.author_avatar">
                            <span t-field="next_post.author_avatar" t-options='{"widget": "image", "class": "rounded-circle", "style":"width: 30px; margin-right: 10px; display:inline"}' />
                        </t>
                        <span t-field="next_post.author_id" style="display: inline-block;" t-options='{
                            "widget": "contact",
                            "fields": ["name"]
                        }'/>
                    </div>
                    <p class="mt32">Read Next <span class="fa fa-long-arrow-right"/></p>
                </div>
            </t>
        </t>
    </xpath>
</template>

<!-- Options: Blog Post: display the author avatar -->
<template id="opt_blog_post_author_avatar_display" name="Author Avatar"
        inherit_id="website_blog.blog_post_complete" active="False" customize_show="True">
    <xpath expr="//p[@name='blog_post_data']" position="after">
        <div>
            <t t-if="blog_post.author_avatar">
                <span t-field="blog_post.author_avatar" class="o_not_editable" t-options='{"widget": "image", "class": "rounded-circle", "style":"width: 30px; margin-right: 10px; display:inline"}' />
            </t>
            <span t-field="blog_post.author_id" style="display: inline-block;" t-options='{
                "widget": "contact",
                "fields": ["name"]
            }'/>
        </div>
    </xpath>
</template>

<template id="opt_blog_post_select_to_tweet" name="Select to Tweet"
        inherit_id="website_blog.blog_post_complete" active="False" customize_show="True">
    <xpath expr="//div[@id='blog_content']" position="attributes">
        <attribute name="class" add="js_tweet" separator=" "/>
    </xpath>
    <xpath expr="//div[@id='title']//div[hasclass('blog_title')]" position="attributes">
        <attribute name="class" add="js_tweet" separator=" "/>
    </xpath>
</template>

<template id="opt_blog_post_select_to_comment" name="Select to comment"
        inherit_id="website_blog.opt_blog_post_complete_comment" customize_show="False">
    <xpath expr="//div[@id='blog_content']" position="attributes">
        <attribute name="class" add="js_comment" separator=" "/>
    </xpath>
    <xpath expr="//div[@id='title']//div[hasclass('blog_title')]" position="attributes">
        <attribute name="class" add="js_comment" separator=" "/>
    </xpath>
</template>

<!-- Page -->
<template id="index" name="Blog Navigation">
    <t t-call="website.layout">
        <div id="wrap" class="js_blog website_blog">
            <t t-raw="0"/>
        </div>
    </t>
</template>

<!-- Option:Right Column for extra info -->

<template id="index_right" name="Right Column"
        inherit_id="website_blog.blog_post_short">
    <xpath expr="//div[@id='main_column']" position="after">
        <div class="col-xl-3 offset-xl-1 col-md-4" id="blog_right_column"/>
    </xpath>
</template>

<!-- Option:Right Column: tags -->

<template id="tag_category" name="Tags List">
    <ul class="nav nav-pills ml16">
        <t t-if="tags">
            <div t-if='not hide_title' class='text-muted mt8'><i class='fa fa-tag' role="img" aria-label="Tag category" title="Tag category"/> <t t-esc='categ_title' /></div>
            <t t-foreach="tags" t-as="tag">
                <t t-if="tag.post_ids">
                    <li class="nav-item">
                        <a t-attf-href="#{blog_url(tag=tags_list(active_tag_ids, tag.id))}" t-attf-class="nav-link#{tag.id in active_tag_ids and ' active' or ''}">
                            <span t-field="tag.name"/>
                        </a>
                    </li>
                </t>
            </t>
        </t>
    </ul>
</template>

<template id="opt_blog_rc_tags" name="Tags"
        inherit_id="website_blog.index_right" active="True" customize_show="True">
    <xpath expr="//div[@id='main_column']" position="attributes">
        <attribute name="class">col-md-8</attribute>
    </xpath>
    <xpath expr="//div[@id='blog_right_column']" position="inside">
        <section class="mt32 blog_tags">
            <h4>Tags</h4>
            <t t-foreach="tag_category" t-as="nav_tag_category">
                <t t-call="website_blog.tag_category">
                    <t t-set='categ_title' t-value="nav_tag_category.name"/>
                    <t t-set='tags' t-value='nav_tag_category.tag_ids' />
                </t>
            </t>
            <t t-call="website_blog.tag_category">
                <t t-set='hide_title' t-value='not len(tag_category)' />
                <t t-set='categ_title'>Others</t>
                <t t-set='tags' t-value='other_tags' />
            </t>
        </section>
    </xpath>
</template>

<!-- Option:Right Column: archives -->
<template id="opt_blog_rc_history" name="Archives"
        inherit_id="website_blog.index_right" active="True" customize_show="True">
    <xpath expr="//div[@id='main_column']" position="attributes">
        <attribute name="class">col-md-8</attribute>
    </xpath>
    <xpath expr="//div[@id='blog_right_column']" position="inside">
        <section class="mt32">
        <h4>Archives</h4>
        <ul class="nav nav-pills flex-column">
            <t t-foreach="nav_list" t-as="year">
                <li data-toggle="collapse" t-att-data-target="'#' + year" aria-expanded="false" class="nav-item blog_post_year_collapse mt8">
                    <i t-attf-class="fa #{'fa-chevron-down' if not date and year_index == 0 else 'fa-chevron-right'} mr4" role="img" aria-label="Next year" title="Next year"/><span t-esc="year"/>
                </li>
                <ul t-attf-class="blog_post_year collapse nav nav-pills flex-column #{not date and year_index == 0 and 'in'}" t-att-id="year" role="menu">
                    <t t-foreach="nav_list[year]" t-as="months">
                        <li t-if="months['date_begin'] == date" class="nav-item">
                            <a role="menuitem" t-ignore="True" t-attf-href="#{blog_url(date_begin=False, date_end=False)}" class="nav-link active"><t t-esc="months['month']"/><span class="float-right badge badge-pill" t-esc="months['post_date_count']"/></a>
                        </li>
                        <li t-else="1" class="nav-item">
                            <a role="menuitem" t-ignore="True" t-attf-href="#{blog_url(date_begin=months['date_begin'], date_end=months['date_end'])}" class="nav-link"><t t-esc="months['month']"/><span class="float-right badge badge-pill" t-esc="months['post_date_count']"/></a>
                        </li>
                    </t>
                </ul>
            </t>
        </ul>
        </section>
    </xpath>
</template>

<!-- Option:Right Column: about us -->
<template id="opt_blog_rc_about_us" name="About Us" priority="2"
        inherit_id="website_blog.index_right" active="True" customize_show="True">
    <xpath expr="//div[@id='main_column']" position="attributes">
        <attribute name="class">col-md-8</attribute>
    </xpath>
    <xpath expr="//div[@id='blog_right_column']" position="inside">
        <section class="mt32">
        <h4>About us</h4>
        <p>
            Write a small text here for when <b>new visitors</b> find your website
            through your <b>blog entries</b>, referenced in Google.
        </p>
        </section>
    </xpath>
</template>

<!-- Option:Right Column: follow us -->
<template id="opt_blog_rc_follow_us" name="Subscription" priority="4"
        inherit_id="website_blog.index_right" active="True" customize_show="True">
    <xpath expr="//div[@id='main_column']" position="attributes">
        <attribute name="class">col-md-8</attribute>
    </xpath>
    <xpath expr="//div[@id='blog_right_column']" position="inside">
        <section class="mt32">
            <h4>Stay updated :</h4>
            <t t-if="blog">
                <t t-call="website_mail.follow">
                    <t t-set="email" t-value="user_id.email"/>
                    <t t-set="object" t-value="blog"/>
                </t>
            </t>
            <p class="text-muted mb0 mt16">
                Participate on our social stream.
            </p>
            <h2 class="mt4">
                <a t-att-href="website.social_facebook" t-if="website.social_facebook" aria-label="Facebook" title="Facebook"><i class="fa fa-facebook-square"/></a>
                <a t-att-href="website.social_twitter" t-if="website.social_twitter" aria-label="Twitter" title="Twitter"><i class="fa fa-twitter"/></a>
                <a t-att-href="website.social_linkedin" t-if="website.social_linkedin" aria-label="LinkedIn" title="LinkedIn"><i class="fa fa-linkedin"/></a>
                <a t-att-href="website.social_youtube" t-if="website.social_youtube" aria-label="Youtube" title="Youtube"><i class="fa fa-youtube-play"/></a>
                <a t-att-href="website.social_googleplus" t-if="website.social_googleplus" aria-label="Google Plus" title="Google Plus"><i class="fa fa-google-plus-square"/></a>
                <a t-att-href="website.social_github" t-if="website.social_github" aria-label="Github" title="Github"><i class="fa fa-github"/></a>
                <a t-att-href="website.social_instagram" t-if="website.social_instagram" aria-label="Instagram" title="Instagram"><i class="fa fa-instagram"/></a>
                <a t-att-href="'/blog/%s/feed' % (blog.id)" aria-label="RSS" title="RSS"><i class="fa fa-rss-square"/></a>
            </h2>
        </section>
    </xpath>
</template>

<!-- Option:Right Column: status -->
<template id="opt_blog_rc_status" name="Status" priority="5"
        inherit_id="website_blog.index_right" active="True" customize_show="True">
    <xpath expr="//div[@id='main_column']" position="attributes">
        <attribute name="class">col-md-8</attribute>
    </xpath>
    <xpath expr="//div[@id='blog_right_column']" position="inside">
        <section class="mt32 mb32" groups="website.group_website_designer">
        <h4>Status</h4>
        <ul class="nav nav-pills flex-column">
            <t t-set="state" t-value="state_info['state']"/>
            <li class="nav-item">
                <a t-attf-href="#{state == 'published' and blog_url(state='') or blog_url(state='published')}" t-attf-class="nav-link#{state == 'published' and ' active' or ''}">Published <span class="float-right badge badge-pill" t-esc="state_info['published']" /></a>
            </li>
            <li class="nav-item">
                <a t-attf-href="#{state == 'unpublished' and blog_url(state='') or blog_url(state='unpublished')}" t-attf-class="nav-link#{state == 'unpublished' and ' active' or ''}">Unpublished <span class="float-right badge badge-pill" t-esc="state_info['unpublished']" /></a>
            </li>
        </ul>
        </section>
    </xpath>
</template>

<!-- Option:Right Column: blogs -->
<template id="opt_blog_rc_blogs" name="Our Blogs" priority="6"
        inherit_id="website_blog.index_right" active="True" customize_show="True">
    <xpath expr="//div[@id='main_column']" position="attributes">
        <attribute name="class">col-md-8</attribute>
    </xpath>
    <xpath expr="//div[@id='blog_right_column']" position="inside">
        <section class="mt32 mb32">
        <h4>Our Blogs</h4>
        <ul class="nav nav-pills flex-column">
            <t t-foreach="blogs" t-as="nav_blog">
                <li class="nav-item">
                    <a t-attf-href="#{blog_url(blog=nav_blog, tag=False, date_begin=False, date_end=False)}" t-attf-class="nav-link#{nav_blog.id == blog.id and ' active' or ''}">
                        <span t-field="nav_blog.name"/>
                    </a>
                </li>
            </t>
        </ul>
        </section>
    </xpath>
</template>

<!-- User Navbar -->
<template id="user_navbar_inherit_website_blog" inherit_id="website.user_navbar">
    <xpath expr="//div[@id='o_new_content_menu_choices']//div[@name='module_website_blog']" position="attributes">
        <attribute name="name"/>
        <attribute name="t-att-data-module-id"/>
        <attribute name="t-att-data-module-shortdesc"/>
        <attribute name="groups">website.group_website_designer</attribute>
    </xpath>
</template>

<!-- Atom Feed -->
<template id="blog_feed">&lt;?xml version="1.0" encoding="utf-8"?&gt;
<feed t-att-xmlns="'http://www.w3.org/2005/Atom'">
    <title t-esc="blog.name"/>
    <link t-att-href="'%s/blog/%s' % (base_url ,blog.id)"/>
    <id t-esc="'%s/blog/%s' % (base_url, blog.id)"/>
    <updated t-esc="str((posts[0] if posts else blog).post_date).replace(' ', 'T') + 'Z'"/>
    <entry t-foreach="posts" t-as="post">
        <title t-esc="post.name"/>
        <link t-att-href="'%s%s' % (base_url, post.website_url)"/>
        <id t-esc="'%s%s' % (base_url, post.website_url)"/>
        <author><name t-esc="post.sudo().author_id.name"/></author>
        <summary t-esc="html2plaintext(post.teaser)"/>
        <updated t-esc="str(post.post_date).replace(' ', 'T') + 'Z'"/>
    </entry>
</feed>
</template>

<!-- Chatter templates -->
<template id="blog_post_template_new_post">
    <p>A new post <t t-esc="post.name" /> has been published on the <t t-esc="object.name" /> blog. Click here to access the blog :</p>
    <p style="margin-left: 30px; margin-top: 10 px; margin-bottom: 10px;">
        <a href="/blog/#{slug(object)}/post/#{slug(post)}"
            style="padding: 5px 10px; font-size: 12px; line-height: 18px; color: #FFFFFF; border-color:#875A7B; text-decoration: none; display: inline-block; margin-bottom: 0px; font-weight: 400; text-align: center; vertical-align: middle; cursor: pointer;background-color: #875A7B; border: 1px solid #875A7B; border-radius:3px">
            Access post
        </a>
    </p>
</template>

<template id="s_latest_posts" name="Latest Posts - List">
    <section class="s_latest_posts">
        <div class="container">
            <h2 class="text-center">Latest Posts</h2>
            <div class="row js_get_posts"
                data-loading="true"
                data-template="website_blog.s_latest_posts_list_template"/>
        </div>
    </section>
</template>

<template id="s_latest_posts_big_picture" name="Latest Posts - Big Images">
    <section class="s_latest_posts_big_picture">
        <div class="container-fluid">
            <h2 class="text-center">Latest Posts</h2>
            <div class="row js_get_posts"
                data-loading="true"
                data-template="website_blog.s_latest_posts_big_picture_template"/>
        </div>
    </section>
</template>

<template id="s_latest_posts_list_template">
    <t t-foreach="posts" t-as="p">
        <t t-set="properties" t-value="json.loads(p.cover_properties)"/>
        <div class="col-12 media mt-3 s_latest_posts_post">
            <a t-attf-href="/blog/#{p.blog_id.id}/post/#{p.id}">
                <t t-call="website_blog.blog_cover">
                    <t t-set="cover_properties" t-value="properties"/>
                    <t t-set="additionnal_classes" t-value="'loading_container thumb'"/>
                </t>
            </a>
            <div class="media-body ml-3 pb-2">
                <h4 t-field="p.name"/>
                <p t-field="p.subtitle"/>
                <a class="btn btn-sm btn-secondary" t-attf-href="/blog/#{p.blog_id.id}/post/#{p.id}">Read More</a>
            </div>
        </div>
    </t>
</template>

<template id="s_latest_posts_big_picture_template">
    <t t-foreach="posts" t-as="p">
        <t t-set="properties" t-value="json.loads(p.cover_properties)"/>
        <div class="col-12 col-md-6 my-3 loading_container s_latest_posts_post">
            <t t-call="website_blog.blog_cover">
                <t t-set="cover_properties" t-value="properties"/>
                <t t-set="additionnal_classes" t-value="'thumb'"/>
            </t>
            <div>
                <h2 t-field="p.name"/>
                <p t-field="p.subtitle"/>
                <a t-attf-href="/blog/#{p.blog_id.id}/post/#{p.id}">Read More</a>
            </div>
        </div>
    </t>
</template>

</odoo>
