<commit_before>{% extends "base.html" %}
{% set show_left_col = ["dataset","publications","ckan-admin","documentation","opendata", "licence"] %}
{% set show_left_level_two = ["trash","config","admin","new","activity","edit"] %}
{% set section_terms = {"dataset":"All Resources","publications":"Publications","documentation":"Documentation","opendata":"Open Data","ckan-admin":"Admin"} %}
{% set path_length = c.environ.PATH_INFO.split("/")|length %}
{%- set rss_feed = h.url(controller='feed', action='custom', q=c.q) -%}

{% if path_length > 1 %}
    {% set level_one_section = c.environ.PATH_INFO.split("/")[1] %}
{% else %}
    {% set level_one_section = "" %}
{% endif %}

{% if path_length > 2 %}
    {% set level_two_section = c.environ.PATH_INFO.split("/")[2] %}
{% else %}
    {% set level_two_section = "" %}
{% endif %}

{% set page_title = "" %}
{% set page_parent_title = "Open Government" %}

{% if path_length == 2 %}
    {% if level_one_section != "" and level_one_section in show_left_col %}
        {% set page_title = section_terms[level_one_section] %}
    {% endif %}
{% else %}
    {% if level_one_section != "" and level_one_section in show_left_col %}
        {% set page_parent_title = section_terms[level_one_section] %}
    {% endif %}
{% endif %}

{% if c.pkg_dict %}
    {% if page_title == "" and c.pkg_dict.title != "" %}
        {% set page_title = c.pkg_dict.title %}
    {% endif %}
{% endif %}



{%- block page -%}

{% block skip %}
<div class="hide"><a href="#content">{{ _('Skip to content') }}</a></div>
{% endblock %}

