aboutsummaryrefslogtreecommitdiff
path: root/fietsboek/templates/admin.jinja2
blob: 47c18322ab4c8e98daf6cae814652007ac69161a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
{% extends "layout.jinja2" %}
{% import "util.jinja2" as util with context %}
{% block content %}
<div class="container">
  <h1>{{ _("page.admin.title") }}</h1>

  <h2>{{ _("page.admin.badges") }}</h2>

  <div class="list-group">
    {% for badge in badges %}
    <span href="#" class="list-group-item list-group-item-action d-flex admin-badge-list">
      {{ util.render_badge(badge) }}
      <form method="POST" enctype="multipart/form-data" action="{{ request.route_path('admin-badge-edit') }}">
        <input type="hidden" name="badge-edit-id" value="{{ badge.id }}">
        <div class="mb-3">
          <input type="text" class="form-control" name="badge-title" value="{{ badge.title }}">
        </div>
        <div class="mb-3">
          <input class="form-control" type="file" name="badge-image">
        </div>
        <div class="mb-3">
          <button class="btn btn-primary">{{ _("page.admin.badge.edit") }}</button>
        </div>
      </form>
      <form method="POST" action="{{ request.route_path('admin-badge-delete') }}">
        <input type="hidden" name="badge-delete-id" value="{{ badge.id }}">
        <button class="btn btn-danger"><i class="bi bi-trash"></i> {{ _("page.admin.badge.delete_badge") }}</button>
      </form>
    </span>
    {% endfor %}
  </div>

  <form method="POST" enctype="multipart/form-data" action="{{ request.route_path('admin-badge-add') }}">
    <div class="mb-3">
      <label for="badge-title" class="form-label">{{ _("page.admin.badges.badge_title") }}</label>
      <input type="text" class="form-control" id="badge-title" name="badge-title">
    </div>
    <div class="mb-3">
      <label for="badge-image" class="form-label">{{ _("page.admin.badges.badge_image") }}</label>
      <input class="form-control" type="file" name="badge-image">
    </div>
    <button type="submit" class="btn btn-primary">{{ _("page.admin.badges.add_badge") }}</button>
  </form>
</div>
{% endblock %}