[ckan-changes] commit/ckan: dread: [backout] Undo 16d65237f985 to 441e615cacc2 inclusive - new features should be in branches off default, not in release branch.

Bitbucket commits-noreply at bitbucket.org
Tue Oct 25 12:25:33 UTC 2011


1 new commit in ckan:


https://bitbucket.org/okfn/ckan/changeset/a552ce0a2ea5/
changeset:   a552ce0a2ea5
branch:      release-v1.5
user:        dread
date:        2011-10-25 14:19:40
summary:     [backout] Undo 16d65237f985 to 441e615cacc2 inclusive - new features should be in branches off default, not in release branch.
affected #:  15 files

diff -r fd99da66237857f9fa6a14d9023dda1b2a39eef4 -r a552ce0a2ea53f35174a8781e17e4871fa6b23c7 ckan/lib/app_globals.py
--- a/ckan/lib/app_globals.py
+++ b/ckan/lib/app_globals.py
@@ -21,7 +21,6 @@
                                   '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()


diff -r fd99da66237857f9fa6a14d9023dda1b2a39eef4 -r a552ce0a2ea53f35174a8781e17e4871fa6b23c7 ckan/lib/dictization/model_dictize.py
--- a/ckan/lib/dictization/model_dictize.py
+++ b/ckan/lib/dictization/model_dictize.py
@@ -186,7 +186,6 @@
     del result_dict['password']
     
     result_dict['display_name'] = user.display_name
-    result_dict['email_hash'] = user.email_hash
     result_dict['number_of_edits'] = user.number_of_edits()
     result_dict['number_administered_packages'] = user.number_administered_packages()
 


diff -r fd99da66237857f9fa6a14d9023dda1b2a39eef4 -r a552ce0a2ea53f35174a8781e17e4871fa6b23c7 ckan/lib/helpers.py
--- a/ckan/lib/helpers.py
+++ b/ckan/lib/helpers.py
@@ -215,12 +215,6 @@
 def icon(name, alt=None):
     return literal('<img src="%s" height="16px" width="16px" alt="%s" /> ' % (icon_url(name), alt))
 
-def gravatar(email_hash, size=100):
-    return literal('''<a href="http://gravatar.com" target="_blank">
-      <img src="http://gravatar.com/avatar/%s?s=%d&d=mm" />
-    </a>''' % (email_hash, size))
-
-
 class Page(paginate.Page):
     
     # Curry the pager method of the webhelpers.paginate.Page class, so we have


diff -r fd99da66237857f9fa6a14d9023dda1b2a39eef4 -r a552ce0a2ea53f35174a8781e17e4871fa6b23c7 ckan/model/user.py
--- a/ckan/model/user.py
+++ b/ckan/model/user.py
@@ -49,14 +49,6 @@
         if self.fullname is not None and len(self.fullname.strip()) > 0:
             return self.fullname
         return self.name
