From 37cb1f568ca8aed4e5585838ee0427cc2f1f8ee5 Mon Sep 17 00:00:00 2001 From: Ben Kurtovic Date: Wed, 25 Jul 2012 11:05:22 -0400 Subject: [PATCH] Fix default behavior. --- pages/settings.mako | 2 +- pages/support/header.mako | 15 ++++++--------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/pages/settings.mako b/pages/settings.mako index aa6ea8c..0b9731f 100644 --- a/pages/settings.mako +++ b/pages/settings.mako @@ -47,7 +47,7 @@ ("potd", 'Use the current Wikimedia Commons Picture of the Day, unfiltered. Certain POTDs may be unsuitable as backgrounds due to their aspect ratio or subject matter (generally portraits do not work well).'), ("list", 'Randomly select from a subset of previous Commons Pictures of the Day that work well as widescreen backgrounds, refreshed daily (default).'), ] - selected = cookies["EarwigBackground"].value if "EarwigBackground" in cookies else None + selected = cookies["EarwigBackground"].value if "EarwigBackground" in cookies else "list" %> % for i, (value, desc) in enumerate(background_options): diff --git a/pages/support/header.mako b/pages/support/header.mako index aea0829..0ef05a2 100644 --- a/pages/support/header.mako +++ b/pages/support/header.mako @@ -28,16 +28,13 @@ % endfor - % if "EarwigBackground" in cookies: - % if cookies["EarwigBackground"].value == "list": - - % elif cookies["EarwigBackground"].value in ["plain-brown", "plain-blue"]: - - % else: - - % endif - % else: + <% selected = cookies["EarwigBackground"].value if "EarwigBackground" in cookies else "list" %>\ + % if selected in ["plain-brown", "plain-blue"]: + + % elif selected == "potd": + % else: + % endif