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

Bitbucket commits-noreply at bitbucket.org
Wed Jun 1 13:10:08 UTC 2011


2 new changesets in ckanextiati:

http://bitbucket.org/okfn/ckanextiati/changeset/3e2cfb2e98ca/
changeset:   3e2cfb2e98ca
branches:    
user:        sebbacon
date:        2011-06-01 13:48:39
summary:     remove help/about (now supplied via wordpresser)
affected #:  3 files (244 bytes)

--- a/ckanext/iati/controllers.py	Thu May 26 20:24:03 2011 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +0,0 @@
-from ckan.lib.base import *
-from ckan.plugins import implements, SingletonPlugin, IRoutes
-
-class IatiRoutesExtension(SingletonPlugin):
-    implements(IRoutes, inherit=True)
-    
-    def before_map(self, map):
-        return map
-    
-    def after_map(self, map):
-        map.connect('/iati', controller='ckanext.iati.controllers:IatiController', 
-                             action='index')
-        map.connect('/help', controller='ckanext.iati.controllers:HelpController', 
-                             action='index')
-        return map
-
-
-class IatiController(BaseController):
-
-    def index(self):
-        return render('iati.html', cache_expire=84600)
-        
-
-class HelpController(BaseController):
-
-    def index(self):
-        return render('help.html', cache_expire=84600)


--- a/setup.py	Thu May 26 20:24:03 2011 +0200
+++ b/setup.py	Wed Jun 01 12:48:39 2011 +0100
@@ -26,7 +26,6 @@
       # -*- Entry points: -*-
       
       [ckan.plugins]
-      iati_routes = ckanext.iati.controllers:IatiRoutesExtension
       iati_preview = ckanext.iati.preview:IatiPackagePreviewExtension
       iati_approval = ckanext.iati.approval:IatiGroupApprovalExtension
       iati_group_authz = ckanext.iati.authz:IatiGroupAuthzExtension


--- a/templates/layout_base.html	Thu May 26 20:24:03 2011 +0200
+++ b/templates/layout_base.html	Wed Jun 01 12:48:39 2011 +0100
@@ -122,8 +122,6 @@
             </li></ul></li>
-        <li>${h.nav_link(c, _('Help'), controller='help', action='index', id=None)}</li>
-        <li>${h.nav_link(c, _('About'), controller='iati', action='index', id=None)}</li></ul></div><!-- .menu --></div><!-- #access -->


http://bitbucket.org/okfn/ckanextiati/changeset/e8b5f4fbfb71/
changeset:   e8b5f4fbfb71
branches:    
user:        sebbacon
date:        2011-06-01 15:07:18
summary:     introduce some sample 'group' extras for client approval
affected #:  5 files (6.6 KB)

--- a/ckanext/iati/forms/group.py	Wed Jun 01 12:48:39 2011 +0100
+++ b/ckanext/iati/forms/group.py	Wed Jun 01 14:07:18 2011 +0100
@@ -9,6 +9,7 @@
 import ckan.forms.common as common
 import ckan.forms.group as group
 from ckan.forms.common import ExtrasField, PackageNameField, SelectExtraField
+from ckan.forms.common import TextExtraField
 from ckan.lib.helpers import literal
 
 __all__ = ['get_group_dict', 'edit_group_dict']
@@ -20,6 +21,23 @@
     PUBLISHER_TYPES = [_("Donor"),
                        _("Recipient"),
                        _("Community")]
