<commit_before>{% extends "base.html" %}

{% load i18n %}

{% block content %}
<div class="row">
  <div class="col-md-8 col-md-offset-2">
    {% if query %}
    {% if object_list %}
    <h2>{% blocktrans count result_count=paginator.count %}{{ result_count }} result for your search '{{ search_term }}'{% plural %}{{ result_count }} results for your search '{{ search_term }}'{% endblocktrans %}</h2>
    {% else %}
    <h2>{% blocktrans %}No results for your search '{{ search_term }}'{% endblocktrans %}</h2>
    {% endif %}

     {% if user.is_authenticated %}
    <p>{% trans "You can save this search and get notified when new results come up" %}</p>
    <p>
      <a href="{% url "add-subscription" %}?q={{ request.GET.q }}">
	<button type="button" class="btn btn-default">{% trans "Subscribe to this search" %}</button>
      </a>
    </p>
    {% endif %}

    {% if object_list %}
    <ol class="search-results list-unstyled" id="search-results">
      {% for result in object_list %}
      <li>
	<a href="{{ result.object.get_absolute_url }}?q={{ request.GET.q }}"><h3>{{ result.object.title }}</h3></a>
	<p>{{ result.object.original.issue.summary }}</p>
      </li>
      {% endfor %}
    </ol>
    {% else %}
    <p>{% trans "No results found. Try a broader search term" %}</p>
    {% endif %}

    {% if page.has_previous or page.has_next %}
    <div>
      {% if page.has_previous %}<a href="?q={{ query }}&amp;page={{ page.previous_page_number }}">{% endif %}&laquo; {% trans "Previous" %}{% if page.has_previous %}</a>{% endif %}
      |
      {% if page.has_next %}<a href="?q={{ query }}&amp;page={{ page.next_page_number }}">{% endif %}{% trans "Next" %} &raquo;{% if page.has_next %}</a>{% endif %}
    </div>
    {% endif %}
    {% else %}
    <p>{% trans "Search for decisions" %}</p>
    {% endif %}
  </div>
</div>
{% endblock %}

{% block script %}
<script type="text/javascript">
  $(document).ready(function() {
    $("#search-results").hide();
    $("#search-results").fadeIn();
  });
</script>
{% endblock %}<commit_msg>closes #29. the search view now shows more interesting information and animates the results to draw attention<commit_after>{% extends "base.html" %}

{% load i18n %}

{% block content %}
<div class="row">
  <div class="col-md-8 col-md-offset-2">
    {% if query %}
    {% with request.GET.q as search_term %}
    {% if object_list %}
    <h2>{% blocktrans count result_count=paginator.count %}{{ result_count }} result for your search '{{ search_term }}'{% plural %}{{ result_count }} results for your search '{{ search_term }}'{% endblocktrans %}</h2>
    {% else %}
    <h2>{% blocktrans %}No results for your search '{{ search_term }}'{% endblocktrans %}</h2>
    {% endif %}
    {% endwith %}

     {% if user.is_authenticated %}
    <p>{% trans "You can save this search and get notified when new results come up" %}</p>
    <p>
      <a href="{% url "add-subscription" %}?q={{ request.GET.q }}">
	<button type="button" class="btn btn-default">{% trans "Subscribe to this search" %}</button>
      </a>
    </p>
    {% endif %}

    {% if object_list %}
    <ol class="search-results list-unstyled" id="search-results">
      {% for result in object_list %}
      <li>
	<h3>
	  <a href="{{ result.object.get_absolute_url }}?q={{ request.GET.q }}">
	    {{ result.object.title }}
	  </a>
	  <br>
	  <small>
	    <time datetime="{{ result.object.last_modified_time.isoformat }}">{% blocktrans with result.object.last_modified_time|timesince as since %}{{ since }} ago{% endblocktrans %}</time>
	  </small>
	</h3>
	<p>{{ result.object.original.issue.summary }}</p>
      </li>
      {% endfor %}
    </ol>
    {% else %}
    <p>{% trans "No results found. Try a broader search term" %}</p>
    {% endif %}

    {% if page.has_previous or page.has_next %}
    <div>
      {% if page.has_previous %}<a href="?q={{ query }}&amp;page={{ page.previous_page_number }}">{% endif %}&laquo; {% trans "Previous" %}{% if page.has_previous %}</a>{% endif %}
      |
      {% if page.has_next %}<a href="?q={{ query }}&amp;page={{ page.next_page_number }}">{% endif %}{% trans "Next" %} &raquo;{% if page.has_next %}</a>{% endif %}
    </div>
    {% endif %}
    {% else %}
    <p>{% trans "Search for decisions" %}</p>
    {% endif %}
  </div>
</div>
{% endblock %}

{% block script %}
<script type="text/javascript">
  $(document).ready(function() {
    $("#search-results").hide();
    $("#search-results").slideDown();
  });
</script>
{% endblock %}
{'fraction_non_alphanumeric': 0.21625835189309578, 'fraction_numerical': 0.004899777282850779, 'mean_word_length': 3.277142857142857, 'pattern_counts': {'":': 0, '<': 84, '<?xml version=': 0, '>': 84, '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': '3943099', 'n_tokens_mistral': 1665, 'n_tokens_neox': 1510, 'n_words': 397}