allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From john...@apache.org
Subject [20/40] git commit: [#6777] Fix notification seen count, always display close button, slight HTML structure change
Date Thu, 31 Oct 2013 21:57:31 GMT
[#6777] Fix notification seen count, always display close button, slight HTML structure change

Signed-off-by: Cory Johns <cjohns@slashdotmedia.com>


Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/7c151f26
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/7c151f26
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/7c151f26

Branch: refs/heads/cj/6714
Commit: 7c151f26f526e257492dc55d7010244323808542
Parents: b8aa69b
Author: Cory Johns <cjohns@slashdotmedia.com>
Authored: Mon Oct 21 18:02:36 2013 +0000
Committer: Dave Brondsema <dbrondsema@slashdotmedia.com>
Committed: Fri Oct 25 18:29:21 2013 +0000

----------------------------------------------------------------------
 Allura/allura/lib/plugin.py                     |  2 +-
 Allura/allura/nf/allura/css/site_style.css      | 21 +++++++-------------
 .../templates/jinja_master/theme_macros.html    |  8 +++++---
 Allura/allura/tests/test_plugin.py              |  2 +-
 4 files changed, 14 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/7c151f26/Allura/allura/lib/plugin.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/plugin.py b/Allura/allura/lib/plugin.py
index a2825f2..72dffaf 100644
--- a/Allura/allura/lib/plugin.py
+++ b/Allura/allura/lib/plugin.py
@@ -879,7 +879,7 @@ class ThemeProvider(object):
         seen = asint(request.cookies.get(seen_cookie, '0'))+1
         if closed or note.impressions > 0 and seen > note.impressions:
             return None
-        response.set_cookie(seen_cookie, str(seen+1), max_age=timedelta(days=365))
+        response.set_cookie(seen_cookie, str(seen), max_age=timedelta(days=365))
         return note
 
 class LocalProjectRegistrationProvider(ProjectRegistrationProvider):

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/7c151f26/Allura/allura/nf/allura/css/site_style.css
----------------------------------------------------------------------
diff --git a/Allura/allura/nf/allura/css/site_style.css b/Allura/allura/nf/allura/css/site_style.css
index f91003e..f7353c0 100644
--- a/Allura/allura/nf/allura/css/site_style.css
+++ b/Allura/allura/nf/allura/css/site_style.css
@@ -567,9 +567,12 @@ blockquote {
   margin: 0 auto;
   margin-bottom: 20px;
   *zoom: 1;
-  width: 940px;
-  border-size: 2px;
-  border-style: solid;
+  width: 960px;
+}
+#site-notification .message {
+  float: none;
+  margin: 0;
+  margin-left: -2px;
   -moz-box-shadow: rgba(0, 0, 0, 0.5) 0 4px 10px 0;
   -webkit-box-shadow: rgba(0, 0, 0, 0.5) 0 4px 10px 0;
   -o-box-shadow: rgba(0, 0, 0, 0.5) 0 4px 10px 0;
@@ -586,18 +589,8 @@ blockquote {
   padding: 10px;
 }
 #site-notification .ico-close {
-  float: right;
-  margin-top: -10px;
-  margin-right: -10px;
-  display: none;
-  font-size: 18px;
-  width: 18px;
-  height: 18px;
-  color: #1a1a1a;
-  cursor: pointer;
-}
-#site-notification:hover .ico-close {
   display: block;
+  cursor: pointer;
 }
 
 .hub {

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/7c151f26/Allura/allura/templates/jinja_master/theme_macros.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/jinja_master/theme_macros.html b/Allura/allura/templates/jinja_master/theme_macros.html
index 577a474..68de4f0 100644
--- a/Allura/allura/templates/jinja_master/theme_macros.html
+++ b/Allura/allura/templates/jinja_master/theme_macros.html
@@ -126,9 +126,11 @@
 {%- macro site_notification() %}
     {% set note = g.theme.get_site_notification() %}
     {% if note %}
-        <div id="site-notification" class="info" data-notification-id="{{note._id}}">
-            <b title="Close" class="ico ico-close" data-icon="D"></b>
-            {{note.content|safe}}
+        <div id="site-notification">
+            <section class="message info" data-notification-id="{{note._id}}">
+                <b title="Close" class="ico ico-close" data-icon="D"></b>
+                {{note.content|safe}}
+            </section>
         </div>
     {% endif %}
 {%- endmacro %}

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/7c151f26/Allura/allura/tests/test_plugin.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/test_plugin.py b/Allura/allura/tests/test_plugin.py
index b1b3f3f..9a9a7dd 100644
--- a/Allura/allura/tests/test_plugin.py
+++ b/Allura/allura/tests/test_plugin.py
@@ -103,7 +103,7 @@ class TestThemeProvider(object):
         note.impressions = 2
         request.cookies = {'notification-seen-deadbeef': '1'}
         assert_is(ThemeProvider().get_site_notification(), note)
-        response.set_cookie.assert_called_once_with('notification-seen-deadbeef', '3', max_age=timedelta(days=365))
+        response.set_cookie.assert_called_once_with('notification-seen-deadbeef', '2', max_age=timedelta(days=365))
 
     @patch('allura.model.notification.SiteNotification')
     @patch('pylons.response')


Mime
View raw message