+
+    publisher_record_fields = (('publisher_contact',
+                               'Contact',
+                               'Email or URL for publisher'),
+                               ('publisher_description',
+                               'Description',
+                               "General description of Publisher's role and activities"),
+                               ('publisher_agencies',
+                               'Organisations / agencies covered',
+                               'Whose activities does this publisher publish?'),
+                               ('publisher_timeliness',
+                               'Timeliness of Data',
+                               'How up do date is the data when published?'),
+                               ('publisher_frequency',
+                               'Frequency of publication',
+                               'How often is IATI data refreshed?  Monthly/Quarterly?'),
+                               )
     
     builder = FormBuilder(model.Group)
     builder.set_field_text('name', 'Unique Name (required)', 
@@ -28,13 +46,17 @@
     builder.set_field_option('state', 'dropdown', {'options':model.State.all})
     builder.add_field(SelectExtraField('type', options=PUBLISHER_TYPES, allow_empty=False))
     builder.set_field_text('type', 'Type')
-    displayed_fields = ['name', 'title', 'type']
+    for name, title, description in publisher_record_fields:
+        builder.add_field(TextExtraField(name))
+        builder.set_field_text(name, title, description)
+
+    displayed_fields = ['name', 'title', 'type',] + [x[0] for x in publisher_record_fields]
     
     from ckan.authz import Authorizer
     from ckan.lib.base import c
     if Authorizer.is_sysadmin(c.user):
         displayed_fields.append('state')
-    #builder.add_field(ExtrasField('extras', hidden_label=True))
+
     
     if with_packages:
         builder.add_field(group.PackagesField('packages'))


--- a/templates/_util.html	Wed Jun 01 12:48:39 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,136 +0,0 @@
-<html
-  xmlns="http://www.w3.org/1999/xhtml"
-  xmlns:py="http://genshi.edgewall.org/"
-  xmlns:xi="http://www.w3.org/2001/XInclude"
-  py:strip=""
-  >
-
-  <!--! Herein can be found generic helper methods for a whole bunch of common
-        templating issues -->
-
-  <!--! plural(n, s, p): takes a number, a singular form and a plural form,
-        returning the appropriate form on the basis of the number specified -->
-  <py:def function="plural(num, s, p)" py:choose="num">
-    <py:when test="1">${s}</py:when>
-    <py:otherwise>${p}</py:otherwise>
-  </py:def>
-
-  <!--! nonempty(val, default): takes a variable string, and returns it or a
-        fallback 'default' string if it's blank -->
-  <py:def function="nonempty(val, default)" py:choose="val">
-    <py:when test="str(val).strip()">${val}</py:when>
-    <py:otherwise>${default}</py:otherwise>
-  </py:def>
-
-  <!--! List of tags: pass in a collection of tags and this renders the standard
-        tag listing -->
-  <ul py:def="tag_list(tags)" class="tags clearfix">
-    <li py:for="tag in tags">
-      ${h.link_to(tag.name, h.url_for(controller='tag', action='read', id=tag.name))}
-    </li>
-    <p py:if="not tags">No results</p>
-  </ul>
-
-  <!--! List of packages: pass in a collection of tags and this renders the
-        standard package listing -->
-  <ul py:def="package_list(packages)" class="packages">
-    <li py:for="package in packages"
-        class="${'fullyopen' if (package.isopen() and package.resources) else None}">
-        <div class="header">
-			<span class="title">
-				${h.link_to(package.title or package.name, h.url_for(controller='package', action='read', id=package.name))}
-			</span>
-		</div>
-		<div class="extract">
-			${h.markdown_extract(package.notes)}
-		</div>
-		
-		${package_license_icon(package)}
-		<span class="name">
-		 	<b>${package.name}</b>
-		 	
-    		<py:if test="len(package.groups)">
-    		    · published by ${package.groups[0].title}
-    		</py:if>
-    		<py:if test="'country' in package.extras.keys()">
-    		    · ${h.country_name(package.extras.get('country'))}
-    		</py:if>
-    		<py:if test="'record_updated' in package.extras.keys()">
-    		    · updated ${package.extras.get('record_updated')}
-    		</py:if>
-		</span>
-		
-		<py:if test="package.license">
-		    <span class="license">
-		        ·
-			    ${package.license.title.split('::')[-1]}
-		    </span>
-		</py:if>
-        <!--ul py:if="package.tags" class="tags">
-          <li py:for="tag in package.tags">${tag.name}</li>
-        </ul-->
-    </li>
-    <p py:if="not packages">No results</p>
-  </ul>
-
-  <!--! List of groups: pass in a collection of groups and this renders the
-        standard group listing -->
-  <table py:def="group_list(groups)" class="groups">
-    <tr><th>Title</th><th>Number of packages</th><th>Description</th></tr>
-    <py:for each="group in groups">
-    <tr>
-      <td><a href="${h.url_for(controller='group', action='read', id=group.name)}">${group.title}</a></td>
-      <td>${len(group.packages)}</td>
-      <td>${h.truncate(group.description, length=80, whole_word=True)}</td>
-    </tr>
-    </py:for>
-  </table>
-
-  <!--! Package openness icons -->
-  <img py:def="package_license_icon(package)"
-    src="/images/icons/door_${'open' if package.isopen() else 'grey'}.png"
-    title="License: ${package.license.title if hasattr(package.license, 'title') else '?'}"
-    alt="${'OPEN' if package.isopen() else 'CLOSED'}" />
-
-  <py:def function="package_resources_icon(package)" py:choose="">
-    <a py:when="package.resources"
-       href="${h.url_for(controller='package', action='read', id=package.name, anchor='resources')}">
-      <img src="${h.icon_url('arrow_down')}" title="View package resources" alt="DOWNLOAD" />
-    </a>
-
-    <img py:otherwise="" src="${h.icon_url('arrow_down_grey')}" title="No downloadable resources." alt="" />
-  </py:def>
-
-  <!--! Used by group listing -->
-  <py:def function="package_summary(pkg)">
-      <a href="${h.url_for(controller='package', action='read', id=pkg.name)}">
-         ${pkg.name} - ${pkg.title}
-      </a>
-  </py:def>
-
-  <div py:def="package_rating(pkg)" class="rating-group">
-    <py:choose test="">
-      <div py:when="c.num_ratings" class="inline-rating">
-        <ul class="stars default${'%i' % (c.current_rating or 0)}star">
-          <li class="${name}" py:for="number,name in enumerate(['one', 'two', 'three', 'four', 'five'])"></li>
-        </ul>
-        ${'%0.1f (%i rating%s)' % (c.current_rating, c.num_ratings, ('s' if c.num_ratings != 1 else ''))}
-      </div>
-      <py:otherwise>no ratings yet</py:otherwise>
-    </py:choose>
-
-    –
-    rate it now
-
-    <div class="inline-rating">
-    <ul class="stars default0star">
-      <py:for each="number,name in zip(range(1,6), ['one', 'two', 'three', 'four', 'five'])">
-      <li class="${name}">
-      <a href="${h.url_for(controller='package',action='rate',id=c.pkg.name,rating=number)}" title="${number} Star">${number}</a>
-      </li>
-      </py:for>
-    </ul>
-    </div>
-  </div><!--! /rating-group -->
-
-</html>


--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/templates/_util_local.html	Wed Jun 01 14:07:18 2011 +0100
@@ -0,0 +1,136 @@
+<html
+  xmlns="http://www.w3.org/1999/xhtml"
+  xmlns:py="http://genshi.edgewall.org/"
+  xmlns:xi="http://www.w3.org/2001/XInclude"
+  py:strip=""
+  >
+
+  <!--! Herein can be found generic helper methods for a whole bunch of common
+        templating issues -->
+
+  <!--! plural(n, s, p): takes a number, a singular form and a plural form,
+        returning the appropriate form on the basis of the number specified -->
+  <py:def function="plural(num, s, p)" py:choose="num">
+    <py:when test="1">${s}</py:when>
+    <py:otherwise>${p}</py:otherwise>
+  </py:def>
+
+  <!--! nonempty(val, default): takes a variable string, and returns it or a
+        fallback 'default' string if it's blank -->
+  <py:def function="nonempty(val, default)" py:choose="val">
+    <py:when test="str(val).strip()">${val}</py:when>
+    <py:otherwise>${default}</py:otherwise>
+  </py:def>
+
+  <!--! List of tags: pass in a collection of tags and this renders the standard
+        tag listing -->
+  <ul py:def="tag_list(tags)" class="tags clearfix">
+    <li py:for="tag in tags">
+      ${h.link_to(tag.name, h.url_for(controller='tag', action='read', id=tag.name))}
+    </li>
+    <p py:if="not tags">No results</p>
+  </ul>
+
+  <!--! List of packages: pass in a collection of tags and this renders the
+        standard package listing -->
+  <ul py:def="package_list(packages)" class="packages">
+    <li py:for="package in packages"
+        class="${'fullyopen' if (package.isopen() and package.resources) else None}">
+        <div class="header">
+			<span class="title">
+				${h.link_to(package.title or package.name, h.url_for(controller='package', action='read', id=package.name))}
+			</span>
+		</div>
+		<div class="extract">
+			${h.markdown_extract(package.notes)}
+		</div>
+		
+		${package_license_icon(package)}
+		<span class="name">
+		 	<b>${package.name}</b>
+		 	
+    		<py:if test="len(package.groups)">
+    		    · published by ${package.groups[0].title}
+    		</py:if>
+    		<py:if test="'country' in package.extras.keys()">
+    		    · ${h.country_name(package.extras.get('country'))}
+    		</py:if>
+    		<py:if test="'record_updated' in package.extras.keys()">
+    		    · updated ${package.extras.get('record_updated')}
+    		</py:if>
+		</span>
+		
+		<py:if test="package.license">
+		    <span class="license">
+		        ·
+			    ${package.license.title.split('::')[-1]}
+		    </span>
+		</py:if>
+        <!--ul py:if="package.tags" class="tags">
+          <li py:for="tag in package.tags">${tag.name}</li>
+        </ul-->
+    </li>
+    <p py:if="not packages">No results</p>
+  </ul>
+
+  <!--! List of groups: pass in a collection of groups and this renders the
+        standard group listing -->
+  <table py:def="group_list(groups)" class="groups">
+    <tr><th>Title</th><th>Number of packages</th><th>Description</th></tr>
+    <py:for each="group in groups">
+    <tr>
+      <td><a href="${h.url_for(controller='group', action='read', id=group.name)}">${group.title}</a></td>
+      <td>${len(group.packages)}</td>
+      <td>${h.truncate(group.description, length=80, whole_word=True)}</td>
+    </tr>
+    </py:for>
+  </table>
+
+  <!--! Package openness icons -->
+  <img py:def="package_license_icon(package)"
+    src="/images/icons/door_${'open' if package.isopen() else 'grey'}.png"
+    title="License: ${package.license.title if hasattr(package.license, 'title') else '?'}"
+    alt="${'OPEN' if package.isopen() else 'CLOSED'}" />
+
+  <py:def function="package_resources_icon(package)" py:choose="">
+    <a py:when="package.resources"
+       href="${h.url_for(controller='package', action='read', id=package.name, anchor='resources')}">
+      <img src="${h.icon_url('arrow_down')}" title="View package resources" alt="DOWNLOAD" />
+    </a>
+
+    <img py:otherwise="" src="${h.icon_url('arrow_down_grey')}" title="No downloadable resources." alt="" />
+  </py:def>
+
+  <!--! Used by group listing -->
+  <py:def function="package_summary(pkg)">
+      <a href="${h.url_for(controller='package', action='read', id=pkg.name)}">
+         ${pkg.name} - ${pkg.title}
+      </a>
+  </py:def>
+
+  <div py:def="package_rating(pkg)" class="rating-group">
+    <py:choose test="">
+      <div py:when="c.num_ratings" class="inline-rating">
+        <ul class="stars default${'%i' % (c.current_rating or 0)}star">
+          <li class="${name}" py:for="number,name in enumerate(['one', 'two', 'three', 'four', 'five'])"></li>
+        </ul>
+        ${'%0.1f (%i rating%s)' % (c.current_rating, c.num_ratings, ('s' if c.num_ratings != 1 else ''))}
+      </div>
+      <py:otherwise>no ratings yet</py:otherwise>
+    </py:choose>
+
+    –
+    rate it now
+
+    <div class="inline-rating">
+    <ul class="stars default0star">
+      <py:for each="number,name in zip(range(1,6), ['one', 'two', 'three', 'four', 'five'])">
+      <li class="${name}">
+      <a href="${h.url_for(controller='package',action='rate',id=c.pkg.name,rating=number)}" title="${number} Star">${number}</a>
+      </li>
+      </py:for>
+    </ul>
+    </div>
+  </div><!--! /rating-group -->
+
+</html>


--- a/templates/group/layout.html	Wed Jun 01 12:48:39 2011 +0100
+++ b/templates/group/layout.html	Wed Jun 01 14:07:18 2011 +0100
@@ -19,6 +19,23 @@
       </p></div>
+
+    <div class="box">
+      <h2>About this publisher</h2>
+      <p>
+	<dl>
+	  <dt>Contact</dt>
+	  <dd>${c.group.extras.get('publisher_contact', 'n/a')}</dd>
+	  <dt>Description</dt>
+	  <dd>${c.group.extras.get('publisher_description', 'n/a')}</dd>
+	  <dt>Organisations / agencies covered</dt>
+	  <dd>${c.group.extras.get('publisher_agencies', 'n/a')}</dd>
+	  <dt>Timeliness of data</dt>
+	  <dd>${c.group.extras.get('publisher_timeliness', 'n/a')}</dd>
+	</dl>
+      </p>
+      
+    </div></py:match><py:match path="minornavigation" py:if="c.group">


--- a/templates/layout_base.html	Wed Jun 01 12:48:39 2011 +0100
+++ b/templates/layout_base.html	Wed Jun 01 14:07:18 2011 +0100
@@ -7,6 +7,7 @@
   xmlns:xi="http://www.w3.org/2001/XInclude"
   >
 
+<xi:include href="_util_local.html" /><xi:include href="_util.html" /><head>

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

--

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