{% extends "td_cms/layouts/two_cols_left_sidebar.html" %}

{% load i18n %}
{% load td_cms_tags %}

{% block page_title %}{{ page.title }}{% endblock page_title %}
{% block page_class %}page{% endblock page_class %}

{# Google #}
{% block meta_description %}{{ page.synopsis|striptags|safe }}{% endblock meta_description %}
{% block meta_author %}{{ page.author.get_full_name }}{% endblock meta_author %}
{% block meta_keywords %}{% endblock meta_keywords %}
{% block meta_copyright %}{{ page.author.get_full_name }}{% endblock meta_copyright %}
{% block application_name %}TailorDev CMS{% endblock application_name %}

{# Facebook #}
{% block facebook_title %}{{ page.title }}{% endblock facebook_title %}
{% block facebook_type %}Article{% endblock facebook_type %}
{% block facebook_image %}{{ page.get_image_full_url }}{% endblock facebook_image %}
{% block facebook_url %}{{ request.build_absolute_uri }}{% endblock facebook_url %}
{% block facebook_description %}{{ page.synopsis|striptags|safe }}{% endblock facebook_description %}
{% block facebook_updated_time %}{{ page.last_modified|timestamp }}{% endblock facebook_updated_time %}

{# Twitter #}
{% block twitter_title %}{{ page.title }}{% endblock twitter_title %}
{% block twitter_description %}{{ page.synopsis|striptags|safe }}{% endblock twitter_description %}
{% block twitter_image %}{{ page.get_image_full_url }}{% endblock twitter_image %}

{% block left_sidebar_class %}{% endblock left_sidebar_class %}

{% block left_sidebar %}
    {% with categories=page.categories.all category=page.categories.all.0 %}
        {% include "td_cms/partials/sidebar/category_list.html" %}
    {% endwith %}
    {% include "td_cms/partials/sidebar/top_articles_list.html" %}
{% endblock left_sidebar %}

{% block main_content_class %}page-detail{% endblock main_content_class %}

{% block main_content %}
    {% include "td_cms/partials/main_content/page_detail.html" %}
    {% if page.allow_sharing %}
    <a class="medium button dropdown share" data-dropdown="hideshare-list" href="#" >{% trans "Share this" %}</a>
    {% endif %}
{% endblock main_content %}

{% block javascripts %}
    <script src="{{ STATIC_URL }}td_cms/javascripts/plugins/hideshare.js"></script>
    <script>
    $(document).ready(function() {
        $(".share").hideshare({
            link: "{{ request.build_absolute_uri }}",
            title: "{{ site.name }} - {{ page.title }}",
            media: "{{ page.get_image_full_url }}",
            facebook: true,
            twitter: true,
            pinterest: false,
            googleplus: true,
            linkedin: true,
        });
    });
    </script>
{% endblock %}
