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