{#
Override the header on a page by page basis by extending this block. If
making sitewide header changes it is preferable to override the header.html
file.
#}
{%- block header %}
{% include "header.html" %}
{% endblock -%}

{# The content block allows you to replace the content of the page if needed #}
{%- block content %}
{% block maintag %}<div role="main">{% endblock %}

{% block toolbar %}
<header>
    <div class="container-fluid" id="breadcrumbs-share">
        <div class="row">
            <div class="col-sm-12 col-md-8 nopadding">
                <section id="breadcrumbs" class="hidden-xs hidden-sm">
                    {% block breadcrumb %}
                    <ul>
                        <li><a href="http://alberta.ca"><span>Alberta.ca</span></a></li>
                        <li><a href="/"><span>Open Government</span></a></li>
                        {% if path_length > 2 %}
                        <li><a href="/{{ level_one_section }}">{{ page_parent_title }}</a></li>
                        {% endif %}
                    </ul>
                    {% endblock %}
                </section>
            </div>
            <div class="col-sm-12 col-md-4 nopadding">
                <ul class="addthis_toolbox addthis_custom_sharing social visible-md visible-lg">
                    <li><a class="addthis_button_facebook" title="Facebook" href="#"><i class="fa fa-fw fa-facebook"></i><span>Facebook</span></a></li>
                    <li><a class="addthis_button_twitter" title="Tweet" href="#"><i class="fa fa-fw fa-twitter"></i><span>Twitter</span></a></li>
                    <li><a title="RSS" href="{{rss_feed}}"><i class="fa fa-fw fa-rss"></i><span>RSS</span></a></li>
                    <div class="atclear"></div></ul>
            </div>
        </div>
    </div>
</header>
{% endblock %}

<div id="content" class="container">
    {% block main_content %}
    {% block flash %}
    <div class="flash-messages">
        {% block flash_inner %}
        {% for message in h.flash.pop_messages() | list %}
        <div class="alert fade in {{ message.category }}">
            {{ h.literal(message) }}
        </div>
        {% endfor %}
        {% endblock %}
    </div>
    {% endblock %}
    <div class="row">
        <div class="col-xs-12 page-title-box">
            {% if path_length > 2 %}
                    <a href="/{{ level_one_section }}" id="pageParentStub">{{ page_parent_title }}</a>
            {% else %}
                    <a href="/" id="pageParentStub">{{ page_parent_title }}</a>
            {% endif %}<commit_msg>Fix to stop rendering addthis social networking buttons on private or non-relevent pages<commit_after>{% extends "base.html" %}
{% set show_left_col = ["dataset","publications","ckan-admin","documentation","opendata", "licence"] %}
{% set show_left_level_two = ["trash","config","admin","new","activity","edit"] %}
{% set section_terms = {"dataset":"All Resources","publications":"Publications","documentation":"Documentation","opendata":"Open Data","ckan-admin":"Admin"} %}
{% set path_length = c.environ.PATH_INFO.split("/")|length %}
{%- set rss_feed = h.url(controller='feed', action='custom', q=c.q) -%}

{% if path_length > 1 %}
    {% set level_one_section = c.environ.PATH_INFO.split("/")[1] %}
{% else %}
    {% set level_one_section = "" %}
{% endif %}

{% if path_length > 2 %}
    {% set level_two_section = c.environ.PATH_INFO.split("/")[2] %}
{% else %}
    {% set level_two_section = "" %}
{% endif %}

{% set page_title = "" %}
{% set page_parent_title = "Open Government" %}

{% if path_length == 2 %}
    {% if level_one_section != "" and level_one_section in show_left_col %}
        {% set page_title = section_terms[level_one_section] %}
    {% endif %}
{% else %}
    {% if level_one_section != "" and level_one_section in show_left_col %}
        {% set page_parent_title = section_terms[level_one_section] %}
    {% endif %}
{% endif %}

{% if c.pkg_dict %}
    {% if page_title == "" and c.pkg_dict.title != "" %}
        {% set page_title = c.pkg_dict.title %}
    {% endif %}
{% endif %}



{%- block page -%}

{% block skip %}
<div class="hide"><a href="#content">{{ _('Skip to content') }}</a></div>
{% endblock %}

{#
Override the header on a page by page basis by extending this block. If
making sitewide header changes it is preferable to override the header.html
file.
#}
{%- block header %}
{% include "header.html" %}
{% endblock -%}

{# The content block allows you to replace the content of the page if needed #}
{%- block content %}
{% block maintag %}<div role="main">{% endblock %}

{% block toolbar %}
<header>
    <div class="container-fluid" id="breadcrumbs-share">
        <div class="row">
            <div class="col-sm-12 col-md-8 nopadding">
                <section id="breadcrumbs" class="hidden-xs hidden-sm">
                    {% block breadcrumb %}
                    <ul>
                        <li><a href="http://alberta.ca"><span>Alberta.ca</span></a></li>
                        <li><a href="/"><span>Open Government</span></a></li>
                        {% if path_length > 2 %}
                        <li><a href="/{{ level_one_section }}">{{ page_parent_title }}</a></li>
                        {% endif %}
                    </ul>
                    {% endblock %}
                </section>
            </div>
{# Render Social media links only on allowed pages, and if data package is not private#} 
    {% if pkg.private %} 

  {% else %} 
  {%  if (( c.action == "search" or c.action == "read" or c.action == "list" or c.action == "about" or c.action == "policy" or c.action == "licence") and 
    ( c.controller == "package" or c.controller == "related" or c.controller == "home" or c.controller == "ckanext.data_alberta.controller:PagesController")) %} 
  <!-- Social Links are allowed --> 



            
            <div class="col-sm-12 col-md-4 nopadding">
                <ul class="addthis_toolbox addthis_custom_sharing social visible-md visible-lg">
                    <li><a class="addthis_button_facebook" title="Facebook" href="#"><i class="fa fa-fw fa-facebook"></i><span>Facebook</span></a></li>
                    <li><a class="addthis_button_twitter" title="Tweet" href="#"><i class="fa fa-fw fa-twitter"></i><span>Twitter</span></a></li>
                    <li><a title="RSS" href="{{rss_feed}}"><i class="fa fa-fw fa-rss"></i><span>RSS</span></a></li>
                    <div class="atclear"></div></ul>
            </div>
{% else %}
<!-- No Social Links are Allowed -->
  {% endif %}
{% endif %}

        </div>
    </div>
</header>
{% endblock %}

<div id="content" class="container">
    {% block main_content %}
    {% block flash %}
    <div class="flash-messages">
        {% block flash_inner %}
        {% for message in h.flash.pop_messages() | list %}
        <div class="alert fade in {{ message.category }}">
            {{ h.literal(message) }}
        </div>
        {% endfor %}
        {% endblock %}
    </div>
    {% endblock %}
    <div class="row">
        <div class="col-xs-12 page-title-box">
            {% if path_length > 2 %}
                    <a href="/{{ level_one_section }}" id="pageParentStub">{{ page_parent_title }}</a>
            {% else %}
                    <a href="/" id="pageParentStub">{{ page_parent_title }}</a>
            {% endif %}
{'fraction_non_alphanumeric': 0.190732637720184, 'fraction_numerical': 0.003365870077415012, 'mean_word_length': 2.552809884416102, 'pattern_counts': {'":': 10, '<': 153, '<?xml version=': 0, '>': 161, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6331738', 'n_tokens_mistral': 3027, 'n_tokens_neox': 2695, 'n_words': 614}