From 54f53cd2c6556dd230bffbec64d6a0c56c5730c1 Mon Sep 17 00:00:00 2001 From: James Polley Date: Thu, 11 Jan 2018 02:45:43 +1100 Subject: [PATCH] Add a waffle, for flipping and switching --- pinaxcon/settings.py | 4 ++- .../templates/symposion/schedule/_grid.html | 31 ++++++++++--------- requirements.txt | 1 + 3 files changed, 21 insertions(+), 15 deletions(-) diff --git a/pinaxcon/settings.py b/pinaxcon/settings.py index e018c874..73eba29f 100644 --- a/pinaxcon/settings.py +++ b/pinaxcon/settings.py @@ -162,6 +162,7 @@ MIDDLEWARE_CLASSES = [ "django.contrib.messages.middleware.MessageMiddleware", "debug_toolbar.middleware.DebugToolbarMiddleware", "reversion.middleware.RevisionMiddleware", + "waffle.middleware.WaffleMiddleware", "django.middleware.clickjacking.XFrameOptionsMiddleware", "django.contrib.flatpages.middleware.FlatpageFallbackMiddleware", 'pinaxcon.monkey_patch.MonkeyPatchMiddleware', @@ -227,8 +228,9 @@ INSTALLED_APPS = [ "jquery", "djangoformsetjs", - # testing + # testing and rollout "django_nose", + "waffle", ] DEBUG_TOOLBAR_PANELS = [ diff --git a/pinaxcon/templates/symposion/schedule/_grid.html b/pinaxcon/templates/symposion/schedule/_grid.html index ef138b7b..fb8cbfd0 100644 --- a/pinaxcon/templates/symposion/schedule/_grid.html +++ b/pinaxcon/templates/symposion/schedule/_grid.html @@ -1,4 +1,5 @@ {% load lca2018_tags %} +{% load waffle_tags %} @@ -35,20 +36,22 @@ {{ slot.content.speakers|join:", " }} - {% if slot.sessions %} -
- {% for session in slot.sessions.all %} - {% if not session.chair %} -
- Volunteer! 🙋 - {% elif session.chair.user == request.user %} -
- (You are session chair) - {% endif %} - - {% endfor %} -
- {% endif %} + {% flag "session_chair" %} + {% if slot.sessions %} +
+ {% for session in slot.sessions.all %} + {% if not session.chair %} +
+ Volunteer! 🙋 + {% elif session.chair.user == request.user %} +
+ (You are session chair) + {% endif %} + + {% endfor %} +
+ {% endif %} + {% endflag %} {% endif %} {% elif slot.kind.label == "shortbreak" %} {% else %} diff --git a/requirements.txt b/requirements.txt index 921aea38..4f1f9a32 100644 --- a/requirements.txt +++ b/requirements.txt @@ -42,3 +42,4 @@ pinax-stripe==3.2.1 requests>=2.11.1 stripe==1.38.0 +django-waffle>=0.12.0