incubator-allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From john...@apache.org
Subject git commit: [#6777] Fix notification seen count, always display close button, slight HTML structure change
Date Mon, 21 Oct 2013 18:04:27 GMT
Updated Branches:
  refs/heads/cj/6777 ad2f7d5c2 -> 16eba6da4


[#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/16eba6da
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/16eba6da
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/16eba6da

Branch: refs/heads/cj/6777
Commit: 16eba6da4f79b59679a302295b175793c170ac91
Parents: ad2f7d5
Author: Cory Johns <cjohns@slashdotmedia.com>
Authored: Mon Oct 21 18:02:36 2013 +0000
Committer: Cory Johns <cjohns@slashdotmedia.com>
Committed: Mon Oct 21 18:02:36 2013 +0000

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


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/16eba6da/Allura/allura/lib/plugin.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/plugin.py b/Allura/allura/lib/plugin.py
index bbf47cc..0a778ee 100644
--- a/Allura/allura/lib/plugin.py
+++ b/Allura/allura/lib/plugin.py
@@ -861,7 +861,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/16eba6da/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..38de7bc 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;
@@ -589,16 +592,13 @@ blockquote {
   float: right;
   margin-top: -10px;
   margin-right: -10px;
-  display: none;
+  display: block;
   font-size: 18px;
   width: 18px;
   height: 18px;
   color: #1a1a1a;
   cursor: pointer;
 }
-#site-notification:hover .ico-close {
-  display: block;
-}
 
 .hub {
   width: 200px;

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/16eba6da/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/16eba6da/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