<commit_before>{% extends "articles/_base_articles.html" %}

{% block page_title %} {{ article.title }} - {{ super() }}{% endblock %}

{% block site_js_extra %}
{% compress js %}
    {% if article.section.slug == "learning" %}
        <script src="{{ static('articles/js/jquery.scrollTo.min.js') }}"></script>
        <script src="{{ static('articles/js/jquery.localScroll.min.js') }}"></script>
    {% endif %}
    <script src="{{ static('articles/js/jquery.syntaxhighlighter.min.js') }}"></script>
{% endcompress %}
<script type="text/javascript">
    $.SyntaxHighlighter.init();
    {% if article.section.slug == "learning" %}
    $('.article-toc').localScroll({
        offset: -80,
        hash: true
    });
    {% endif %}
    
    $(document).ready(function(){
        var sourceData = {};
        $('.twitter-bio').each(function(index, element) {
            sourceData.twitter_name = this['id'].replace('bio-','');
sourceData.twitter_api_url='//api.twitter.com/1/users/show.json?screen_name='+sourceData.twitter_name+'&callback=?';
            $.getJSON(sourceData.twitter_api_url, function(data) {
                // returns 'success' even on 404, so ensure that data exists
                if (data['profile_image_url']) {
                    sourceData.twitter_avatar = '<img src="' + data['profile_image_url'] + '">';
                    $(element).prepend(sourceData.twitter_avatar);
                }
            });
        });
    });
</script>
{% endblock %}

