{% extends "economy/base.html" %}
{% load static %}
{% block title %}Kårspexet - Presentkort{% endblock %}
{% block economy_content %}
  <h2>Presentkort</h2>

  <form method="POST" action=".">
    {% csrf_token %}
    <fieldset>
      <legend>Lägg till presentkort</legend>
      {{ form.as_p }}
      <button type="submit">Lägg till!</button>
    </fieldset>
  </form>

  <table>
    <thead>
      <tr>
        <th>Kod</th>
        <th>Summa</th>
        <th>Inlagt den</th>
        <th>Inlagt av</th>
        <th>Utgångsdatum</th>
        <th>Anteckning</th>
      </tr>
    </thead>
    <tbody>
      {% for voucher in vouchers %}
        <tr>
          <td>{{ voucher.code }}</td>
          <td>{{ voucher.amount }}</td>
          <td>{{ voucher.created_at|date }}</td>
          <td>{{ voucher.created_by }}</td>
          <td>{{ voucher.expiry_date }}</td>
          <td>{{ voucher.note }}</td>
        </tr>
      {% endfor %}
    </tbody>
  </table>
{% endblock %}

{% extends "economy/base.html" %}
{% load static %}
{% block title %}Kårspexet - Presentkort{% endblock %}
{% block economy_content %}
  <h2>Presentkort</h2>

  <form method="POST" action=".">
    {% csrf_token %}
    <fieldset>
      <legend>Lägg till presentkort</legend>
      {{ form.as_p }}
      <button type="submit">Lägg till!</button>
    </fieldset>
  </form>

  <table>
    <thead>
      <tr>
        <th>Kod</th>
        <th>Summa</th>
        <th>Inlagt den</th>
        <th>Inlagt av</th>
        <th>Utgångsdatum</th>
        <th>Anteckning</th>
      </tr>
    </thead>
    <tbody>
      {% for voucher in vouchers %}
        <tr>
          {% url "admin:ticket_voucher_change" voucher.pk as admin_url %}
          <td><a href="{{ admin_url }}">{{ voucher.code }}</a></td>
          <td>{{ voucher.amount }}</td>
          <td>{{ voucher.created_at|date }}</td>
          <td>{{ voucher.created_by }}</td>
          <td>{{ voucher.expiry_date }}</td>
          <td>{{ voucher.note }}</td>
        </tr>
      {% endfor %}
    </tbody>
  </table>
{% endblock %}

Add link to voucher in admin
Add link to voucher in admin
