<commit_before>{% extends 'base.twig' %}

{% block title %}Browse | {{ parent() }}{% endblock %}

{% block content %}
<div class="" id="browse">

  <h2>Browse All Documents</h2>

  <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>

<div class="col-sm-3">
  <h3>Browse by:</h3>
  <ul class="nav nav-pills nav-stacked">
    {% for cat in sortCategories %}
      <li role="presentation" class="{% if cat == browseBy %}active{% endif %}">
        <a href="browse?browseBy={{ cat }}">{{ cat|capitalize }}</a>
      </li>
    {% endfor %}
  </ul>
</div>
<div class="col-sm-9">
  <div class="pull-right">
    <a href="javascript:void(0)" id="collapse-expand-all" data-state="collapsed">Expand all</a>
  </div>

  <ul class="list-unstyled" id="browse-results">
  {% for heading, item in results %}
    {% set browse_id = heading|lower|replace({' ': '', '.': '', ',': '', '[': '', ']': '', '/': ''}) %}
    <li>
      <h3><a class="category-header" data-toggle="collapse" href="#browse-{{ browse_id }}"
               aria-expanded="false" aria-controls="browse-{{ browse_id }}">
          {{ heading }} <small>({% if item|length == 1 %}1 letter{% else %}{{ item|length }} letters{% endif %})</small> <span class="glyphicon glyphicon-plus" aria-hidden="true"></span></a></h3>
      <div class="collapse" id="browse-{{ browse_id }}">
        <ul>
      {% for id, info in item %}
        <li>
          <a href="document?id={{ id }}.xml" id="browse-{{ id }}">{{ info.document_title }}</a><br>
          {{ info.document_summary }}
        </li>
      {% endfor %}
        </ul>
      </div>
  {% endfor %}
    </li>
  </ul>

  <nav>
    <ul class="pagination hidden">
      <li>Prev</li>
      <li>Page #n</li>
      <li>Page #n</li>
      <li>Page #c</li>
      <li>Page #n</li>
      <li>Page #n</li>
      <li>Next</li>
    </ul>
  </nav>
</div>
</div>
{% endblock %}

{% block scripts_footer %}
{{ parent() }}
<script>
  var totalHeadings = {{ results|length }};
</script>
<script src="assets/js/jquery-paging/jquery.paging.min.js"></script>
<script src="assets/js/browse.min.js"></script>
{% endblock %}<commit_msg>add action button to search for current browsing term.<commit_after>{% extends 'base.twig' %}

{% block title %}Browse | {{ parent() }}{% endblock %}

{% block content %}
<div class="" id="browse">

  <h2>Browse All Documents</h2>

  <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>

<div class="col-sm-3">
  <h3>Browse by:</h3>
  <ul class="nav nav-pills nav-stacked">
    {% for cat in sortCategories %}
      <li role="presentation" class="{% if cat == browseBy %}active{% endif %}">
        <a href="browse?browseBy={{ cat }}">{{ cat|capitalize }}</a>
      </li>
    {% endfor %}
  </ul>
</div>
<div class="col-sm-9">
  <div class="pull-right">
    <a href="javascript:void(0)" id="collapse-expand-all" data-state="collapsed">Expand all</a>
  </div>

  <ul class="list-unstyled" id="browse-results">
  {% for heading, item in results %}
    {% set browse_id = heading|lower|replace({' ': '', '.': '', ',': '', '[': '', ']': '', '/': ''}) %}
    <li>
      <h3><a class="category-header" data-toggle="collapse" href="#browse-{{ browse_id }}"
               aria-expanded="false" aria-controls="browse-{{ browse_id }}">
          {{ heading }} <small>({% if item|length == 1 %}1 letter{% else %}{{ item|length }} letters{% endif %})</small> <span class="glyphicon glyphicon-plus" aria-hidden="true"></span></a></h3>
      <div class="collapse" id="browse-{{ browse_id }}">
        <a class="btn btn-primary btn-sm" href="search?query={{ heading|url_encode }}">Search for {{ heading }}</a>
        <ul>
      {% for id, info in item %}
        <li>
          <a href="document?id={{ id }}.xml" id="browse-{{ id }}">{{ info.document_title }}</a><br>
          {{ info.document_summary }}
        </li>
      {% endfor %}
        </ul>
      </div>
  {% endfor %}
    </li>
  </ul>

  <nav>
    <ul class="pagination hidden">
      <li>Prev</li>
      <li>Page #n</li>
      <li>Page #n</li>
      <li>Page #c</li>
      <li>Page #n</li>
      <li>Page #n</li>
      <li>Next</li>
    </ul>
  </nav>
</div>
</div>
{% endblock %}

{% block scripts_footer %}
{{ parent() }}
<script>
  var totalHeadings = {{ results|length }};
</script>
<script src="assets/js/jquery-paging/jquery.paging.min.js"></script>
<script src="assets/js/browse.min.js"></script>
{% endblock %}
{'fraction_non_alphanumeric': 0.21976866456361724, 'fraction_numerical': 0.0046267087276551, 'mean_word_length': 3.142857142857143, 'pattern_counts': {'":': 0, '<': 139, '<?xml version=': 0, '>': 139, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4098207', 'n_tokens_mistral': 1817, 'n_tokens_neox': 1692, 'n_words': 394}