{% block article_class %}article-detail{% endblock %}
{% block content %}
    {% if article.image %}
        <div class="image-full-width-wrapper">
            <img src="{{ MEDIA_URL }}{{ thumbnail(article.image, "800") }}" alt="{{ article.title }}">
            {% if article.pretty_caption %}<p class="caption">{{ article.pretty_caption|safe }}</p>{% endif %}
        </div>
    {% endif %}

    <h2>{% include "articles/_article_category_and_tags_overline.html" %}{{ article.title }}</h2>
    <h4>{{ article.subhead }}</h4>
    
    <aside>
        <div class="byline">
            {% if article.section.slug == "learning" %}
            <div class="article-toc">
                {% for article_block in article.articleblock_set.all() %}
                    {% if loop.first %}<h3 class="subhead list-header">In this case study</h3>
                        <ul class="toc">{% endif %}
                            <li><i class="icon-circle-arrow-right"></i> <a href="#{{ article_block.slug }}">{{ article_block.title }}</a></li>
                    {% if loop.last %}</ul>{% endif %}
                {% endfor %}
            </div>
            {% endif %}

            <h6 class="date">{{ article.pretty_pubdate }}</h6>
            {% if article.get_live_author_set().exists() %}<h6 class="byline-name">{% with author_list = article.get_live_author_set() %}{% include "articles/_article_author_list.html" %}{% endwith %}</h6>{% endif %}
            <ul class="link-list">
                <li><i class="icon-comments"></i><a href="{{ HTTP_PROTOCOL }}://{{ request.get_host() }}{{ article.get_absolute_url() }}#disqus_thread" data-disqus-identifier="article_detail_{{ article.pk }}">Comments</a></li>
            </ul>
        </div>

        <div class="article-people">
            {% with code_link_list = article.get_live_code_set() %}
            {% include "code/_code_link_list.html" %}{% endwith %}

            {% with person_link_list = article.get_live_people_set() %}
            {% include "people/_person_link_list.html" %}{% endwith %}

            {% with organization_link_list = article.get_live_organization_set() %}
            {% include "people/_organization_link_list.html" %}{% endwith %}
        </div>
    </aside>
    
    {{ article.pretty_body_text|safe }}
    
    {% for articleblock in article.articleblock_set.all() %}
    <div class="page-block article-block">
        <h3 id="{{ articleblock.slug }}">{{ articleblock.title }}</h3>
        {% if articleblock.image and articleblock.image_presentation in ['full-width','inset-left','inset-right'] %}
            {% set _image_width_options = {
                'full-width':'800',
                'inset-left':'300',
                'inset-right':'300',
            } -%}
            {% set _this_image_width = _image_width_options[articleblock.image_presentation] %}
            <div class="image-{{ articleblock.image_presentation }}-wrapper">
                <img src="{{ MEDIA_URL }}{{ thumbnail(articleblock.image, _this_image_width) }}" alt="{{ articleblock.title }}">
                {% if articleblock.pretty_caption %}<p class="caption">{{ articleblock.pretty_caption|safe }}</p>{% endif %}
            </div>
        {% endif %}
        
        {{ articleblock.pretty_body_text|safe }}
        
        {% if articleblock.image and articleblock.image_presentation == 'full-width-below' %}
            <div class="image-full-width-wrapper">
                <img src="{{ MEDIA_URL }}{{ thumbnail(articleblock.image, "800") }}" alt="{{ articleblock.title }}">
                {% if articleblock.pretty_caption %}<p class="caption">{{ articleblock.pretty_caption|safe }}</p>{% endif %}
            </div>
        {% endif %}
    </div>
    {% endfor %}
    
    {# test for author bios in person db, add block if found #}
    {% if article.get_live_author_bios() %}
    <div class="page-block article-block author-box">
        {% for author in article.get_live_author_set() %}
        <h3 id="about-authors">About <a href="{{ author.get_absolute_url() }}">{{ author.name() }}</a></h3>
        <p{% if author.twitter_username %} class="twitter-bio" id="bio-{{ author.twitter_username }}"{% endif %}>
            {{ author.description|safe }}
        </p>
        {% endfor %}
    </div>{% endif %}
    
    <aside class="article-people">
        {% with code_link_list = article.get_live_code_set() %}
        {% include "code/_code_link_list.html" %}{% endwith %}

        {% with person_link_list = article.get_live_people_set() %}
        {% include "people/_person_link_list.html" %}{% endwith %}

        {% with organization_link_list = article.get_live_organization_set() %}
        {% include "people/_organization_link_list.html" %}{% endwith %}
    </aside>
    
    <div id="disqus_thread"></div>
    <script type="text/javascript">
        var disqus_shortname = "source-opennews";
        //var disqus_developer = 1; // developer mode is on
        var disqus_identifier = "article_detail_{{ article.pk }}";
        var disqus_url = "{{ HTTP_PROTOCOL }}://{{ request.get_host() }}{{ article.get_absolute_url() }}";
        /* * * DON'T EDIT BELOW THIS LINE * * */
        (function() {
            var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
            dsq.src = '{{ HTTP_PROTOCOL }}://' + disqus_shortname + '.disqus.com/embed.js';
            (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
        })();
        (function () {
            var s = document.createElement('script'); s.async = true;<commit_msg>fix id attr for bio h3s<commit_after>{% extends "articles/_base_articles.html" %}

{% block page_title %} {{ article.title }} - {{ super() }}{% endblock %}

{% block site_js_extra %}
{% compress js %}
    {% if article.section.slug == "learning" %}
        <script src="{{ static('articles/js/jquery.scrollTo.min.js') }}"></script>
        <script src="{{ static('articles/js/jquery.localScroll.min.js') }}"></script>
    {% endif %}
    <script src="{{ static('articles/js/jquery.syntaxhighlighter.min.js') }}"></script>
{% endcompress %}
<script type="text/javascript">
    $.SyntaxHighlighter.init();
    {% if article.section.slug == "learning" %}
    $('.article-toc').localScroll({
        offset: -80,
        hash: true
    });
    {% endif %}
    
    $(document).ready(function(){
        var sourceData = {};
        $('.twitter-bio').each(function(index, element) {
            sourceData.twitter_name = this['id'].replace('bio-','');
sourceData.twitter_api_url='//api.twitter.com/1/users/show.json?screen_name='+sourceData.twitter_name+'&callback=?';
            $.getJSON(sourceData.twitter_api_url, function(data) {
                // returns 'success' even on 404, so ensure that data exists
                if (data['profile_image_url']) {
                    sourceData.twitter_avatar = '<img src="' + data['profile_image_url'] + '">';
                    $(element).prepend(sourceData.twitter_avatar);
                }
            });
        });
    });
</script>
{% endblock %}

{% block article_class %}article-detail{% endblock %}
{% block content %}
    {% if article.image %}
        <div class="image-full-width-wrapper">
            <img src="{{ MEDIA_URL }}{{ thumbnail(article.image, "800") }}" alt="{{ article.title }}">
            {% if article.pretty_caption %}<p class="caption">{{ article.pretty_caption|safe }}</p>{% endif %}
        </div>
    {% endif %}

    <h2>{% include "articles/_article_category_and_tags_overline.html" %}{{ article.title }}</h2>
    <h4>{{ article.subhead }}</h4>
    
    <aside>
        <div class="byline">
            {% if article.section.slug == "learning" %}
            <div class="article-toc">
                {% for article_block in article.articleblock_set.all() %}
                    {% if loop.first %}<h3 class="subhead list-header">In this case study</h3>
                        <ul class="toc">{% endif %}
                            <li><i class="icon-circle-arrow-right"></i> <a href="#{{ article_block.slug }}">{{ article_block.title }}</a></li>
                    {% if loop.last %}</ul>{% endif %}
                {% endfor %}
            </div>
            {% endif %}

            <h6 class="date">{{ article.pretty_pubdate }}</h6>
            {% if article.get_live_author_set().exists() %}<h6 class="byline-name">{% with author_list = article.get_live_author_set() %}{% include "articles/_article_author_list.html" %}{% endwith %}</h6>{% endif %}
            <ul class="link-list">
                <li><i class="icon-comments"></i><a href="{{ HTTP_PROTOCOL }}://{{ request.get_host() }}{{ article.get_absolute_url() }}#disqus_thread" data-disqus-identifier="article_detail_{{ article.pk }}">Comments</a></li>
            </ul>
        </div>

        <div class="article-people">
            {% with code_link_list = article.get_live_code_set() %}
            {% include "code/_code_link_list.html" %}{% endwith %}

            {% with person_link_list = article.get_live_people_set() %}
            {% include "people/_person_link_list.html" %}{% endwith %}

            {% with organization_link_list = article.get_live_organization_set() %}
            {% include "people/_organization_link_list.html" %}{% endwith %}
        </div>
    </aside>
    
    {{ article.pretty_body_text|safe }}
    
    {% for articleblock in article.articleblock_set.all() %}
    <div class="page-block article-block">
        <h3 id="{{ articleblock.slug }}">{{ articleblock.title }}</h3>
        {% if articleblock.image and articleblock.image_presentation in ['full-width','inset-left','inset-right'] %}
            {% set _image_width_options = {
                'full-width':'800',
                'inset-left':'300',
                'inset-right':'300',
            } -%}
            {% set _this_image_width = _image_width_options[articleblock.image_presentation] %}
            <div class="image-{{ articleblock.image_presentation }}-wrapper">
                <img src="{{ MEDIA_URL }}{{ thumbnail(articleblock.image, _this_image_width) }}" alt="{{ articleblock.title }}">
                {% if articleblock.pretty_caption %}<p class="caption">{{ articleblock.pretty_caption|safe }}</p>{% endif %}
            </div>
        {% endif %}
        
        {{ articleblock.pretty_body_text|safe }}
        
        {% if articleblock.image and articleblock.image_presentation == 'full-width-below' %}
            <div class="image-full-width-wrapper">
                <img src="{{ MEDIA_URL }}{{ thumbnail(articleblock.image, "800") }}" alt="{{ articleblock.title }}">
                {% if articleblock.pretty_caption %}<p class="caption">{{ articleblock.pretty_caption|safe }}</p>{% endif %}
            </div>
        {% endif %}
    </div>
    {% endfor %}
    
    {# test for author bios in person db, add block if found #}
    {% if article.get_live_author_bios() %}
    <div class="page-block article-block author-box">
        {% for author in article.get_live_author_set() %}
        <h3 id="about-{{ author.slug }}">About <a href="{{ author.get_absolute_url() }}">{{ author.name() }}</a></h3>
        <p{% if author.twitter_username %} class="twitter-bio" id="bio-{{ author.twitter_username }}"{% endif %}>
            {{ author.description|safe }}
        </p>
        {% endfor %}
    </div>{% endif %}
    
    <aside class="article-people">
        {% with code_link_list = article.get_live_code_set() %}
        {% include "code/_code_link_list.html" %}{% endwith %}

        {% with person_link_list = article.get_live_people_set() %}
        {% include "people/_person_link_list.html" %}{% endwith %}

        {% with organization_link_list = article.get_live_organization_set() %}
        {% include "people/_organization_link_list.html" %}{% endwith %}
    </aside>
    
    <div id="disqus_thread"></div>
    <script type="text/javascript">
        var disqus_shortname = "source-opennews";
        //var disqus_developer = 1; // developer mode is on
        var disqus_identifier = "article_detail_{{ article.pk }}";
        var disqus_url = "{{ HTTP_PROTOCOL }}://{{ request.get_host() }}{{ article.get_absolute_url() }}";
        /* * * DON'T EDIT BELOW THIS LINE * * */
        (function() {
            var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
            dsq.src = '{{ HTTP_PROTOCOL }}://' + disqus_shortname + '.disqus.com/embed.js';
            (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
        })();
        (function () {
            var s = document.createElement('script'); s.async = true;
{'fraction_non_alphanumeric': 0.18028981429375351, 'fraction_numerical': 0.005416432189082724, 'mean_word_length': 2.5569176882661995, 'pattern_counts': {'":': 0, '<': 153, '<?xml version=': 0, '>': 153, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1082796', 'n_tokens_mistral': 4607, 'n_tokens_neox': 4199, 'n_words': 756}