<commit_before>{% extends 'base.html' %}
{% load thumbnail %}

{% block title %}{{ object.name }}{% endblock %}

{% block content %}
    <div class="title-space">
        <h1>{{ object.title }} {{ object.name }}</h1>

        {% if object.is_politician %}
            <p>Politician Profile Page</p>
        {% endif %}
        
        {% if object.is_aspirant %}
            <p>
                Aspirant in the upcoming elections:
                {% for aspiration in object.aspirant_positions %}
                    {{ aspiration.title }}
                    {% if not forloop.last %}, {% endif %}
                {% endfor %}
            </p>
        {% endif %}
    </div>
    
    <div class="profile-pic">
        {% thumbnail object.primary_image "210x210" crop="center" as im %}
        <img src="{{ im.url }}" alt="{{ object.name }}" width="{{ im.width }}" height="{{ im.height }}" />
        {% empty %}
        <img src="{{STATIC_URL}}images/avatar-210x210.jpg" />
        {% endthumbnail %}        
    </div>

    <div class="social-and-tools">
        {% include 'core/social_tools.html' %}
    </div>

    <div class="profile-info">
        <div class="constituency-party">

            {% if object.aspirant_constituencies.count %}
                <h3>Aspirant for</h3>
                <ul>
                    {% for constituency in object.aspirant_constituencies %}
                        <li><a href="{{ constituency.get_absolute_url }}">{{ constituency.name }}</a></li>
                    {% endfor %}
            {% endif %}

            <h3>Constituency</h3>
            <ul>
                {% for constituency in object.constituencies %}
                    <li><a href="{{ constituency.get_absolute_url }}">{{ constituency.name }}</a></li>
                {% empty %}
                    <li>Not an MP for any constituencies</li>
                {% endfor %}
            </ul>

            <h3>Party &amp; Coalition</h3>
            <ul>
                {% for party in object.parties_and_coalitions %}
                    <li><a href="{{ party.get_absolute_url }}">{{ party.name }}</a></li>
                {% empty %}
                    <li><p>Not a member of any parties or coalitions</p></li>
                {% endfor %}
            </ul>
        </div>

        <div class="profile-names">
            {% if object.name != object.legal_name %}
                <h3>Full name</h3>
                <p>{{ object.legal_name }}</p>
            {% endif %}

            {% if object.additional_names %}
                <h3>Also known as</h3>
                <p>{% for name in object.additional_names %}
                    {% if not forloop.first %}
                        {% if forloop.last %}or{% else %},{% endif %}
                    {% endif %}
                    <strong>{{ name }}</strong>
                {% endfor %}</p>
            {% endif %}
        
            {% if object.date_of_birth %}
                <h3>Born</h3>
                <p>{{ object.date_of_birth }} {# TODO - add age in years #}</p>
            {% endif %}
        
            {# TODO - add death date too if it exists #}
        </div>

    </div>

    <div class="large-container">

        <div class="tab-wrapper">

          <h2 class="tab-nav" rel="#contact-details">Contact Details</h2>
          <div class="tab" id="contact-details">
            {% include "core/contact_list.html" with contacts=object.contacts.all %}
          </div>
        </div>

        <div class="tab-wrapper">

          <h2 class="tab-nav" rel="#scorecard">Scorecard</h2>
          <div class="tab" id="scorecard">
            {% include 'scorecards/scorecard.html' %}
          </div>
        </div>

        <div class="tab-wrapper">

            {% if object.summary %}
            <h2 class="tab-nav" rel="#overview">Overview</h2>
            <div class="tab markdown" id="overview">
                {{ object.summary }}
            </div>
            {% endif %}

            {% include 'disqus_comments.html' %}

            <h2 class="tab-nav" rel="#experience">Experience</h2>
            <div class="tab" id="experience">
                <div class="left-col">
                    <section>
                        <h3>Current Political Positions</h3>
                        {% include 'core/person_position_section.html' with positions=object.position_set.all.political.currently_active %}
                    </section>

                    <section>
                        <h3>Previous Political Positions</h3>
                        {% include 'core/person_position_section.html' with positions=object.position_set.all.political.currently_inactive %}
                    </section>
                </div><commit_msg>Fix tab duplication issues<commit_after>{% extends 'base.html' %}
{% load thumbnail %}

{% block title %}{{ object.name }}{% endblock %}

{% block content %}
    <div class="title-space">
        <h1>{{ object.title }} {{ object.name }}</h1>

        {% if object.is_politician %}
            <p>Politician Profile Page</p>
        {% endif %}
        
        {% if object.is_aspirant %}
            <p>
                Aspirant in the upcoming elections:
                {% for aspiration in object.aspirant_positions %}
                    {{ aspiration.title }}
                    {% if not forloop.last %}, {% endif %}
                {% endfor %}
            </p>
        {% endif %}
    </div>
    
    <div class="profile-pic">
        {% thumbnail object.primary_image "210x210" crop="center" as im %}
        <img src="{{ im.url }}" alt="{{ object.name }}" width="{{ im.width }}" height="{{ im.height }}" />
        {% empty %}
        <img src="{{STATIC_URL}}images/avatar-210x210.jpg" />
        {% endthumbnail %}        
    </div>

    <div class="social-and-tools">
        {% include 'core/social_tools.html' %}
    </div>

    <div class="profile-info">
        <div class="constituency-party">

            {% if object.aspirant_constituencies.count %}
                <h3>Aspirant for</h3>
                <ul>
                    {% for constituency in object.aspirant_constituencies %}
                        <li><a href="{{ constituency.get_absolute_url }}">{{ constituency.name }}</a></li>
                    {% endfor %}
            {% endif %}

            <h3>Constituency</h3>
            <ul>
                {% for constituency in object.constituencies %}
                    <li><a href="{{ constituency.get_absolute_url }}">{{ constituency.name }}</a></li>
                {% empty %}
                    <li>Not an MP for any constituencies</li>
                {% endfor %}
            </ul>

            <h3>Party &amp; Coalition</h3>
            <ul>
                {% for party in object.parties_and_coalitions %}
                    <li><a href="{{ party.get_absolute_url }}">{{ party.name }}</a></li>
                {% empty %}
                    <li><p>Not a member of any parties or coalitions</p></li>
                {% endfor %}
            </ul>
        </div>

        <div class="profile-names">
            {% if object.name != object.legal_name %}
                <h3>Full name</h3>
                <p>{{ object.legal_name }}</p>
            {% endif %}

            {% if object.additional_names %}
                <h3>Also known as</h3>
                <p>{% for name in object.additional_names %}
                    {% if not forloop.first %}
                        {% if forloop.last %}or{% else %},{% endif %}
                    {% endif %}
                    <strong>{{ name }}</strong>
                {% endfor %}</p>
            {% endif %}
        
            {% if object.date_of_birth %}
                <h3>Born</h3>
                <p>{{ object.date_of_birth }} {# TODO - add age in years #}</p>
            {% endif %}
        
            {# TODO - add death date too if it exists #}
        </div>

    </div>

    <div class="large-container">

        <div class="tab-wrapper">

          <h2 class="tab-nav" rel="#contact-details">Contact Details</h2>
          <div class="tab" id="contact-details">
            {% include "core/contact_list.html" with contacts=object.contacts.all %}
          </div>

          <h2 class="tab-nav" rel="#scorecard">Scorecard</h2>
          <div class="tab" id="scorecard">
            {% include 'scorecards/scorecard.html' %}
          </div>

            {% if object.summary %}
            <h2 class="tab-nav" rel="#overview">Overview</h2>
            <div class="tab markdown" id="overview">
                {{ object.summary }}
            </div>
            {% endif %}

            {% include 'disqus_comments.html' %}

            <h2 class="tab-nav" rel="#experience">Experience</h2>
            <div class="tab" id="experience">
                <div class="left-col">
                    <section>
                        <h3>Current Political Positions</h3>
                        {% include 'core/person_position_section.html' with positions=object.position_set.all.political.currently_active %}
                    </section>

                    <section>
                        <h3>Previous Political Positions</h3>
                        {% include 'core/person_position_section.html' with positions=object.position_set.all.political.currently_inactive %}
                    </section>
                </div>
{'fraction_non_alphanumeric': 0.15317333333333333, 'fraction_numerical': 0.008106666666666667, 'mean_word_length': 1.4493207941483803, 'pattern_counts': {'":': 0, '<': 187, '<?xml version=': 0, '>': 187, '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': '7550381', 'n_tokens_mistral': 2894, 'n_tokens_neox': 2506, 'n_words': 528}