-
-    @property
-    def email_hash(self):
-        import hashlib
-        e = ''
-        if self.email:
-            e = self.email.strip().lower()
-        return hashlib.md5(e).hexdigest()
         
     def get_reference_preferred_for_uri(self):
         '''Returns a reference (e.g. name, id, openid) for this user


diff -r fd99da66237857f9fa6a14d9023dda1b2a39eef4 -r a552ce0a2ea53f35174a8781e17e4871fa6b23c7 ckan/public/css/style.css
--- a/ckan/public/css/style.css
+++ b/ckan/public/css/style.css
@@ -554,14 +554,6 @@
   border-right: 1px solid #ccc; 
 }
 
-.gravatar {
-  border: 1px solid #777;
-  padding: 1px;
-  width: 120px;
-  height: 120px;
-  margin: 0 auto 10px auto;
-}
-
 /* ===================== */
 /* = Stateful stuff    = */
 /* ===================== */
@@ -1230,32 +1222,6 @@
   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 = */
 /* ============================= */


diff -r fd99da66237857f9fa6a14d9023dda1b2a39eef4 -r a552ce0a2ea53f35174a8781e17e4871fa6b23c7 ckan/public/scripts/application.js
--- a/ckan/public/scripts/application.js
+++ b/ckan/public/scripts/application.js
@@ -1,7 +1,5 @@
 (function ($) {
   $(document).ready(function () {
-    CKAN.Utils.isLoggedIn = Boolean($.cookie("ckan_display_name"));
-
     CKAN.Utils.setupUserAutocomplete($('input.autocomplete-user'));
     CKAN.Utils.setupAuthzGroupAutocomplete($('input.autocomplete-authzgroup'));
     CKAN.Utils.setupPackageAutocomplete($('input.autocomplete-dataset'));
@@ -20,27 +18,20 @@
       client: client
     };
 
-    var isFrontPage = $('body.index.home').length > 0;
     var isDatasetView = $('body.package.read').length > 0;
-    var isDatasetNew = $('body.package.new').length > 0;
-    var isGroupNew = $('body.group.new').length > 0;
-
-    // Two main entrance-points to the site:
-    if (!CKAN.Utils.isLoggedIn && (isFrontPage || isDatasetView)) {
-      CKAN.Utils.setupTopBar($('.top-bar'));
-    }
-
     if (isDatasetView) {
       var _dataset = new CKAN.Model.Dataset(preload_dataset);
       CKANEXT.DATAPREVIEW.setupDataPreview(_dataset);
     }
 
+    var isDatasetNew = $('body.package.new').length > 0;
     if (isDatasetNew) {
       // Set up magic URL slug editor
       CKAN.Utils.setupUrlEditor('package');
       $('#save').val(CKAN.Strings.addDataset);
       $("#title").focus();
     }
+    var isGroupNew = $('body.group.new').length > 0;
     if (isGroupNew) {
       // Set up magic URL slug editor
       CKAN.Utils.setupUrlEditor('group');
@@ -92,17 +83,9 @@
     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);
     input.keydown(callback);
@@ -110,24 +93,6 @@
     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() {
-      $.cookie(cookieName, 'true', { expires: 365 });
-      topBar.hide();
-    });
-  };
-
   my.setupUrlEditor = function(slugType,readOnly) {
     // Page elements to hook onto
     var titleInput = $('.js-title');


diff -r fd99da66237857f9fa6a14d9023dda1b2a39eef4 -r a552ce0a2ea53f35174a8781e17e4871fa6b23c7 ckan/templates/layout_base.html
--- a/ckan/templates/layout_base.html
+++ b/ckan/templates/layout_base.html
@@ -46,10 +46,6 @@
 
 <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_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"><div class="header outer"><header class="container">


diff -r fd99da66237857f9fa6a14d9023dda1b2a39eef4 -r a552ce0a2ea53f35174a8781e17e4871fa6b23c7 ckan/templates/package/read.html
--- a/ckan/templates/package/read.html
+++ b/ckan/templates/package/read.html
@@ -18,6 +18,13 @@
   
   <py:match path="primarysidebar">
   
+    <li class="widget-container boxed widget_text" py:if="not c.hide_welcome_message">
+      <h3>First time at ${g.site_title}?</h3>        
+      <p>
+          ${g.site_title} is a catalogue for data. ${h.subnav_link(c, _('Click here to find out more ...'), controller='home', action='about', id=None)}
+      </p>
+    </li>
+
     <li class="widget-container widget_text"><ul class="property-list"><li py:if="c.pkg.url">


diff -r fd99da66237857f9fa6a14d9023dda1b2a39eef4 -r a552ce0a2ea53f35174a8781e17e4871fa6b23c7 ckan/templates/user/layout.html
--- a/ckan/templates/user/layout.html
+++ b/ckan/templates/user/layout.html
@@ -6,26 +6,11 @@
   ><py:match path="minornavigation">
-    <py:if test="c.is_myself">
-      <ul class="tabbed">
-        <li py:attrs="{'class':'current-tab'} if c.action=='read' else {}"><a href="${h.url_for(controller='user', action='read')}">My Profile</a></li>
-        <li py:attrs="{'class':'current-tab'} if c.action=='edit' else {}"><a href="${h.url_for(controller='user', action='edit')}">Edit Profile</a></li>
-        <li><a href="${h.url_for('/user/logout')}">Log out</a></li>
-      </ul>
-    </py:if>
-    <py:if test="not c.is_myself">
-      <py:if test="c.id">
-        <ul class="tabbed">
-          <li py:attrs="{'class':'current-tab'} if c.action=='read' else {}"><a href="${h.url_for(controller='user', action='read')}">View Profile</a></li>
-        </ul>
-      </py:if>
-      <py:if test="not c.id">
-        <ul class="tabbed">
-          <li py:attrs="{'class':'current-tab'} if c.action=='login' else {}"><a href="${h.url_for(controller='user', action='login')}">Login</a></li>
-          <li py:attrs="{'class':'current-tab'} if c.action=='register' else {}"><a href="${h.url_for('register')}">Register Account</a></li>
-        </ul>
-      </py:if>
-    </py:if>
+    <ul class="tabbed" py:if="c.is_myself">
+      <li py:attrs="{'class':'current-tab'} if c.action=='read' else {}"><a href="${h.url_for(controller='user', action='read')}">My Profile</a></li>
+      <li py:attrs="{'class':'current-tab'} if c.action=='edit' else {}"><a href="${h.url_for(controller='user', action='edit')}">Edit Profile</a></li>
+      <li><a href="${h.url_for('/user/logout')}">Log out</a></li>
+    </ul></py:match>
   
 


diff -r fd99da66237857f9fa6a14d9023dda1b2a39eef4 -r a552ce0a2ea53f35174a8781e17e4871fa6b23c7 ckan/templates/user/login.html
--- a/ckan/templates/user/login.html
+++ b/ckan/templates/user/login.html
@@ -34,9 +34,10 @@
         <input type="hidden" name="remember" value="1576800000" /><br/></fieldset>
-      <input name="s" id="s" type="submit" class="pretty-button primary" value="Sign In"/>
-      — 
+      ${h.submit('s', _('Login'))} — 
       <a href="${h.url_for('reset')}">Forgot your password?</a>
+      —
+      ${h.link_to(_('Not yet registered?'), h.url_for(action='register'))}
     </form><br/><!-- Simple OpenID Selector -->
@@ -65,7 +66,7 @@
         </p></div></fieldset>
-      <input id="openid_submit" type="submit" class="pretty-button primary" value="Sign in with OpenID"/>
+      <input id="openid_submit" type="submit" value="Sign in"/></form></div><xi:include href="layout.html" />


diff -r fd99da66237857f9fa6a14d9023dda1b2a39eef4 -r a552ce0a2ea53f35174a8781e17e4871fa6b23c7 ckan/templates/user/logout.html
--- a/ckan/templates/user/logout.html
+++ b/ckan/templates/user/logout.html
@@ -4,10 +4,8 @@
   
   <py:def function="page_title">Logout - User</py:def>
 
-  <py:def function="page_title">Logout</py:def>
-  <py:def function="page_heading">Logout from ${g.site_title}</py:def>
-
   <div py:match="content">
+    <h2>Logout</h2><p>You have logged out successfully.</p></div>
 


diff -r fd99da66237857f9fa6a14d9023dda1b2a39eef4 -r a552ce0a2ea53f35174a8781e17e4871fa6b23c7 ckan/templates/user/new_user_form.html
--- a/ckan/templates/user/new_user_form.html
+++ b/ckan/templates/user/new_user_form.html
@@ -45,5 +45,5 @@
         </dd></dl>
-  <input id="save" name="save" type="submit" class="pretty-button primary" value="Register now »" />
+  <input id="save" name="save" type="submit" value="Register now »" /></form>


diff -r fd99da66237857f9fa6a14d9023dda1b2a39eef4 -r a552ce0a2ea53f35174a8781e17e4871fa6b23c7 ckan/templates/user/read.html
--- a/ckan/templates/user/read.html
+++ b/ckan/templates/user/read.html
@@ -7,9 +7,6 @@
   <py:def function="body_class">user-view</py:def><py:match path="primarysidebar">
-    <div class="gravatar">
-      ${h.gravatar(c.user_dict['email_hash'],120)}
-    </div><li class="widget-container widget_text" py:if="not c.hide_welcome_message"><h3>Activity</h3><ul>


diff -r fd99da66237857f9fa6a14d9023dda1b2a39eef4 -r a552ce0a2ea53f35174a8781e17e4871fa6b23c7 ckan/templates/user/request_reset.html
--- a/ckan/templates/user/request_reset.html
+++ b/ckan/templates/user/request_reset.html
@@ -14,7 +14,7 @@
         <input name="user" value="" /><br/></fieldset><div>
-        <input type="submit" id="reset" name="reset" class="pretty-button primary" value="Reset Password" />
+        ${h.submit('reset', _('Reset password'))}
       </div></form></div>


diff -r fd99da66237857f9fa6a14d9023dda1b2a39eef4 -r a552ce0a2ea53f35174a8781e17e4871fa6b23c7 ckan/tests/lib/test_helpers.py
--- a/ckan/tests/lib/test_helpers.py
+++ b/ckan/tests/lib/test_helpers.py
@@ -50,15 +50,3 @@
         two_months_ago_str = h.datetime_to_date_str(two_months_ago)
         res = h.time_ago_in_words_from_str(two_months_ago_str)
         assert_equal(res, '2 months')
-
-    def test_gravatar(self):
-        email = 'zephod at gmail.com'
-        expected =['<a href="http://gravatar.com" target="_blank">', '<img src="http://gravatar.com/avatar/7856421db6a63efa5b248909c472fbd2?s=200&d=mm" />', '</a>']
-        # Hash the email address
-        import hashlib
-        email_hash = hashlib.md5(email).hexdigest()
-        res = h.gravatar(email_hash, 200)
-        for e in expected:
-            assert e in res, e
-
-

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