<commit_before>{% extends "admin/base.html" %}
{% block main %}

<div>
  <p>
    {% if limit == "Infinity" %}
    <a href="?">Limit Results</a>
    {% else %}

    <strong>Page</strong>: {{ pageNumber }}, <strong>Limit</strong>: {{ limit }}
      (<a href="?limit=0">show all</a>)
    </p>
    {% if pageNumber != 1 %}
      <a href="?limit={{limit}}&page={{pageNumber-1}}">
        <button class="btn">Previous Page</button>
      </a>
    {% endif %}
    <a href="?limit={{limit}}&page={{pageNumber+1}}">
      <button class="btn">Next Page</button>
    </a>
    {% endif %}

</div>


{% if badges.length %}
<table class="badge-list">
<tbody>
<tr>
<th class="oper view"></th>
<th class="orga">Organization</th>
<th class="prog">Program</th>
<th class="badg">Badge</th>
<th class="oper all"></th>
</tr>

{% for badge in badges %}
  <tr>
    <td class="oper view">
      <a class="badge-name" href="/admin/badge/{{ badge.shortname }}"><i class="icon-eye-open"></i></a>
    </td>
    <td class="orga">
      <a href="/admin/issuer/{{ badge.program.issuer.id | e}}">{{ badge.program.issuer.name | e}}</a>
    </td>
    <td class="prog">
      <a href="/admin/program/{{ badge.program.id | e}}">{{ badge.program.name | e}}</a>
    </td>
    <td class="badg">
      <a href="/admin/badge/{{ badge.shortname | e}}">{{ badge.name }}</a>
    </td>
    <td class="oper all">
      <div class="btn-group">
        <a class="btn btn-primary btn-small dropdown-toggle" data-toggle="dropdown" href="#"><span class="caret"></span></a>
        <ul class="dropdown-menu">
          <li><a href="/admin/badge/{{ badge.shortname }}/edit/"><i class="icon-pencil"></i> Edit Details</a></li>
          <li><a href="/admin/badge/{{ badge.shortname }}/claims/"><i class="icon-th-large"></i> Claim Codes</a></li>
        </ul>
      </div>
    </td>
  </tr>
{% endfor %}
</tbody>
</table>
{% endif %}
{% if issuers.length %}
<h2>Issuers</h2>
<ul class="unstyled">
{% for issuer in issuers.sort() %}
<li><a href="/admin/issuer/{{ issuer.id }}">{{ issuer.name }}</a></li>
{% endfor %}
</ul>
{% else %}
<p>No Issuers found.</p>
{% endif %}


{% endblock %}

{% block footer %}
<script src="/js/badge-index.js"></script>
{% endblock %}
<commit_msg>Always show previous button, disable when page == 1<commit_after>{% extends "admin/base.html" %}
{% block main %}

<div>
  <p>
    {% if limit == "Infinity" %}
    <a href="?">Limit Results</a>
    {% else %}

    <strong>Page</strong>: {{ pageNumber }}, <strong>Limit</strong>: {{ limit }}
      (<a href="?limit=0">show all</a>)
    </p>
    {% if pageNumber != 1 %}
      <a href="?limit={{limit}}&page={{pageNumber-1}}">
        <button class="btn">Previous Page</button>
      </a>

    {% else %}
      <button class="btn disabled">Previous Page</button>
    {% endif %}


    <a href="?limit={{limit}}&page={{pageNumber+1}}">
      <button class="btn">Next Page</button>
    </a>
    {% endif %}

</div>


{% if badges.length %}
<table class="badge-list">
<tbody>
<tr>
<th class="oper view"></th>
<th class="orga">Organization</th>
<th class="prog">Program</th>
<th class="badg">Badge</th>
<th class="oper all"></th>
</tr>

{% for badge in badges %}
  <tr>
    <td class="oper view">
      <a class="badge-name" href="/admin/badge/{{ badge.shortname }}"><i class="icon-eye-open"></i></a>
    </td>
    <td class="orga">
      <a href="/admin/issuer/{{ badge.program.issuer.id | e}}">{{ badge.program.issuer.name | e}}</a>
    </td>
    <td class="prog">
      <a href="/admin/program/{{ badge.program.id | e}}">{{ badge.program.name | e}}</a>
    </td>
    <td class="badg">
      <a href="/admin/badge/{{ badge.shortname | e}}">{{ badge.name }}</a>
    </td>
    <td class="oper all">
      <div class="btn-group">
        <a class="btn btn-primary btn-small dropdown-toggle" data-toggle="dropdown" href="#"><span class="caret"></span></a>
        <ul class="dropdown-menu">
          <li><a href="/admin/badge/{{ badge.shortname }}/edit/"><i class="icon-pencil"></i> Edit Details</a></li>
          <li><a href="/admin/badge/{{ badge.shortname }}/claims/"><i class="icon-th-large"></i> Claim Codes</a></li>
        </ul>
      </div>
    </td>
  </tr>
{% endfor %}
</tbody>
</table>
{% endif %}
{% if issuers.length %}
<h2>Issuers</h2>
<ul class="unstyled">
{% for issuer in issuers.sort() %}
<li><a href="/admin/issuer/{{ issuer.id }}">{{ issuer.name }}</a></li>
{% endfor %}
</ul>
{% else %}
<p>No Issuers found.</p>
{% endif %}


{% endblock %}

{% block footer %}
<script src="/js/badge-index.js"></script>
{% endblock %}

{'fraction_non_alphanumeric': 0.2574626865671642, 'fraction_numerical': 0.0028533801580333624, 'mean_word_length': 3.1654478976234004, 'pattern_counts': {'":': 0, '<': 185, '<?xml version=': 0, '>': 185, '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': '514072', 'n_tokens_mistral': 1804, 'n_tokens_neox': 1674, 'n_words': 342}