<commit_before>{% extends "base.html" %}
{% load pipeline %}
{% load static %}

{% block extra_css %}
  {% stylesheet 'official_documents' %}
{% endblock %}

{% block hero %}
<h1>Statement of Persons Nominated</h1>
{% endblock %}

{% block content %}
  <h2>
    <a href="{{ object.get_absolute_url }}">
      {{ object.election.name }}: <br>
      {{ object.post.label }}
    </a>
  </h2>
  <p>{{ object.election.election_date }}</p>
  {% if object.sopn %}
    <p>This document was first published at {{ object.sopn.source_url|urlize }}. Showing the archived copy.</p>
    <p><a href="{{ object.sopn.uploaded_file.url }}" class="button small">Download PDF</a></p>

    {% if documents_with_same_source.exists and documents_with_same_source.count > 1 %}
      <p>
        <strong>
        Watch out! The original document contains candidate info for {{ documents_with_same_source.count }}
        area{{ documents_with_same_source.count|pluralize }}</strong>.
        Make sure you're looking at the right area.
      </p>
    {% endif %}


    <div id="sopn-{{ object.ballot_paper_id }}" class="pdf_container"></div>


  {% else %}
    No SOPN uploaded for this ballot paper yet.
  {% endif %}


  {% if user.is_staff and user_can_upload_documents %}
  {% url 'admin:official_documents_officialdocument_change' object.id as url %}
  You can <a href="{{ url }}">edit this in the admin interface</a> (e.g. to delete it)
  {% endif %}

  <script src="{% static "official_documents/js/pdf.2.0.943.js" %}"></script>
  <script src="{% static "official_documents/js/pdf.worker.2.0.943.js" %}"></script>
  {% javascript 'sopn_viewer' %}
  <script>
  SOPN_VIEWER.ShowSOPNInline(
    '{{ object.sopn.uploaded_file.url }}',
    '{{ object.ballot_paper_id }}',
    {
    {% if object.sopn.relevant_pages and object.sopn.relevant_pages != "all"%}
      'start_page': {{ object.sopn.first_page_number }},
      'end_page': {{ object.sopn.last_page_number }}
    {% endif %}
    }
  )

  </script>
{% endblock %}
<commit_msg>Fix link to admin interface on SOPN page<commit_after>{% extends "base.html" %}
{% load pipeline %}
{% load static %}

{% block extra_css %}
  {% stylesheet 'official_documents' %}
{% endblock %}

{% block hero %}
<h1>Statement of Persons Nominated</h1>
{% endblock %}

{% block content %}
  <h2>
    <a href="{{ object.get_absolute_url }}">
      {{ object.election.name }}: <br>
      {{ object.post.label }}
    </a>
  </h2>
  <p>{{ object.election.election_date }}</p>
  {% if object.sopn %}
    <p>This document was first published at {{ object.sopn.source_url|urlize }}. Showing the archived copy.</p>
    <p><a href="{{ object.sopn.uploaded_file.url }}" class="button small">Download PDF</a></p>

    {% if documents_with_same_source.exists and documents_with_same_source.count > 1 %}
      <p>
        <strong>
        Watch out! The original document contains candidate info for {{ documents_with_same_source.count }}
        area{{ documents_with_same_source.count|pluralize }}</strong>.
        Make sure you're looking at the right area.
      </p>
    {% endif %}


    <div id="sopn-{{ object.ballot_paper_id }}" class="pdf_container"></div>


  {% else %}
    No SOPN uploaded for this ballot paper yet.
  {% endif %}


  {% if user.is_staff and user_can_upload_documents %}
  {% url 'admin:official_documents_officialdocument_change' object.sopn.id as url %}
  You can <a href="{{ url }}">edit this in the admin interface</a> (e.g. to delete it)
  {% endif %}

  <script src="{% static "official_documents/js/pdf.2.0.943.js" %}"></script>
  <script src="{% static "official_documents/js/pdf.worker.2.0.943.js" %}"></script>
  {% javascript 'sopn_viewer' %}
  <script>
  SOPN_VIEWER.ShowSOPNInline(
    '{{ object.sopn.uploaded_file.url }}',
    '{{ object.ballot_paper_id }}',
    {
    {% if object.sopn.relevant_pages and object.sopn.relevant_pages != "all"%}
      'start_page': {{ object.sopn.first_page_number }},
      'end_page': {{ object.sopn.last_page_number }}
    {% endif %}
    }
  )

  </script>
{% endblock %}

{'fraction_non_alphanumeric': 0.17003948667324778, 'fraction_numerical': 0.007403751233958539, 'mean_word_length': 3.4198473282442747, 'pattern_counts': {'":': 0, '<': 61, '<?xml version=': 0, '>': 63, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3748337', 'n_tokens_mistral': 1532, 'n_tokens_neox': 1379, 'n_words': 305}