From 0d43d74c6085d66b0c0f2de1100b4eaf42b4b24e Mon Sep 17 00:00:00 2001 From: Yohann D'ANELLO Date: Fri, 27 Mar 2020 19:47:43 +0100 Subject: [PATCH] Display activity details --- apps/activity/views.py | 1 + templates/activity/activity_detail.html | 50 +++++++++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 templates/activity/activity_detail.html diff --git a/apps/activity/views.py b/apps/activity/views.py index 10e073f0..952ea59c 100644 --- a/apps/activity/views.py +++ b/apps/activity/views.py @@ -32,6 +32,7 @@ class ActivityListView(LoginRequiredMixin, SingleTableView): class ActivityDetailView(LoginRequiredMixin, DetailView): model = Activity + context_object_name = "activity" class ActivityUpdateView(LoginRequiredMixin, UpdateView): diff --git a/templates/activity/activity_detail.html b/templates/activity/activity_detail.html new file mode 100644 index 00000000..bd946643 --- /dev/null +++ b/templates/activity/activity_detail.html @@ -0,0 +1,50 @@ +{% extends "base.html" %} +{% load static %} +{% load i18n %} +{% load render_table from django_tables2 %} +{% load pretty_money %} + +{% block content %} + +
+
+

{{ activity.name }}

+
+
+
+
{% trans 'description'|capfirst %}
+
{{ activity.description }}
+ +
{% trans 'type'|capfirst %}
+
{{ activity.activity_type }}
+ +
{% trans 'start date'|capfirst %}
+
{{ activity.date_start }}
+ +
{% trans 'end date'|capfirst %}
+
{{ activity.date_end }}
+ +
{% trans 'organizer'|capfirst %}
+
{{ activity.organizer }}
+ +
{% trans 'attendees club'|capfirst %}
+
{{ activity.attendees_club }}
+ +
{% trans 'can invite'|capfirst %}
+
{{ activity.activity_type.can_invite|yesno }}
+ + {% if activity.activity_type.can_invite %} +
{% trans 'guest entry fee'|capfirst %}
+
{{ activity.activity_type.guest_entry_fee|pretty_money }}
+ {% endif %} +
+
+ + +
+ +{% endblock %}