1.5 KiB · text History aecd85b
{% extends "root.html" %}

{% block content %}
<div class="space-y-4">
  <a href="/areas/{{ area.id }}" class="btn btn-ghost btn-sm">&larr; {{ area.name }}</a>
  <h2 class="text-2xl font-bold text-accent">History</h2>
  {% if lunches | length == 0 %}
    <p class="text-sm opacity-70">Nothing logged in {{ area.name }} yet. Log a lunch from <a class="link" href="/areas/{{ area.id }}/plan">Where to?</a> or a restaurant's page.</p>
  {% else %}
  <div class="overflow-x-auto border border-base-300 rounded-box">
    <table class="table table-sm">
      <thead><tr><th>Date</th><th>Where</th><th>Who</th><th></th></tr></thead>
      <tbody>
        {% for l in lunches %}
        <tr>
          <td class="font-mono whitespace-nowrap">{{ l.went_on }}</td>
          <td><a class="link link-hover" href="/restaurants/{{ l.restaurant_id }}">{{ l.restaurant }}</a></td>
          <td class="text-sm">{{ l.attendees | join(", ") }}</td>
          <td class="text-right">
            {% if l.can_delete %}
            <form method="post" action="/lunches/{{ l.id }}/delete" class="inline">
              <button class="btn btn-ghost btn-xs" type="submit" title="Remove this entry"
                      hx-confirm="Remove the {{ l.went_on }} lunch at {{ l.restaurant }}?">
                <i class="fas fa-trash"></i>
              </button>
            </form>
            {% endif %}
          </td>
        </tr>
        {% endfor %}
      </tbody>
    </table>
  </div>
  {% endif %}
</div>
{% endblock %}