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

{% block og_tags %}
  <meta property="og:site_name" content="ElectionLeaflets.org" />
  <meta property="og:title" content="{{ object.get_title }}" />
  <meta property="og:type" content="website" />
  <meta property="og:url" content="{{ leaflet.get_absolute_url }}" />
  <meta name="og:description" content="{{ object.description }}">

  <meta name="twitter:card" content="summary_large_image">
  <meta name="twitter:site" content="@electionspotter">
  <meta name="twitter:creator" content="@electionspotter">
  <meta name="twitter:title" content="{{ object.get_title }}">
  <meta name="twitter:description" content="{{ object.description|markdown|striptags|truncatechars:"200" }}">

  <meta name="twitter:card" content="summary_large_image">
  <meta name="twitter:site" content="@electionspotter">
  <meta name="twitter:creator" content="@electionspotter">
  <meta name="twitter:title" content="{{ object.get_title }}">
  <meta name="twitter:description" content="{{ object.description|markdown|striptags|truncatechars:"200" }}">
  {% if object.location %}
    <meta property="place:location:latitude"  content="{{ object.location.1 }}" />
    <meta property="place:location:longitude" content="{{ object.location.0 }}" />
    <meta property="og:latitude"  content="{{ object.location.1 }}" />
    <meta property="og:longitude" content="{{ object.location.0 }}" />
  {% endif %}
  {% for image in object.images.all %}
    {% thumbnail object.images.all.0.image "600" crop="center" as im %}
      {% if forloop.first %}
        <meta property="og:image" content="{{ im.url }}" />
      {% endif %}
      <meta name="twitter:image{{forloop.counter0}}" content="{{ im.url }}">
    {% endthumbnail %}
  {% endfor %}
{% endblock og_tags %}

{% block extra_head %}{% endblock %}

