Initials
This commit is contained in:
7
templates/events/event_confirm_delete.html
Normal file
7
templates/events/event_confirm_delete.html
Normal file
@@ -0,0 +1,7 @@
|
||||
{% extends 'base.html' %}
|
||||
{% block content %}
|
||||
<h3>Delete Event</h3>
|
||||
<p>Are you sure you want to delete <strong>{{ object.name }}</strong>?</p>
|
||||
<form method="post">{% csrf_token %}<button class="btn btn-danger">Yes, delete</button>
|
||||
<a class="btn btn-secondary" href="{% url 'events:event_list' %}">Cancel</a></form>
|
||||
{% endblock %}
|
||||
9
templates/events/event_form.html
Normal file
9
templates/events/event_form.html
Normal file
@@ -0,0 +1,9 @@
|
||||
{% extends 'base.html' %}
|
||||
{% block content %}
|
||||
<h3>{% if object %}Edit{% else %}Add{% endif %} Event</h3>
|
||||
<form method="post">{% csrf_token %}
|
||||
{{ form.as_p }}
|
||||
<button class="btn btn-primary">Save</button>
|
||||
<a class="btn btn-secondary" href="{% url 'events:event_list' %}">Cancel</a>
|
||||
</form>
|
||||
{% endblock %}
|
||||
27
templates/events/event_list.html
Normal file
27
templates/events/event_list.html
Normal file
@@ -0,0 +1,27 @@
|
||||
{% extends 'base.html' %}
|
||||
{% block content %}
|
||||
<div class="d-flex justify-content-between mb-3">
|
||||
<h3>Events</h3>
|
||||
<a class="btn btn-success" href="{% url 'events:event_add' %}">Add Event</a>
|
||||
</div>
|
||||
<table class="table table-hover">
|
||||
<thead><tr><th>#</th><th>Name</th><th>Type</th><th>Dates</th><th>Place</th><th>Actions</th></tr></thead>
|
||||
<tbody>
|
||||
{% for e in events %}
|
||||
<tr>
|
||||
<td>{{ forloop.counter }}</td>
|
||||
<td>{{ e.name }}</td>
|
||||
<td>{{ e.event_type }}</td>
|
||||
<td>{{ e.start_date }} - {{ e.end_date }}</td>
|
||||
<td>{{ e.place }}</td>
|
||||
<td>
|
||||
<a class="btn btn-sm btn-primary" href="{% url 'events:event_edit' e.pk %}">Edit</a>
|
||||
<a class="btn btn-sm btn-danger" href="{% url 'events:event_delete' e.pk %}">Delete</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% empty %}
|
||||
<tr><td colspan="6">No events found.</td></tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user