[Scummvm-git-logs] scummvm-web master -> c069a927da8259f7e220aa9856d05b2e15f470a5

Mataniko mataniko at gmail.com
Tue Jul 31 00:50:15 CEST 2018


This automated email contains information about 2 new commits which have been
pushed to the 'scummvm-web' repo located at https://github.com/scummvm/scummvm-web .

Summary:
d7612d66e3 TEMPLATES: Fix screenshot random number lookup, which would sometimes return an out of bounds index
c069a927da BUILD: Building the site takes longer than it used to, let people know to wait


Commit: d7612d66e31c03935f9863cc8dfa967eb899dbd7
    https://github.com/scummvm/scummvm-web/commit/d7612d66e31c03935f9863cc8dfa967eb899dbd7
Author: Matan Bareket (mataniko at gmail.com)
Date: 2018-07-30T18:47:34-04:00

Commit Message:
TEMPLATES: Fix screenshot random number lookup, which would sometimes return an out of bounds index

Changed paths:
  A templates/components/cookie.tpl
    templates/components/intro_header.tpl
    templates/pages/screenshots.tpl


diff --git a/templates/components/cookie.tpl b/templates/components/cookie.tpl
new file mode 100644
index 0000000..e7f69fe
--- /dev/null
+++ b/templates/components/cookie.tpl
@@ -0,0 +1,15 @@
+<div class="cookie-consent">
+   <div class="text">This website uses third-party cookies to collect traffic information. By continuing to use the site you are providing consent to do so.</div>
+   <div class="buttons"><a onclick="cookie_consent(false)">Decline</a><a class="accept" onclick="cookie_consent(true)">Got it!</a></div>   
+</div>
+
+<script>
+	if (window.localStorage.getItem('COOKIE_CONSENT')) {
+			document.querySelector('.cookie-consent').hidden = true;
+		}
+
+	function cookie_consent(allowCookies) {
+		window.localStorage.setItem('COOKIE_CONSENT', allowCookies)
+		document.querySelector('.cookie-consent').hidden = true;
+	}
+</script>
diff --git a/templates/components/intro_header.tpl b/templates/components/intro_header.tpl
index e1c331d..0c32188 100644
--- a/templates/components/intro_header.tpl
+++ b/templates/components/intro_header.tpl
@@ -1,7 +1,7 @@
 {* Random screenshot. *}
 {assign var='rand_files' value=$random_shot.screenshot->getFiles()}
 {assign var='rand_max' value=$rand_files|@count}
-{assign var='rand_pos' value=0|rand:$rand_max-1}
+{assign var='rand_pos' value=0|rand:($rand_max-1)}
 {assign var='rand_file' value=$rand_files[$rand_pos]}
 
 {* Introduction header, included from index.tpl *}
diff --git a/templates/pages/screenshots.tpl b/templates/pages/screenshots.tpl
index ffa1f73..7277e26 100644
--- a/templates/pages/screenshots.tpl
+++ b/templates/pages/screenshots.tpl
@@ -1,7 +1,7 @@
 {* Random screenshot. *}
 {assign var='rand_files' value=$random_shot.screenshot->getFiles()}
 {assign var='rand_max' value=$rand_files|@count}
-{assign var='rand_pos' value=0|rand:$rand_max-1}
+{assign var='rand_pos' value=0|rand:($rand_max-1)}
 {assign var='rand_file' value=$rand_files[$rand_pos]}
 
 {* List the available categories. *}


Commit: c069a927da8259f7e220aa9856d05b2e15f470a5
    https://github.com/scummvm/scummvm-web/commit/c069a927da8259f7e220aa9856d05b2e15f470a5
Author: Matan Bareket (mataniko at gmail.com)
Date: 2018-07-30T18:50:04-04:00

Commit Message:
BUILD: Building the site takes longer than it used to, let people know to wait

Changed paths:
    site-update/install.sh


diff --git a/site-update/install.sh b/site-update/install.sh
index 01178c2..afcc1b0 100644
--- a/site-update/install.sh
+++ b/site-update/install.sh
@@ -1,5 +1,9 @@
 #!/bin/bash
 
+# echo empty line because the buffer starts with a tab for some reason
+echo ''
+echo 'Updating website - please wait until the page finishes loading'
+
 # Go to the root folder
 cd ..
 





More information about the Scummvm-git-logs mailing list