summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsajolida <sajolida@pimienta.org>2018-10-27 10:25:17 +0000
committersajolida <sajolida@pimienta.org>2018-10-27 10:25:17 +0000
commit5a2f827ce0a85d0856e33cf12bf7caa087c6e493 (patch)
tree61171897bc475183683362d03ac610eb42b78389
parentab68fd60221c634c0ab53880c24692f0ebe17c36 (diff)
Add 'Last updated' info on donation counter
-rw-r--r--wiki/src/doc/about/license.mdwn3
-rw-r--r--wiki/src/donate-banner.css27
-rw-r--r--wiki/src/donate-banner.js9
-rw-r--r--wiki/src/lib/info.pngbin0 -> 212 bytes
-rw-r--r--wiki/src/templates/page.tmpl10
5 files changed, 48 insertions, 1 deletions
diff --git a/wiki/src/doc/about/license.mdwn b/wiki/src/doc/about/license.mdwn
index 2a00837..dcee1f1 100644
--- a/wiki/src/doc/about/license.mdwn
+++ b/wiki/src/doc/about/license.mdwn
@@ -75,4 +75,5 @@ Creative Commons Attribution 3.0 United States License.
Creative Commons — Attribution, by Thomas Helbig.
- [[Survey|https://thenounproject.com/term/survey/1296072]]:
Creative Commons — Attribution, by unlimicon.
-
+ - [[Info|https://thenounproject.com/term/info/808461]]:
+ Creative Commons — Attribution, by icongeek]].
diff --git a/wiki/src/donate-banner.css b/wiki/src/donate-banner.css
index 62c75ca..6916920 100644
--- a/wiki/src/donate-banner.css
+++ b/wiki/src/donate-banner.css
@@ -69,6 +69,33 @@ body.pt .donate-pt {
background: black;
}
+/* Hide 'Last updated' by default */
+#counter-last-updated {
+ display: none;
+}
+
+/* Hide 'Last updated' info icon when there is no JS to display 'Last updated' */
+#counter-last-updated-info {
+ display: none;
+}
+
+#counter-last-updated-info {
+ position: absolute;
+ top: -4px;
+ right: 0;
+}
+
+#counter-last-updated {
+ position: absolute;
+ background: white;
+ border: 1px solid #ccc;
+ padding: 0.5em;
+ width: 300px;
+ height: 2.6em;
+ top: 1.5em;
+ left: -50px;
+}
+
/* Hide the number of days remaining when there is no JS to calculate them */
.counter-days {
display: none;
diff --git a/wiki/src/donate-banner.js b/wiki/src/donate-banner.js
index f48d792..698d233 100644
--- a/wiki/src/donate-banner.js
+++ b/wiki/src/donate-banner.js
@@ -15,4 +15,13 @@ document.addEventListener('DOMContentLoaded', function() {
numberOfDays[i].textContent = Math.round((endOfCampaign-now)/24/60/60/1000);
}
+ // Display #counter-last-updated when hover on #counter-last-updated-info
+ document.getElementById('counter-last-updated-info').style.display = "inline-block";
+ document.getElementById('counter-last-updated-info').onmouseover = function() {
+ document.getElementById('counter-last-updated').style.display = "block";
+ }
+ document.getElementById('counter-last-updated-info').onmouseout = function() {
+ document.getElementById('counter-last-updated').style.display = "none";
+ }
+
});
diff --git a/wiki/src/lib/info.png b/wiki/src/lib/info.png
new file mode 100644
index 0000000..3964068
--- /dev/null
+++ b/wiki/src/lib/info.png
Binary files differ
diff --git a/wiki/src/templates/page.tmpl b/wiki/src/templates/page.tmpl
index 3522794..dfb2bf5 100644
--- a/wiki/src/templates/page.tmpl
+++ b/wiki/src/templates/page.tmpl
@@ -112,6 +112,16 @@
<div class="counter-amount donate-fr">XX&#8239;XXX€ sur 120&#8239;000€</div>
<div class="counter-amount donate-it">XX&#8239;XXX€ out of 120&#8239;000€</div>
<div class="counter-amount donate-pt">XX&#8239;XXX€ out of 120&#8239;000€</div>
+ <div id="counter-last-updated-info"><img src="lib/info.png" alt="Info"></div>
+ <div id="counter-last-updated">
+ <span class="donate-en">Last updated on 2018-10-27.</span>
+ <span class="donate-es">Última actualización el 2018-10-27.</span>
+ <span class="donate-de">Last updated on 2018-10-27.</span>
+ <span class="donate-fa">Last updated on 2018-10-27.</span>
+ <span class="donate-fr">Dernière mise à jour le 2018-10-27.</span>
+ <span class="donate-it">Last updated on 2018-10-27.</span>
+ <span class="donate-pt">Last updated on 2018-10-27.</span>
+ </div>
<div class="counter-progress">
<div class="counter-progress-bar" role="progressbar" style="width: 20%" aria-valuenow="20" aria-valuemin="0" aria-valuemax="100"></div>
</div>