<commit_before>{% extends "base.html" %}
{% load i18n %}
{% load crispy_forms_tags %}

{% block content %}



<h3>
  {% if request.user.is_staff %}
    <a class="button success small ffab-before fa-plus right" href="{% url "reservation.create" %}" style="margin-top: -5px;">
      Create reservation
    </a>
  {% endif %}
  Reservations
</h3>

<table id="room-list-table">
  <thead>
    <tr>
      <th>Title</th>
      <th class="col-min">Start</th>
      <th class="col-min">End</th>
      <th>User</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    {% for r in approved %}
      <tr>
        <td>
          {{ r.title }}
        </td>
        <td class="col-min">
          {{ r.start }}
        </td>
        <td class="col-min">
          {{ r.end }}
        </td>
        <td class="col-min">
          {{ r.reserver }}
        </td>
        <td>
          <a class="button tiny secondary ffab-after fa-eye" href="{% url "reservation.detail" pk=r.pk %}">
            view
          </a>
        </td>
      </tr>
      {% empty %}
        <tr>
          <td colspan="4">No reservations</td>
        </tr>
    {% endfor %}
  </tbody>
</table>


{% if request.user.is_staff %}
  <h3>
    Pending reservations
  </h3>

  <ul class="large-block-grid-2">
    {% for p in pending %}
      <li class="approve-box" style="position: relative;">
        <form action="{% url "reservation.approve" pk=p.pk %}" method="POST">
          {% csrf_token %}
          <button type="submit" class="button alert tiny ffab-before fa-times" name="reject">
            Reject
          </button>
          <button type="submit" class="button success tiny ffab-before fa-check" name="approve">
            Approve
          </button>
        </form>
        <div style="float: right; text-align: center;" class="r-text">
          {{ p.start }}
          <br />
          -
          <br />
          {{ p.end }}
        </div>
        <label>Title</label>
        <span class="r-text">{{ p.title }}</span>
        <label>User</label>
        <span class="r-text">{{ p.reserver }}</span>
        <label>Public</label>
        <span class="r-text">
          <i class="fa fa-{% if p.is_public %}check{% else %}times{% endif %}"></i>
        </span>
        <div style="clear: both;"></div>
      </li>
      {% empty %}
        <li>No pending reservations</li>
    {% endfor %}
  </ul>

  <h3>
    Rejected reservations
  </h3>
{% endif %}

<h3>
  Previous reservations
</h3>

{% endblock %}
<commit_msg>rrra: fix block grid on smaller screens<commit_after>{% extends "base.html" %}
{% load i18n %}
{% load crispy_forms_tags %}

{% block content %}



<h3>
  {% if request.user.is_staff %}
    <a class="button success small ffab-before fa-plus right" href="{% url "reservation.create" %}" style="margin-top: -5px;">
      Create reservation
    </a>
  {% endif %}
  Reservations
</h3>

<table id="room-list-table">
  <thead>
    <tr>
      <th>Title</th>
      <th class="col-min">Start</th>
      <th class="col-min">End</th>
      <th>User</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    {% for r in approved %}
      <tr>
        <td>
          {{ r.title }}
        </td>
        <td class="col-min">
          {{ r.start }}
        </td>
        <td class="col-min">
          {{ r.end }}
        </td>
        <td class="col-min">
          {{ r.reserver }}
        </td>
        <td>
          <a class="button tiny secondary ffab-after fa-eye" href="{% url "reservation.detail" pk=r.pk %}">
            view
          </a>
        </td>
      </tr>
      {% empty %}
        <tr>
          <td colspan="4">No reservations</td>
        </tr>
    {% endfor %}
  </tbody>
</table>


{% if request.user.is_staff %}
  <h3>
    Pending reservations
  </h3>

  <ul class="large-block-grid-2 small-block-grid-1">
    {% for p in pending %}
      <li class="approve-box" style="position: relative;">
        <form action="{% url "reservation.approve" pk=p.pk %}" method="POST">
          {% csrf_token %}
          <button type="submit" class="button alert tiny ffab-before fa-times" name="reject">
            Reject
          </button>
          <button type="submit" class="button success tiny ffab-before fa-check" name="approve">
            Approve
          </button>
        </form>
        <div style="float: right; text-align: center;" class="r-text">
          {{ p.start }}
          <br />
          -
          <br />
          {{ p.end }}
        </div>
        <label>Title</label>
        <span class="r-text">{{ p.title }}</span>
        <label>User</label>
        <span class="r-text">{{ p.reserver }}</span>
        <label>Public</label>
        <span class="r-text">
          <i class="fa fa-{% if p.is_public %}check{% else %}times{% endif %}"></i>
        </span>
        <div style="clear: both;"></div>
      </li>
      {% empty %}
        <li>No pending reservations</li>
    {% endfor %}
  </ul>

  <h3>
    Rejected reservations
  </h3>
{% endif %}

<h3>
  Previous reservations
</h3>

{% endblock %}

{'fraction_non_alphanumeric': 0.18972018257590792, 'fraction_numerical': 0.00535820599325263, 'mean_word_length': 1.814070351758794, 'pattern_counts': {'":': 0, '<': 159, '<?xml version=': 0, '>': 159, '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': '5546613', 'n_tokens_mistral': 1822, 'n_tokens_neox': 1691, 'n_words': 381}