From b42d0911c7bec77d8d06a65ed078c6be17c5d8d0 Mon Sep 17 00:00:00 2001 From: Thomas Steen Rasmussen Date: Sun, 29 Jan 2017 10:52:20 +0100 Subject: [PATCH] add call_for_speakers_open() property to camps.Camp model, strikethrough call for speakers button when not open --- camps/models.py | 6 ++++++ program/templates/schedule_base.html | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/camps/models.py b/camps/models.py index e54ad174..adda23fc 100644 --- a/camps/models.py +++ b/camps/models.py @@ -144,4 +144,10 @@ class Camp(CreatedUpdatedModel, UUIDModel): ''' return self.get_days('teardown') + @property + def call_for_speakers_open(self): + if self.camp.upper < timezone.now(): + return False + else: + return True diff --git a/program/templates/schedule_base.html b/program/templates/schedule_base.html index 380f4e71..73bd5a89 100644 --- a/program/templates/schedule_base.html +++ b/program/templates/schedule_base.html @@ -5,9 +5,9 @@