generated from Code-Institute-Org/gitpod-full-template
-
Notifications
You must be signed in to change notification settings - Fork 1
/
categories.html
49 lines (45 loc) · 2.66 KB
/
categories.html
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
46
47
48
49
{% extends "base.html" %}
{% block content %}
<h3 class="center-align blue-grey-text text-lighten-5">Manage Post Categories</h3>
<div class="row">
<div class="col s12 center-align">
<a href="{{ url_for('add_category') }}"
class="max-width waves-effect waves-light cat-btn btn-large blue-grey-text text-lighten-5 grey darken-2 z-depth-3">
Add Category <i class="fas fa-plus-square"></i>
</a>
</div>
</div>
<!-- Self customised code mostly from CI tutorials below -->
<div class="row container cagegory-margin">
{% for category in categories %}
<div class="col s12 m6">
<div class="card center-align blue-grey lighten-5 grey-text text-darken-4">
<div class="card-content">
<span class="card-title">{{ category.category_name }}</span>
</div>
<div class="card-action">
<a href="{{ url_for('edit_category', category_id=category._id) }}"
class="max-width waves-effect waves-light cat-btn btn-large blue-grey-text text-lighten-5 grey darken-2 z-depth-3">
Edit Category <i class="fas fa-paper-plane"></i>
</a>
<!-- Delete button - defensive programming (Ed B_alum - Slack) -->
<!-- Modal Trigger -->
<button data-target="{{ category._id }}" class="max-width modal-trigger cancel-btn waves-effect waves-light btn-large blue-grey-text text-lighten-5 z-depth-3">
Delete <i class="fas fa-times-circle"></i>
</button>
<!-- Modal Structure -->
<div id="{{ category._id }}" class="modal blue-grey lighten-5">
<div class="modal-content">
<h4 class="delete-color center-align">Are you sure you want to DELETE category {{ category.category_name }}?</h4>
</div>
<div class="modal-footer blue-grey lighten-5">
<a href="{{ url_for('get_categories') }}" class="modal-close btn-flat cancel-btn blue-grey-text text-lighten-5">Cancel</a>
<a href="{{ url_for('delete_category', category_id=category._id) }}" class="modal-close btn-flat blue-grey-text text-lighten-5 grey darken-2">Delete</a>
</div>
</div>
</div>
</div>
</div>
{% endfor %}
</div>
{% endblock %}