{% block content %}
  <div class="row">
    {# {% if request.user.is_staff %} #}
    {#   <section class="admin_tools columns large-12"> #}
    {#     <ul> #}
    {#         <li><a class='staff_link' href='/admin/leaflets/leaflet/{{ object.id }}/'>Edit leaflet</a></li> #}
    {#         <li> #}
    {#             <form method="post">{{ form }} #}
    {#                 <button type="submit" name="submit">Save</button> #}
    {#                 <button type="submit" name="submit_and_next">Save &amp; review next</button> #}
    {#             </form> #}
    {#         </li> #}
    {#     </ul> #}
    {#   </section> #}
    {# {% endif %} #}
    <article class="columns large-8">
      <h1>
        {% if object.get_title %}
          {{ object.get_title }}
        {% else %}
          Leaflet #{{object.id}}
        {% endif %}
      </h1>
      <p>This leaflet was spotted by a volunteer
      {% if object.constituency %}
        in <a href="{% url "constituency-view"  object.constituency.pk object.constituency.slug %}">{{ object.constituency.name }}</a>
      {% endif %} <br>on {{ object.date_uploaded|date:"l, d M, Y" }}.</p>

      {% if object.publisher_person %}
        <section class="person">
              <p>
                Sent by
                <a href="{% url "person" object.publisher_person.remote_id %}">
                  {{object.publisher_person.name}}
                </a>
              </p>
        </section>

      {% endif %}

      {% if object.publisher_party %}
        <section class="party">
            {% if object.publisher_party and object.publisher_party.slug %}
              <p>
                Published by
                <a href="{% url "party-view" object.publisher_party.pk object.publisher_party.slug %}">
                  <img src="http://openelectoralcommission.org.uk/party_images/{{ object.publisher_party.emblems.all.0.emblem_url }}" width="40px">
                  {{object.publisher_party.party_name}}
                </a>
              </p>
            {% endif %}
        </section>
      {% endif %}

      <section class="leaflet_images" aria-describedby=leaflet_description>
        {% for image in object.images.all %}
          <figure>
            <a href="{% url "full_image"  image.id %}" class="leaflet_link">
              {% thumbnail image.image "600" crop="center" as im %}
              <img src="{{ im.url }}" aria-labelledby="page-{{image.id}}" data-full_image_url="{{ image.image.url }}">
              {% endthumbnail %}
            </a>
            <figcaption>
              {% if image.image_type == "1_front" %}
                  <span id="page-{{image.id}}">Leaflet Front</span>
              {% endif %}
              {% include "leaflets/includes/leaflet_admin_links.html" %}
              <a href="{% url "all_images"  object.id %}">view all pages</a>
            </figcaption>
          </figure>
        {% endfor%}
      </section>

      <section class="leaflet_information">
        <div id="leaflet_description">
        {% if object.description %}
            {{ object.description|markdown }}
        {% endif %}
        </div>


        {% if object.imprint %}
          <div id="leaflet_imprint">
          <h4>Promoter and Publisher details</h4>
          <p>{{ object.imprint }}</p>
          </div>
        {% endif %}

        {% if object.tags.all %}
          <h4>Tags</h4>
          <ul>
              {% for t in object.tags.all %}
                  {% if t.slug %}
                      <li><a href="{% url "tag"  t.slug %}">{{t.tag}}</a></li>
                  {% endif %}
              {% endfor %}
          </ul>
        {% endif %}
      </section>


      <section class="leaflet_map">
      <div id="leaflet_map"></div>
      </section>
    </article>

    <aside class="columns large-4">
      {% include "analysis/includes/analysis_form.html" %}
      <section class="share">
        <h3>Something interesting, dodgy or funny? Shout about it!</h3>

        <a class="button" href="https://twitter.com/intent/tweet?url={{ leaflet.get_absolute_url }}&hashtags=electionleaflet&via=electionspotter">
          <i class="fa fa-twitter"></i>
          Tweet this leaflet
        </a>

        <a class="button" href="https://www.facebook.com/sharer/sharer.php?u={{ leaflet.get_absolute_url }}&ref=responsive">
          <i class="fa fa-facebook"></i>
          Share on Facebook
        </a>

      </section>


      <section class="share">
        <h3>Seen a claim on this leaflet?</h3>

        <p>
          <a href="http://www.askforevidence.org/" target="_blank">
            <img src="{{ MEDIA_URL }}images/AskforEvidencewebbutton.png" alt="Ask for Evidence" title="Ask for Evidence" width="199" height="141" />
          </a>
        </p>
      </section>

      <section id="ReportAbuse">
        <h3>Something wrong with this page?</h3>
        <p>
          <a href="{% url "report_abuse"  object.id %}" class="button alert"> Report a problem</a>
          If someone has uploaded something other than an election leaflet,
          then please let us know.
        </p>
        <p>
          The data on this page is available in <a href="http://{{ request.META.HTTP_HOST }}{% url "api:leaflet-detail" object.pk%}?format=json">JSON format</a>. The images of this leaflet should be considered to be in the public domain, in accordance with the <a href="https://creativecommons.org/publicdomain/zero/1.0/">Public Domain Dedication</a>.
        </p>
        {% if request.user.is_staff %}
            <hr/>
            <a class='staff_link' href='/admin/leaflets/leaflet/{{ object.id }}/'>Edit leaflet</a>
        {% endif %}

      </section>
  </aside>



{% endblock %}
{% block extra_scripts %}
<script type="text/javascript">
var point = [{{leaflet.location.1}},{{leaflet.location.0}}];
var constituency_id = "{{object.constituency.constituency_id}}";
create_leaflet_map(point, constituency_id);


function UseZoom(){
    return !(
        (navigator.platform.indexOf("iPhone") != -1) ||
        (navigator.platform.indexOf("iPod") != -1) ||
        (navigator.platform.indexOf("iPad") != -1)
    );
}

if (UseZoom()) {
  $.each($('.leaflet_images figure a'), function(i, el) {
    var full_image = $(el).find('img').data('full_image_url');
    $(el).zoom({
      url: full_image
    });
  })
}

</script>
{% endblock %}
<commit_msg>Fix URL for Ask for Evidence button<commit_after>{% extends "base.html" %}
{% load thumbnail %}
{% load markdown_deux_tags %}

{% block og_tags %}
  <meta property="og:site_name" content="ElectionLeaflets.org" />
  <meta property="og:title" content="{{ object.get_title }}" />
  <meta property="og:type" content="website" />
  <meta property="og:url" content="{{ leaflet.get_absolute_url }}" />
  <meta name="og:description" content="{{ object.description }}">

  <meta name="twitter:card" content="summary_large_image">
  <meta name="twitter:site" content="@electionspotter">
  <meta name="twitter:creator" content="@electionspotter">
  <meta name="twitter:title" content="{{ object.get_title }}">
  <meta name="twitter:description" content="{{ object.description|markdown|striptags|truncatechars:"200" }}">

  <meta name="twitter:card" content="summary_large_image">
  <meta name="twitter:site" content="@electionspotter">
  <meta name="twitter:creator" content="@electionspotter">
  <meta name="twitter:title" content="{{ object.get_title }}">
  <meta name="twitter:description" content="{{ object.description|markdown|striptags|truncatechars:"200" }}">
  {% if object.location %}
    <meta property="place:location:latitude"  content="{{ object.location.1 }}" />
    <meta property="place:location:longitude" content="{{ object.location.0 }}" />
    <meta property="og:latitude"  content="{{ object.location.1 }}" />
    <meta property="og:longitude" content="{{ object.location.0 }}" />
  {% endif %}
  {% for image in object.images.all %}
    {% thumbnail object.images.all.0.image "600" crop="center" as im %}
      {% if forloop.first %}
        <meta property="og:image" content="{{ im.url }}" />
      {% endif %}
      <meta name="twitter:image{{forloop.counter0}}" content="{{ im.url }}">
    {% endthumbnail %}
  {% endfor %}
{% endblock og_tags %}

{% block extra_head %}{% endblock %}

{% block content %}
  <div class="row">
    {# {% if request.user.is_staff %} #}
    {#   <section class="admin_tools columns large-12"> #}
    {#     <ul> #}
    {#         <li><a class='staff_link' href='/admin/leaflets/leaflet/{{ object.id }}/'>Edit leaflet</a></li> #}
    {#         <li> #}
    {#             <form method="post">{{ form }} #}
    {#                 <button type="submit" name="submit">Save</button> #}
    {#                 <button type="submit" name="submit_and_next">Save &amp; review next</button> #}
    {#             </form> #}
    {#         </li> #}
    {#     </ul> #}
    {#   </section> #}
    {# {% endif %} #}
    <article class="columns large-8">
      <h1>
        {% if object.get_title %}
          {{ object.get_title }}
        {% else %}
          Leaflet #{{object.id}}
        {% endif %}
      </h1>
      <p>This leaflet was spotted by a volunteer
      {% if object.constituency %}
        in <a href="{% url "constituency-view"  object.constituency.pk object.constituency.slug %}">{{ object.constituency.name }}</a>
      {% endif %} <br>on {{ object.date_uploaded|date:"l, d M, Y" }}.</p>

      {% if object.publisher_person %}
        <section class="person">
              <p>
                Sent by
                <a href="{% url "person" object.publisher_person.remote_id %}">
                  {{object.publisher_person.name}}
                </a>
              </p>
        </section>

      {% endif %}

      {% if object.publisher_party %}
        <section class="party">
            {% if object.publisher_party and object.publisher_party.slug %}
              <p>
                Published by
                <a href="{% url "party-view" object.publisher_party.pk object.publisher_party.slug %}">
                  <img src="http://openelectoralcommission.org.uk/party_images/{{ object.publisher_party.emblems.all.0.emblem_url }}" width="40px">
                  {{object.publisher_party.party_name}}
                </a>
              </p>
            {% endif %}
        </section>
      {% endif %}

      <section class="leaflet_images" aria-describedby=leaflet_description>
        {% for image in object.images.all %}
          <figure>
            <a href="{% url "full_image"  image.id %}" class="leaflet_link">
              {% thumbnail image.image "600" crop="center" as im %}
              <img src="{{ im.url }}" aria-labelledby="page-{{image.id}}" data-full_image_url="{{ image.image.url }}">
              {% endthumbnail %}
            </a>
            <figcaption>
              {% if image.image_type == "1_front" %}
                  <span id="page-{{image.id}}">Leaflet Front</span>
              {% endif %}
              {% include "leaflets/includes/leaflet_admin_links.html" %}
              <a href="{% url "all_images"  object.id %}">view all pages</a>
            </figcaption>
          </figure>
        {% endfor%}
      </section>

      <section class="leaflet_information">
        <div id="leaflet_description">
        {% if object.description %}
            {{ object.description|markdown }}
        {% endif %}
        </div>


        {% if object.imprint %}
          <div id="leaflet_imprint">
          <h4>Promoter and Publisher details</h4>
          <p>{{ object.imprint }}</p>
          </div>
        {% endif %}

        {% if object.tags.all %}
          <h4>Tags</h4>
          <ul>
              {% for t in object.tags.all %}
                  {% if t.slug %}
                      <li><a href="{% url "tag"  t.slug %}">{{t.tag}}</a></li>
                  {% endif %}
              {% endfor %}
          </ul>
        {% endif %}
      </section>


      <section class="leaflet_map">
      <div id="leaflet_map"></div>
      </section>
    </article>

    <aside class="columns large-4">
      {% include "analysis/includes/analysis_form.html" %}
      <section class="share">
        <h3>Something interesting, dodgy or funny? Shout about it!</h3>

        <a class="button" href="https://twitter.com/intent/tweet?url={{ leaflet.get_absolute_url }}&hashtags=electionleaflet&via=electionspotter">
          <i class="fa fa-twitter"></i>
          Tweet this leaflet
        </a>

        <a class="button" href="https://www.facebook.com/sharer/sharer.php?u={{ leaflet.get_absolute_url }}&ref=responsive">
          <i class="fa fa-facebook"></i>
          Share on Facebook
        </a>

      </section>


      <section class="share">
        <h3>Seen a claim on this leaflet?</h3>

        <p>
          <a href="http://www.askforevidence.org/" target="_blank">
            <img src="{{ STATIC_URL }}images/AskforEvidencewebbutton.png" alt="Ask for Evidence" title="Ask for Evidence" width="199" height="141" />
          </a>
        </p>
      </section>

      <section id="ReportAbuse">
        <h3>Something wrong with this page?</h3>
        <p>
          <a href="{% url "report_abuse"  object.id %}" class="button alert"> Report a problem</a>
          If someone has uploaded something other than an election leaflet,
          then please let us know.
        </p>
        <p>
          The data on this page is available in <a href="http://{{ request.META.HTTP_HOST }}{% url "api:leaflet-detail" object.pk%}?format=json">JSON format</a>. The images of this leaflet should be considered to be in the public domain, in accordance with the <a href="https://creativecommons.org/publicdomain/zero/1.0/">Public Domain Dedication</a>.
        </p>
        {% if request.user.is_staff %}
            <hr/>
            <a class='staff_link' href='/admin/leaflets/leaflet/{{ object.id }}/'>Edit leaflet</a>
        {% endif %}

      </section>
  </aside>



{% endblock %}
{% block extra_scripts %}
<script type="text/javascript">
var point = [{{leaflet.location.1}},{{leaflet.location.0}}];
var constituency_id = "{{object.constituency.constituency_id}}";
create_leaflet_map(point, constituency_id);


function UseZoom(){
    return !(
        (navigator.platform.indexOf("iPhone") != -1) ||
        (navigator.platform.indexOf("iPod") != -1) ||
        (navigator.platform.indexOf("iPad") != -1)
    );
}

if (UseZoom()) {
  $.each($('.leaflet_images figure a'), function(i, el) {
    var full_image = $(el).find('img').data('full_image_url');
    $(el).zoom({
      url: full_image
    });
  })
}

</script>
{% endblock %}

{'fraction_non_alphanumeric': 0.1775593179197767, 'fraction_numerical': 0.006189695976697615, 'mean_word_length': 2.397237682951969, 'pattern_counts': {'":': 0, '<': 277, '<?xml version=': 0, '>': 277, 'https://': 6, 'lorem ipsum': 0, 'www.': 4, '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': '6338226', 'n_tokens_mistral': 5441, 'n_tokens_neox': 5050, 'n_words': 1030}