From 1523c2401fefa2876ee52ba2692950466c92242f Mon Sep 17 00:00:00 2001 From: Ben Kurtovic Date: Wed, 25 Jul 2012 10:39:51 -0400 Subject: [PATCH] Implement 'background' option plus background images. --- pages/settings.mako | 24 +++++++++++++++++++++--- pages/support/footer.mako | 2 +- pages/support/header.mako | 4 ++-- static/images/earwig-button.png | Bin 5259 -> 5229 bytes static/js/potd.js | 2 +- toolserver/settings.py | 7 ++++++- 6 files changed, 31 insertions(+), 8 deletions(-) diff --git a/pages/settings.mako b/pages/settings.mako index 23e33c5..aa6ea8c 100644 --- a/pages/settings.mako +++ b/pages/settings.mako @@ -40,9 +40,27 @@ .org - - Background: - + <% + background_options = [ + ("plain-brown", "Use a plain tiled background (brown version)."), + ("plain-blue", "Use a plain tiled background (blue version)."), + ("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 + %> + % for i, (value, desc) in enumerate(background_options): + + % if i == 0: + Background: + % else: +   + % endif + + ${desc} + + + % endfor diff --git a/pages/support/footer.mako b/pages/support/footer.mako index 5add092..2caa50c 100644 --- a/pages/support/footer.mako +++ b/pages/support/footer.mako @@ -31,4 +31,4 @@ - + \ No newline at end of file diff --git a/pages/support/header.mako b/pages/support/header.mako index cb94f53..1d810cc 100644 --- a/pages/support/header.mako +++ b/pages/support/header.mako @@ -31,8 +31,8 @@ % if "EarwigBackground" in cookies: % if cookies["EarwigBackground"].value == "list": - % elif cookies["EarwigBackground"].value == "plain": - + % elif cookies["EarwigBackground"].value in ["plain-brown", "plain-blue"]: + % else % endif diff --git a/static/images/earwig-button.png b/static/images/earwig-button.png index 6eb786aea576d7da4b40569f3fb02036ec2e08e1..3c5c406247f5ec182b6d2699a4399f22754b1009 100644 GIT binary patch delta 5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