From c6f2e0b5317d84d2c8a0e04c51ccbcb4ed49dc21 Mon Sep 17 00:00:00 2001 From: Andromeda Yelton Date: Sun, 15 Jan 2012 14:56:26 -0500 Subject: [PATCH] one more thing to display for preview only --- context_processors.py | 3 +++ frontend/templates/base.html | 2 ++ frontend/templates/campaign_list.html | 2 +- settings/common.py | 5 +++++ settings/dev.py | 3 +++ 5 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 context_processors.py diff --git a/context_processors.py b/context_processors.py new file mode 100644 index 00000000..5cf0e75b --- /dev/null +++ b/context_processors.py @@ -0,0 +1,3 @@ +def is_preview(request): + from django.conf import settings + return {'is_preview': settings.IS_PREVIEW} \ No newline at end of file diff --git a/frontend/templates/base.html b/frontend/templates/base.html index 996b9475..0b2e93a6 100644 --- a/frontend/templates/base.html +++ b/frontend/templates/base.html @@ -69,9 +69,11 @@ +{% if is_preview == 1 %}
Welcome to the alpha version of Unglue.It. This site is a preview of our full functionality; some things (including pledging) aren't quite working yet. If something seems broken or confusing -- or if you find something you love! -- please give us feedback. Thank you for your interest, and have fun.
+{% endif %} {% block topsection %}{% endblock %} {% block content %}{% endblock %} diff --git a/frontend/templates/campaign_list.html b/frontend/templates/campaign_list.html index ac013e6e..9aecf139 100644 --- a/frontend/templates/campaign_list.html +++ b/frontend/templates/campaign_list.html @@ -75,7 +75,7 @@
- {% if request.META.HTTP_HOST == "unglue.it" %} + {% if is_preview == 1 %}
We're not running campaigns during our alpha phase.

After we've implemented a few more features and improved the site based on your feedback, you'll see a list of active campaigns here.

diff --git a/settings/common.py b/settings/common.py index 11105e37..86aed17f 100644 --- a/settings/common.py +++ b/settings/common.py @@ -72,6 +72,7 @@ TEMPLATE_CONTEXT_PROCESSORS = ( 'django.core.context_processors.static', 'django.contrib.messages.context_processors.messages', 'django.core.context_processors.request', + 'regluit.context_processors.is_preview', ) MIDDLEWARE_CLASSES = ( @@ -206,3 +207,7 @@ UNGLUEIT_RECOMMENDED_USERNAME = 'recommended' TEST_RUNNER = "djcelery.contrib.test_runner.CeleryTestSuiteRunner" import djcelery djcelery.setup_loader() + +# this suppresses functionality that should not be visible on the alpha site +# change to 0 if you want to see it on your local machine +IS_PREVIEW = 1 \ No newline at end of file diff --git a/settings/dev.py b/settings/dev.py index 4eaf98e9..2b2e3794 100644 --- a/settings/dev.py +++ b/settings/dev.py @@ -3,6 +3,9 @@ from regluit.settings.common import * DEBUG = True TEMPLATE_DEBUG = DEBUG +# if you're doing development work, you'll want this to be zero +IS_PREVIEW = 0 + ADMINS = ( ('Ed Summers', 'ehs@pobox.com'), )