[ckan-changes] commit/ckan: 2 new changesets

Bitbucket commits-noreply at bitbucket.org
Fri Oct 21 16:23:47 UTC 2011


2 new changesets in ckan:

http://bitbucket.org/okfn/ckan/changeset/6fbb10371ecb/
changeset:   6fbb10371ecb
branch:      release-v1.5
user:        zephod
date:        2011-10-20 18:26:23
summary:     [welcome][m]: Added neat top-bar mechanism to welcome new users.
affected #:  4 files (-1 bytes)

--- a/ckan/lib/app_globals.py	Mon Oct 17 17:05:08 2011 +0100
+++ b/ckan/lib/app_globals.py	Thu Oct 20 17:26:23 2011 +0100
@@ -21,6 +21,7 @@
                                   'http://assets.okfn.org/p/ckan/img/ckan.ico')
         self.site_logo = config.get('ckan.site_logo', '')
         self.site_url = config.get('ckan.site_url', '')
+        self.site_url_nice = self.site_url.replace('http://','').replace('www.','')
         self.site_description = config.get('ckan.site_description', '')
         
         self.facets = config.get('search.facets', 'groups tags res_format license').split()


--- a/ckan/public/css/style.css	Mon Oct 17 17:05:08 2011 +0100
+++ b/ckan/public/css/style.css	Thu Oct 20 17:26:23 2011 +0100
@@ -1222,6 +1222,32 @@
   color: #000;
 }
 
+.top-bar {
+  width: 100%;
+  /* Old background was a little less intrusive */
+  background: #fcba63;
+  background: #b22;
+  text-align: center;
+  padding: 0;
+  border-bottom: 1px solid #faa;
+  font-weight: bold;
+}
+.top-bar-text {
+  line-height: 30px;
+  color: #fff;
+}
+.top-bar-text a {
+  color: #fff;
+  text-decoration: underline;
+}
+.top-bar button.js-kill-button {
+  float: right;
+  margin-right: 20px;
+  margin-top: 3px;
+  padding: 2px 8px;
+}
+
+
 /* ============================= */
 /* = Inline resource edit form = */
 /* ============================= */


--- a/ckan/public/scripts/application.js	Mon Oct 17 17:05:08 2011 +0100
+++ b/ckan/public/scripts/application.js	Thu Oct 20 17:26:23 2011 +0100
@@ -18,6 +18,11 @@
       client: client
     };
 
+    var isFrontPage = $('body.index.home').length > 0;
+    if (isFrontPage) {
+      CKAN.Utils.setupTopBar($('.top-bar'));
+    }
+
     var isDatasetView = $('body.package.read').length > 0;
     if (isDatasetView) {
       var _dataset = new CKAN.Model.Dataset(preload_dataset);
@@ -83,8 +88,16 @@
     var messageDiv = $('<div />').html(msg).addClass(category).hide();
     $('.flash-messages').append(messageDiv);
     messageDiv.show(1200);
+  };
 
-  };
+  // Animate the appearance of an element by expanding its height
+  my.animateHeight = function(element, animTime) {
+    if (!animTime) animTime = 350;
+    element.show();
+    var finalHeight = element.height();
+    element.height(0);
+    element.animate({height:finalHeight}, animTime);
+  }
 
   my.bindInputChanges = function(input, callback) {
     input.keyup(callback);
@@ -93,6 +106,25 @@
     input.change(callback);
   };
 
+  my.setupTopBar = function(topBar) {
+
+    var cookieName = 'ckan_killtopbar';
+    var delay = 600;
+    var animTime = 600;
+    var isKilled = ($.cookie(cookieName)!=null);
+    if (isKilled) return;
+
+    // Show the top bar after a short timeout
+    setTimeout("CKAN.Utils.animateHeight($('.top-bar'),"+animTime+")",delay);
+
+    // Bind to the close button
+    topBar.find('.js-kill-button').live('click', function() {
+      console.log('killing top-bar');
+      $.cookie(cookieName, 'true', { expires: 365 });
+      topBar.hide();
+    });
+  };
+
   my.setupUrlEditor = function(slugType,readOnly) {
     // Page elements to hook onto
     var titleInput = $('.js-title');


--- a/ckan/templates/layout_base.html	Mon Oct 17 17:05:08 2011 +0100
+++ b/ckan/templates/layout_base.html	Thu Oct 20 17:26:23 2011 +0100
@@ -46,6 +46,10 @@
 
 <body class="${request.environ.get('pylons.routes_dict', {}).get('action')} 
              ${request.environ.get('pylons.routes_dict', {}).get('controller').split(':')[-1]}">
+   <div class="top-bar" style="display: none;">
+     <span class="top-bar-text">First time at ${g.site_url_nice}? Visit our <a href="${h.url_for(controller='home', action='about')}">About page</a> to find out more.</span>
+     <button class="pretty-button danger js-kill-button">x</button>
+  </div><div id="wrap"><div class="header outer"><header class="container">


http://bitbucket.org/okfn/ckan/changeset/09ee6f1f9de6/
changeset:   09ee6f1f9de6
branch:      release-v1.5
user:        zephod
date:        2011-10-21 18:23:36
summary:     [welcome][xs]: Corrected title.
affected #:  1 file (-1 bytes)

--- a/ckan/templates/layout_base.html	Thu Oct 20 17:26:23 2011 +0100
+++ b/ckan/templates/layout_base.html	Fri Oct 21 17:23:36 2011 +0100
@@ -47,7 +47,7 @@
 <body class="${request.environ.get('pylons.routes_dict', {}).get('action')} 
              ${request.environ.get('pylons.routes_dict', {}).get('controller').split(':')[-1]}"><div class="top-bar" style="display: none;">
-     <span class="top-bar-text">First time at ${g.site_url_nice}? Visit our <a href="${h.url_for(controller='home', action='about')}">About page</a> to find out more.</span>
+     <span class="top-bar-text">First time at ${g.site_title}? Visit our <a href="${h.url_for(controller='home', action='about')}">About page</a> to find out more.</span><button class="pretty-button danger js-kill-button">x</button></div><div id="wrap">

Repository URL: https://bitbucket.org/okfn/ckan/

--

This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.




More information about the ckan-changes mailing list