[css-web] Add the FoG files into static.gnome.org
- From: Andrea Veri <av src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [css-web] Add the FoG files into static.gnome.org
- Date: Thu, 28 Nov 2013 18:21:28 +0000 (UTC)
commit 7220d3e3d9d5e04252066036016dbbb921fb5d32
Author: Andrea Veri <av gnome org>
Date: Thu Nov 28 19:21:22 2013 +0100
Add the FoG files into static.gnome.org
friends/README | 10 ++
friends/ruler/Makefile | 29 ++++
friends/ruler/a11y-ruler.js | 26 +++
friends/ruler/lock.png | Bin 0 -> 658 bytes
friends/ruler/ruler-bg.jpg | Bin 0 -> 14403 bytes
friends/ruler/ruler-done-bg.png | Bin 0 -> 3278 bytes
friends/ruler/ruler-privacy-amount.txt | 1 +
friends/ruler/ruler-privacy.js | 53 ++++++
friends/ruler/ruler-privacy.js.template | 53 ++++++
friends/ruler/ruler.js | 1 +
friends/ruler/update-ruler | 265 +++++++++++++++++++++++++++++++
11 files changed, 438 insertions(+), 0 deletions(-)
---
diff --git a/friends/README b/friends/README
new file mode 100644
index 0000000..6f52584
--- /dev/null
+++ b/friends/README
@@ -0,0 +1,10 @@
+Notes for the friends/ruler committers
+------
+
+The following steps should be performed for properly building the ruler.js file:
+
+1. Modify friends/ruler/ruler-privacy-amount.txt to your needs
+2. Modify friends/ruler/ruler-privacy.js.template to your needs
+3. Run make ; ./update-ruler
+4. git commit -a -m 'Enter your commit message here'
+5. git push
diff --git a/friends/ruler/Makefile b/friends/ruler/Makefile
new file mode 100644
index 0000000..24f0b48
--- /dev/null
+++ b/friends/ruler/Makefile
@@ -0,0 +1,29 @@
+SUBDIRS =
+
+urlpath = friends/ruler
+
+page_DATA = \
+ ruler-bg.jpg \
+ ruler-done-bg.png \
+ ruler.js \
+ a11y-ruler.js \
+ ruler-privacy.js \
+ lock.png
+
+# You may adapt this value if the amount of money you want to raise differs
+FOG_GOAL = 20000
+# We expect ruler-privacy-amount.txt to contain the amount of money that has
+# so far been raised.
+ruler-privacy-percent.txt: ruler-privacy-amount.txt
+ awk '{t=$$0/$(FOG_GOAL); printf "%.2f", t*100}' < $< > $@
+ruler-privacy-remain.txt: ruler-privacy-amount.txt
+ awk '{t=$(FOG_GOAL)-$$0; printf "%d", t}' < $< > $@
+
+
+ruler-privacy.js: ruler-privacy.js.template ruler-privacy-amount.txt ruler-privacy-remain.txt
ruler-privacy-percent.txt
+ sed -e "s/{{{FOG_AMOUNT}}}/$$(tr -d '\n' <ruler-privacy-amount.txt)/g" \
+ -e "s/{{{FOG_PERCENT}}}/$$(tr -d '\n' <ruler-privacy-percent.txt)/g" \
+ -e "s/{{{FOG_REMAIN}}}/$$(tr -d '\n' <ruler-privacy-remain.txt)/g" \
+ $< > $@
+
+EXTRA_DIST=$(page_DATA)
diff --git a/friends/ruler/a11y-ruler.js b/friends/ruler/a11y-ruler.js
new file mode 100644
index 0000000..69a067e
--- /dev/null
+++ b/friends/ruler/a11y-ruler.js
@@ -0,0 +1,26 @@
+document.write('<style type=\"text/css\">');
+document.write('body { margin: 0; } #gnome-fog-ruler { background: #57AD06; padding: 16px; color: #fff;
font-family: "Lucida Grande", "DejaVu Sans", "Bitstream Vera Sans", Verdana, sans-serif; font-size: 12px;
z-index: 200; position: relative; margin-bottom: 0px;}');
+document.write('#gnome-fog-ruler * { margin: 0; padding: 0; }');
+document.write('#gnome-fog-ruler .fog-center { width: 960px; margin: 0 auto; text-align: left; }');
+document.write('#gnome-fog-ruler a { color: #fff; }');
+document.write('#gnome-fog-ruler .fog-intro { width: 380px; float: left; margin-right: 12px; }');
+document.write('#gnome-fog-ruler .fog-intro h4 { margin-bottom: 6px; color: #fff; font-size: 13px;
text-shadow: 0 1px 2px #346704; }');
+document.write('#gnome-fog-ruler .fog-ruler { background: #fff; overflow: hidden; -moz-border-radius: 4px;
-webkit-border-radius: 4px; padding: 2px; -moz-box-shadow: 0 1px 2px #346704; -webkit-box-shadow: 0 1px 2px
#346704; }');
+document.write('#gnome-fog-ruler .fog-ruler .fog-bar { display: block; float: left; font-size: 5px; height:
14px; line-height: 12px; }');
+document.write('#gnome-fog-ruler .green { background: #66bb14; }');
+document.write('#gnome-fog-ruler .orange { background: #f57900; }');
+document.write('#gnome-fog-ruler .blue { background: #729fcf; }');
+document.write('#gnome-fog-ruler .yellow { background: #fce94f; }');
+document.write('#gnome-fog-ruler .white { background: #fff; }');
+document.write('#gnome-fog-ruler .green { background: #8ae234; }');
+document.write('#gnome-fog-ruler .fog-description { margin-top: 8px; overflow: hidden; text-align: center;
}');
+document.write('#gnome-fog-ruler .fog-description .fog-item { margin-right: 12px; display: block; float:
left; overflow: hidden; text-align: left; }');
+document.write('#gnome-fog-ruler .fog-description .fog-item .fog-box { display: block; float: left; width:
12px; height: 12px; border: 1px solid #fff; margin: 0 6px 6px 0; -moz-border-radius: 3px;
-webkit-border-radius: 3px; border-radius: 3px; -moz-box-shadow: 0 1px 2px #346704; -webkit-box-shadow: 0 1px
2px #346704; }');
+document.write('#gnome-fog-ruler .fog-description .fog-item .fog-details { font-style: italic; display:
block; margin-left: 20px; }');
+document.write('#gnome-fog-ruler .fog-donate { float: right; margin-top: 11px; }');
+document.write('#gnome-fog-ruler .fog-donate a { display: block; padding: 6px 8px; background: #fff; color:
#333; font-weight: bold; text-decoration: none; font-size: 14px; -moz-box-shadow: 0 1px 2px #346704, inset 0
-3px 10px #ccc; -webkit-box-shadow: 0 1px 2px #346704, inset 0 -3px 10px #ccc; -moz-border-radius: 4px;
-webkit-border-radius: 4px; }');
+document.write('#gnome-fog-ruler .fog-donate a:hover { color: #204a87; text-decoration: underline; }');
+document.write('</style>');
+document.write('<div id=\"gnome-fog-ruler\">Thank you all donors who donated in total $20,000 to our <a
href="http://www.gnome.org/friends">Friends of GNOME program</a>, helping us to make 2012 the year of
accessibility!</div>');
+
+
diff --git a/friends/ruler/lock.png b/friends/ruler/lock.png
new file mode 100644
index 0000000..0ffbb09
Binary files /dev/null and b/friends/ruler/lock.png differ
diff --git a/friends/ruler/ruler-bg.jpg b/friends/ruler/ruler-bg.jpg
new file mode 100644
index 0000000..a7c4a55
Binary files /dev/null and b/friends/ruler/ruler-bg.jpg differ
diff --git a/friends/ruler/ruler-done-bg.png b/friends/ruler/ruler-done-bg.png
new file mode 100644
index 0000000..40ec06e
Binary files /dev/null and b/friends/ruler/ruler-done-bg.png differ
diff --git a/friends/ruler/ruler-privacy-amount.txt b/friends/ruler/ruler-privacy-amount.txt
new file mode 100644
index 0000000..b92677e
--- /dev/null
+++ b/friends/ruler/ruler-privacy-amount.txt
@@ -0,0 +1 @@
+20000
diff --git a/friends/ruler/ruler-privacy.js b/friends/ruler/ruler-privacy.js
new file mode 100644
index 0000000..61af839
--- /dev/null
+++ b/friends/ruler/ruler-privacy.js
@@ -0,0 +1,53 @@
+document.write( '<style type="text/css">' +
+ '#gnome-fog-ruler { background: #237100; padding: 16px 0px 16px 0px; color: #fff;
font-family: "Cantarell", "Lucida Grande", "DejaVu Sans", Verdana, sans-serif; font-size: 12px; z-index: 200;
width: 100%; position: relative; }' +
+ '#gnome-fog-ruler * { margin: 0; padding: 0; }' +
+ '#gnome-fog-ruler .fog-center { width: 960px; margin: 0 auto; text-align: left; }' +
+ '#gnome-fog-ruler a { color: #fff; }' +
+ '#gnome-fog-ruler .fog-left { width: 64px; float: left; margin-right: 10px; }' +
+ '#gnome-fog-ruler .fog-intro { width: 500px; float: left; margin-right: 25px; }' +
+ '#gnome-fog-ruler .fog-intro h4 { margin-bottom: 6px; color: #fff; font-size: 13px;
text-shadow: 0 1px 2px #346704; }' +
+ '#gnome-fog-ruler .fog-ruler { background: #fff; overflow: hidden; -moz-border-radius: 4px;
-webkit-border-radius: 4px; padding: 2px; -moz-box-shadow: 0 1px 2px #346704; -webkit-box-shadow: 0 1px 2px
#346704; }' +
+ '#gnome-fog-ruler .fog-ruler .fog-bar { display: block; float: left; font-size: 5px; height:
14px; line-height: 12px; }' +
+ '#gnome-fog-ruler .green { background: #66bb14; }' +
+ '#gnome-fog-ruler .orange { background: #f57900; }' +
+ '#gnome-fog-ruler .blue { background: #729fcf; }' +
+ '#gnome-fog-ruler .yellow { background: #fce94f; }' +
+ '#gnome-fog-ruler .white { background: #fff; }' +
+ '#gnome-fog-ruler .green { background: #8ae234; }' +
+ '#gnome-fog-ruler .purple { background: #9a32cd; }' +
+ '#gnome-fog-ruler .fog-description { margin-top: 8px; overflow: hidden; text-align: center;
}' +
+ '#gnome-fog-ruler .fog-description .fog-item { margin-right: 12px; display: block; float:
left; overflow: hidden; text-align: left; }' +
+ '#gnome-fog-ruler .fog-description .fog-item .fog-box { display: block; float: left; width:
12px; height: 12px; border: 1px solid #fff; margin: 0 6px 6px 0; -moz-border-radius: 3px;
-webkit-border-radius: 3px; border-radius: 3px; -moz-box-shadow: 0 1px 2px #346704; -webkit-box-shadow: 0 1px
2px #346704; }' +
+ '#gnome-fog-ruler .fog-description .fog-item .fog-details { font-style: italic; display:
block; margin-left: 20px; }' +
+ '#gnome-fog-ruler .fog-donate { float: right; margin-top: 8px; }' +
+ '#gnome-fog-ruler .fog-donate a { display: block; padding: 6px 8px; background: #fff; color:
#333; font-weight: bold; text-decoration: none; font-size: 14px; -moz-box-shadow: 0 1px 2px #346704, inset 0
-3px 10px #ccc; -webkit-box-shadow: 0 1px 2px #346704, inset 0 -3px 10px #ccc; -moz-border-radius: 4px;
-webkit-border-radius: 4px;}' +
+ '#gnome-fog-ruler .fog-donate a:hover { color: #204a87; text-decoration: underline; }' +
+ '</style>' )
+
+document.write( '<div id="gnome-fog-ruler">' +
+ '<div class="fog-center">' +
+ '<div class="fog-left"><img src="http://www-old.gnome.org/friends/ruler/lock.png" /></div>' +
+ '<div class="fog-intro">' +
+ '<h4>Thank you, Friends of GNOME!</h4>' +
+ '<p>Thank you all <a href="https://www.gnome.org/friends/previous-donors/">generous
donors</a> for helping us reach our security and privacy ' +
+ 'campaign goal of $20.000. You can, of course, still continue ' +
+ 'to <a href="https://www.gnome.org/friends/">donate and support</a> our goal of
making GNOME safer than ever.' +
+ '</p>' +
+ '</div><div class="fog-data">' +
+ '<div class="fog-ruler">' +
+ '<span style="width: 100.00%;" class="fog-bar orange"> </span>' +
+ '</div>' +
+ '<div class="fog-donate">' +
+ '<a href="http://www.gnome.org/friends/">Donate now!</a>' +
+ '</div>' +
+ '<div class="fog-description">' +
+ '<div class="fog-item">' +
+ '<span class="fog-box orange"> </span>' +
+ '<strong>Friends of GNOME donations</strong>' +
+ '<span class="fog-details">$20000. $0 to go!</span>' +
+ '</div>' +
+ '</div>' +
+ '</div>' +
+ '<div style="clear: both;"></div>' +
+ '</div>' +
+ '</div>' )
diff --git a/friends/ruler/ruler-privacy.js.template b/friends/ruler/ruler-privacy.js.template
new file mode 100644
index 0000000..d45c6e0
--- /dev/null
+++ b/friends/ruler/ruler-privacy.js.template
@@ -0,0 +1,53 @@
+document.write( '<style type="text/css">' +
+ '#gnome-fog-ruler { background: #237100; padding: 16px 0px 16px 0px; color: #fff;
font-family: "Cantarell", "Lucida Grande", "DejaVu Sans", Verdana, sans-serif; font-size: 12px; z-index: 200;
width: 100%; position: relative; }' +
+ '#gnome-fog-ruler * { margin: 0; padding: 0; }' +
+ '#gnome-fog-ruler .fog-center { width: 960px; margin: 0 auto; text-align: left; }' +
+ '#gnome-fog-ruler a { color: #fff; }' +
+ '#gnome-fog-ruler .fog-left { width: 64px; float: left; margin-right: 10px; }' +
+ '#gnome-fog-ruler .fog-intro { width: 500px; float: left; margin-right: 25px; }' +
+ '#gnome-fog-ruler .fog-intro h4 { margin-bottom: 6px; color: #fff; font-size: 13px;
text-shadow: 0 1px 2px #346704; }' +
+ '#gnome-fog-ruler .fog-ruler { background: #fff; overflow: hidden; -moz-border-radius: 4px;
-webkit-border-radius: 4px; padding: 2px; -moz-box-shadow: 0 1px 2px #346704; -webkit-box-shadow: 0 1px 2px
#346704; }' +
+ '#gnome-fog-ruler .fog-ruler .fog-bar { display: block; float: left; font-size: 5px; height:
14px; line-height: 12px; }' +
+ '#gnome-fog-ruler .green { background: #66bb14; }' +
+ '#gnome-fog-ruler .orange { background: #f57900; }' +
+ '#gnome-fog-ruler .blue { background: #729fcf; }' +
+ '#gnome-fog-ruler .yellow { background: #fce94f; }' +
+ '#gnome-fog-ruler .white { background: #fff; }' +
+ '#gnome-fog-ruler .green { background: #8ae234; }' +
+ '#gnome-fog-ruler .purple { background: #9a32cd; }' +
+ '#gnome-fog-ruler .fog-description { margin-top: 8px; overflow: hidden; text-align: center;
}' +
+ '#gnome-fog-ruler .fog-description .fog-item { margin-right: 12px; display: block; float:
left; overflow: hidden; text-align: left; }' +
+ '#gnome-fog-ruler .fog-description .fog-item .fog-box { display: block; float: left; width:
12px; height: 12px; border: 1px solid #fff; margin: 0 6px 6px 0; -moz-border-radius: 3px;
-webkit-border-radius: 3px; border-radius: 3px; -moz-box-shadow: 0 1px 2px #346704; -webkit-box-shadow: 0 1px
2px #346704; }' +
+ '#gnome-fog-ruler .fog-description .fog-item .fog-details { font-style: italic; display:
block; margin-left: 20px; }' +
+ '#gnome-fog-ruler .fog-donate { float: right; margin-top: 8px; }' +
+ '#gnome-fog-ruler .fog-donate a { display: block; padding: 6px 8px; background: #fff; color:
#333; font-weight: bold; text-decoration: none; font-size: 14px; -moz-box-shadow: 0 1px 2px #346704, inset 0
-3px 10px #ccc; -webkit-box-shadow: 0 1px 2px #346704, inset 0 -3px 10px #ccc; -moz-border-radius: 4px;
-webkit-border-radius: 4px;}' +
+ '#gnome-fog-ruler .fog-donate a:hover { color: #204a87; text-decoration: underline; }' +
+ '</style>' )
+
+document.write( '<div id="gnome-fog-ruler">' +
+ '<div class="fog-center">' +
+ '<div class="fog-left"><img src="http://www-old.gnome.org/friends/ruler/lock.png" /></div>' +
+ '<div class="fog-intro">' +
+ '<h4>Thank you, Friends of GNOME!</h4>' +
+ '<p>Thank you all <a href="https://www.gnome.org/friends/previous-donors/">generous
donors</a> for helping us reach our security and privacy ' +
+ 'campaign goal of $20.000. You can, of course, still continue ' +
+ 'to <a href="https://www.gnome.org/friends/">donate and support</a> our goal of
making GNOME safer than ever.' +
+ '</p>' +
+ '</div><div class="fog-data">' +
+ '<div class="fog-ruler">' +
+ '<span style="width: {{{FOG_PERCENT}}}%;" class="fog-bar
orange"> </span>' +
+ '</div>' +
+ '<div class="fog-donate">' +
+ '<a href="http://www.gnome.org/friends/">Donate now!</a>' +
+ '</div>' +
+ '<div class="fog-description">' +
+ '<div class="fog-item">' +
+ '<span class="fog-box orange"> </span>' +
+ '<strong>Friends of GNOME donations</strong>' +
+ '<span class="fog-details">${{{FOG_AMOUNT}}}. ${{{FOG_REMAIN}}} to
go!</span>' +
+ '</div>' +
+ '</div>' +
+ '</div>' +
+ '<div style="clear: both;"></div>' +
+ '</div>' +
+ '</div>' )
diff --git a/friends/ruler/ruler.js b/friends/ruler/ruler.js
new file mode 100644
index 0000000..93e4862
--- /dev/null
+++ b/friends/ruler/ruler.js
@@ -0,0 +1 @@
+document.write(' <style type="text/css"> #gnome-fog-ruler { background: #237100
url(http://www.gnome.org/friends/ruler/ruler-bg.jpg) center no-repeat; padding: 16px 0px 16px 0px;
color: #fff; font-family: "Lucida Grande", "DejaVu Sans", "Bitstream Vera Sans", Verdana,
sans-serif; font-size: 12px; z-index: 200; float: left; width: 100%;
position: relative; } #gnome-fog-ruler * { margin: 0; padding: 0; }
#gnome-fog-ruler .fog-center { width: 960px; margin: 0 auto; text-align: left; }
#gnome-fog-ruler a { color: #fff; } #gnome-fog-ruler .fog-intro { width: 570px;
float: left; margin-right: 25px; } #gnome-fog-ruler .fog-intro h4 { margin-bottom: 6px;
color: #fff; font-size: 13px; text-shadow: 0 1px 2px #346704; } #gnome-fog-ruler
.fog-ruler { background: #fff; overflow: hidd
en; -moz-border-radius: 4px; -webkit-border-radius: 4px; padding: 2px;
-moz-box-shadow: 0 1px 2px #346704; -webkit-box-shadow: 0 1px 2px #346704; } #gnome-fog-ruler
.fog-ruler .fog-bar { display: block; float: left; font-size: 5px; height: 14px;
line-height: 12px; } #gnome-fog-ruler .green { background: #66bb14; }
#gnome-fog-ruler .orange { background: #f57900; } #gnome-fog-ruler .blue { background:
#729fcf; } #gnome-fog-ruler .yellow { background: #fce94f; } #gnome-fog-ruler .white {
background: #fff; } #gnome-fog-ruler .green { background: #8ae234; } #gnome-fog-ruler
.purple { background: #9a32cd; } #gnome-fog-ruler .fog-description { margin-top: 8px;
overflow: hidden; text-align: center; } #gnome-fog-ruler .fog-description .fog-item {
margin-right: 12px; display
: block; float: left; overflow: hidden; text-align: left; } #gnome-fog-ruler
.fog-description .fog-item .fog-box { display: block; float: left; width: 12px;
height: 12px; border: 1px solid #fff; margin: 0 6px 6px 0; -moz-border-radius: 3px;
-webkit-border-radius: 3px; border-radius: 3px; -moz-box-shadow: 0 1px 2px #346704;
-webkit-box-shadow: 0 1px 2px #346704; } #gnome-fog-ruler .fog-description .fog-item .fog-details {
font-style: italic; display: block; margin-left: 20px; } #gnome-fog-ruler .fog-donate
{ float: right; margin-top: 8px; } #gnome-fog-ruler .fog-donate a { display:
block; padding: 6px 8px; background: #fff; color: #333; font-weight: bold;
text-decoration: none; font-size: 14px; -moz-box-shadow: 0 1px 2px #346704, inset 0 -3px 10px
#ccc; -webki
t-box-shadow: 0 1px 2px #346704, inset 0 -3px 10px #ccc; -moz-border-radius: 4px;
-webkit-border-radius: 4px; } #gnome-fog-ruler .fog-donate a:hover { color: #204a87;
text-decoration: underline; }</style><div id="gnome-fog-ruler"> <div class="fog-center"> <div
class="fog-intro"> <h4>Become a Friend of GNOME!</h4> <p>Help the GNOME Foundation by
donating today. GNOME is looking to grow to 400 new subscribers. Join for only $10 per month and
get a free LWN subscription, t-shirt and more!</p> </div> <div class="fog-data">
<div class="fog-ruler"><span style="width: 20.50%;" class="fog-bar orange"> </span> </div>
<div class="fog-donate"> <a href="http://www.gnome.org/friends/">Donate now!</a>
</div> <div class="fog-description"><div class="fog-item"><span class="fog-box
orange"> </span><strong>Friends of GNOM
E</strong><span class="fog-details">82 subscribers. 318 to go!</span></div> </div> </div>
<div style="clear: both;"></div> </div></div>')
diff --git a/friends/ruler/update-ruler b/friends/ruler/update-ruler
new file mode 100755
index 0000000..f3133fb
--- /dev/null
+++ b/friends/ruler/update-ruler
@@ -0,0 +1,265 @@
+#!/usr/bin/env python
+
+##############################################################
+# Script to update Friends of GNOME ruler. #
+# #
+# Simply update the values below and run this script. A new #
+# ruler.js #will be generated. After careful testing, just #
+# commit/push the new ruler.js file. Something like this: #
+# #
+# update-ruler > ruler.js #
+# #
+##############################################################
+
+import sys
+
+def split_thousands(s):
+ if s.rfind('.') > 0:
+ rhs=s[s.rfind('.')+1:]
+ s=s[:s.rfind('.')-1]
+ if len(s) <= 3: return s + '.' + rhs
+ return split_thousands(s[:-3]) + ',' + s[-3:] + '.' + rhs
+ else:
+ if len(s) <= 3: return s
+ return split_thousands(s[:-3]) + ',' + s[-3:]
+
+TARGET_AMOUNT = 400;
+
+# Colors should have a matching CSS style
+
+DONORS = [
+{ 'name': 'Friends of GNOME',
+ 'color': 'orange',
+ 'donation': 82.0,
+ 'show-still-needed': 1 }
+]
+
+TOTAL_DONATIONS = 0
+
+for donor in DONORS:
+ TOTAL_DONATIONS += donor['donation']
+
+STILL_NEED = TARGET_AMOUNT - TOTAL_DONATIONS
+
+DONE = STILL_NEED <= 0
+
+##############################################################
+# Only change the code from now on if you want to change the #
+# generated CSS and HTML #
+##############################################################
+
+CSS_DONE ='\
+<style type="text/css"> \
+ #gnome-fog-ruler {\
+ background: #237100 url(http://www.gnome.org/friends/ruler/ruler-bg.jpg) center no-repeat;\
+ /*background: #63B412;*/\
+ padding: 0px;\
+ color: #fff;\
+ font-family: "Lucida Grande", "DejaVu Sans", "Bitstream Vera Sans", Verdana, sans-serif;\
+ font-size: 13px;\
+ text-shadow: 0 1px 2px #346704;\
+ z-index: 200;\
+ float: left;\
+ width: 100%;\
+ position: relative;\
+ }\
+ #gnome-fog-ruler .fog-center {\
+ background: url(http://www.gnome.org/friends/ruler/ruler-done-bg.png) no-repeat scroll right bottom;\
+ width: 920px;\
+ margin: 0 auto;\
+ min-height: 40px;\
+ text-align: left;\
+ }\
+ .gnome-fog-ruler-text {\
+ padding-top: 13px;\
+ padding-bottom: 13px;\
+ margin: 0px;\
+ line-height: 20px;\
+ }\
+</style>'
+
+HTML_DONE = '\
+<div id="gnome-fog-ruler">\
+ <div class="fog-center">\
+ <p class="gnome-fog-ruler-text">\
+ Thanks to our <strong>amazing community</strong>,\
+ the GNOME Foundation raised <strong>$57,000</strong> and is\
+ now able<br/>to hire a <b>Sysadmin for GNOME</b>!\
+ </p>\
+ </div>\
+</div>'
+
+if DONE:
+ print 'document.write(\'%s\')' % (CSS_DONE + HTML_DONE)
+ sys.exit()
+
+CSS = ' \
+<style type="text/css"> \
+ #gnome-fog-ruler {\
+ background: #237100 url(http://www.gnome.org/friends/ruler/ruler-bg.jpg) center no-repeat;\
+ padding: 16px 0px 16px 0px;\
+ color: #fff;\
+ font-family: "Lucida Grande", "DejaVu Sans", "Bitstream Vera Sans", Verdana, sans-serif;\
+ font-size: 12px;\
+ z-index: 200;\
+ float: left;\
+ width: 100%;\
+ position: relative;\
+ }\
+ #gnome-fog-ruler * {\
+ margin: 0;\
+ padding: 0;\
+ }\
+ #gnome-fog-ruler .fog-center {\
+ width: 960px;\
+ margin: 0 auto;\
+ text-align: left;\
+ }\
+ #gnome-fog-ruler a {\
+ color: #fff;\
+ }\
+ #gnome-fog-ruler .fog-intro {\
+ width: 570px;\
+ float: left;\
+ margin-right: 25px;\
+ }\
+ #gnome-fog-ruler .fog-intro h4 {\
+ margin-bottom: 6px;\
+ color: #fff;\
+ font-size: 13px;\
+ text-shadow: 0 1px 2px #346704;\
+ }\
+ #gnome-fog-ruler .fog-ruler {\
+ background: #fff;\
+ overflow: hidden;\
+ -moz-border-radius: 4px;\
+ -webkit-border-radius: 4px;\
+ padding: 2px;\
+ -moz-box-shadow: 0 1px 2px #346704;\
+ -webkit-box-shadow: 0 1px 2px #346704;\
+ }\
+ #gnome-fog-ruler .fog-ruler .fog-bar {\
+ display: block;\
+ float: left;\
+ font-size: 5px;\
+ height: 14px;\
+ line-height: 12px;\
+ }\
+ #gnome-fog-ruler .green {\
+ background: #66bb14;\
+ }\
+ #gnome-fog-ruler .orange {\
+ background: #f57900;\
+ }\
+ #gnome-fog-ruler .blue {\
+ background: #729fcf;\
+ }\
+ #gnome-fog-ruler .yellow {\
+ background: #fce94f;\
+ }\
+ #gnome-fog-ruler .white {\
+ background: #fff;\
+ }\
+ #gnome-fog-ruler .green {\
+ background: #8ae234;\
+ }\
+ #gnome-fog-ruler .purple {\
+ background: #9a32cd;\
+ }\
+ #gnome-fog-ruler .fog-description {\
+ margin-top: 8px;\
+ overflow: hidden;\
+ text-align: center;\
+ }\
+ #gnome-fog-ruler .fog-description .fog-item {\
+ margin-right: 12px;\
+ display: block;\
+ float: left;\
+ overflow: hidden;\
+ text-align: left;\
+ }\
+ #gnome-fog-ruler .fog-description .fog-item .fog-box {\
+ display: block;\
+ float: left;\
+ width: 12px;\
+ height: 12px;\
+ border: 1px solid #fff;\
+ margin: 0 6px 6px 0;\
+ -moz-border-radius: 3px;\
+ -webkit-border-radius: 3px;\
+ border-radius: 3px;\
+ -moz-box-shadow: 0 1px 2px #346704;\
+ -webkit-box-shadow: 0 1px 2px #346704;\
+ }\
+ #gnome-fog-ruler .fog-description .fog-item .fog-details {\
+ font-style: italic;\
+ display: block;\
+ margin-left: 20px;\
+ }\
+ #gnome-fog-ruler .fog-donate {\
+ float: right;\
+ margin-top: 8px;\
+ }\
+ #gnome-fog-ruler .fog-donate a {\
+ display: block;\
+ padding: 6px 8px;\
+ background: #fff;\
+ color: #333;\
+ font-weight: bold;\
+ text-decoration: none;\
+ font-size: 14px;\
+ -moz-box-shadow: 0 1px 2px #346704, inset 0 -3px 10px #ccc;\
+ -webkit-box-shadow: 0 1px 2px #346704, inset 0 -3px 10px #ccc;\
+ -moz-border-radius: 4px;\
+ -webkit-border-radius: 4px;\
+ }\
+ #gnome-fog-ruler .fog-donate a:hover {\
+ color: #204a87;\
+ text-decoration: underline;\
+ }\
+</style>'
+
+HTML = '\
+<div id="gnome-fog-ruler">\
+ <div class="fog-center">\
+ <div class="fog-intro">\
+ <h4>Become a Friend of GNOME!</h4>\
+ <p>Help the GNOME Foundation by donating today. GNOME is looking to grow to\
+ 400 new subscribers. Join for only $10 per month and get a free LWN subscription, t-shirt and
more!</p>\
+ </div>\
+ <div class="fog-data">\
+ <div class="fog-ruler">'
+
+for donor in DONORS:
+ percentage = (donor['donation'] / TARGET_AMOUNT) * 100
+ color = donor['color']
+ HTML += '<span style="width: %.2f%%;" class="fog-bar %s"> </span>' % (percentage, color)
+
+HTML += '\
+ </div>\
+ <div class="fog-donate">\
+ <a href="http://www.gnome.org/friends/">Donate now!</a>\
+ </div>\
+ <div class="fog-description">'
+
+for donor in DONORS:
+ donor_name = donor['name']
+ donation_str = "%.0f" % donor['donation']
+ donation = split_thousands(donation_str)
+ color = donor['color']
+
+ if 'show-still-needed' in donor:
+ still_needed_str = "%.0f" % STILL_NEED
+ still_needed = split_thousands(still_needed_str)
+ HTML += '<div class="fog-item"><span class="fog-box %s"> </span><strong>%s</strong><span
class="fog-details">%s subscribers. %s to go!</span></div>' % (color, donor_name, donation, still_needed)
+ else:
+ HTML += '<div class="fog-item"><span class="fog-box %s"> </span><strong>%s</strong><span
class="fog-details">$%s</span></div>' % (color, donor_name, donation)
+
+HTML += '\
+ </div>\
+ </div>\
+ <div style="clear: both;"></div>\
+ </div>\
+</div>'
+
+print 'document.write(\'%s\')' % (CSS + HTML)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]