From b70cd3f7c98594dba85c64e98f1dcf390e7804f7 Mon Sep 17 00:00:00 2001
From: Jay Alvarez <jaya@aptivate.org>
Date: Wed, 15 Jul 2015 15:53:03 +0100
Subject: [PATCH] messages box messages hide after 3 seconds

---
 django/website/hid/static/hid/js/messages.js | 10 ++++++++++
 django/website/media/css/styles.css          | 15 +++++++++++----
 django/website/media/less/view-edit.less     |  4 ++++
 django/website/templates/base.html           |  1 +
 4 files changed, 26 insertions(+), 4 deletions(-)
 create mode 100644 django/website/hid/static/hid/js/messages.js

diff --git a/django/website/hid/static/hid/js/messages.js b/django/website/hid/static/hid/js/messages.js
new file mode 100644
index 00000000..19a97269
--- /dev/null
+++ b/django/website/hid/static/hid/js/messages.js
@@ -0,0 +1,10 @@
+/**
+ * Hide messages box after 3 seconds automatically
+ */
+
+jQuery(window).load(function(){
+  setTimeout(function(){ 
+      jQuery('.messages-box > ul').fadeOut();
+      }, 3000);
+});
+
diff --git a/django/website/media/css/styles.css b/django/website/media/css/styles.css
index 74686d29..6d1f7fe8 100644
--- a/django/website/media/css/styles.css
+++ b/django/website/media/css/styles.css
@@ -7029,6 +7029,9 @@ th.delete > label {
 .view-items-form .pagination li {
   padding: 10px;
 }
+.messages-box {
+  margin: 0;
+}
 .messages-box > ul {
   margin-top: 40px;
   color: #fff;
@@ -7051,12 +7054,16 @@ th.delete > label {
 .spinner {
   display: none;
   height: 50px;
-  margin: 40px auto 0;
-  width: 120px;
+  margin: 20px auto 0;
+  position: absolute;
+  text-align: center;
+  bottom: 20px;
+  width: 100%;
 }
 .spinner > span {
-  display: block;
-  float: left;
+  display: inline-block;
+  position: relative;
+  top: -20px;
 }
 .spinner > div {
   height: 100%;
diff --git a/django/website/media/less/view-edit.less b/django/website/media/less/view-edit.less
index b511a0e3..5e43a0d4 100644
--- a/django/website/media/less/view-edit.less
+++ b/django/website/media/less/view-edit.less
@@ -52,6 +52,10 @@ th.delete > label {
     }
 }
 
+.messages-box {
+  margin:0;
+}
+
 .messages-box > ul {
   margin-top:40px;
   color:#fff;
diff --git a/django/website/templates/base.html b/django/website/templates/base.html
index 21cf0fc8..0f442da3 100644
--- a/django/website/templates/base.html
+++ b/django/website/templates/base.html
@@ -40,6 +40,7 @@
         <script src="{{ STATIC_URL }}js/underscore.js"></script>
         <script src="{{ STATIC_URL }}js/backbone.js"></script>
         <script src="{{ STATIC_URL }}hid/js/spinner.js"></script>
+        <script src="{{ STATIC_URL }}hid/js/messages.js"></script>
     {% endblock %}
     {% block lastjs %}
     {% endblock %}
-- 
GitLab