[ckan-changes] [okfn/ckan] b7b4a5: [xs, bug] Fixed the non appearance of current relat...

GitHub noreply at github.com
Thu Apr 26 13:23:44 UTC 2012


  Branch: refs/heads/release-v1.7
  Home:   https://github.com/okfn/ckan
  Commit: b7b4a5e697e972b7f44c0b2425c058ca961ff64f
      https://github.com/okfn/ckan/commit/b7b4a5e697e972b7f44c0b2425c058ca961ff64f
  Author: Ross Jones <rossdjones at gmail.com>
  Date:   2012-04-26 (Thu, 26 Apr 2012)

  Changed paths:
    M ckan/controllers/package.py

  Log Message:
  -----------
  [xs,bug] Fixed the non appearance of current related item count on resource pages


diff --git a/ckan/controllers/package.py b/ckan/controllers/package.py
index ba12b86..9e99e0f 100644
--- a/ckan/controllers/package.py
+++ b/ckan/controllers/package.py
@@ -480,6 +480,7 @@ def edit(self, id, data=None, errors=None, error_summary=None):
         c.errors_json = json.dumps(errors)
 
         self._setup_template_variables(context, {'id': id}, package_type=package_type)
+        c.related_count = len(c.pkg.related)
 
         # TODO: This check is to maintain backwards compatibility with the old way of creating
         # custom forms. This behaviour is now deprecated.
@@ -749,6 +750,8 @@ def resource_read(self, id, resource_id):
             c.package['isopen'] = False
         c.datastore_api = h.url_for('datastore_read', id=c.resource.get('id'),
                 qualified=True)
+
+        c.related_count = len(c.pkg.related)
         return render('package/resource_read.html')
 
     def resource_embedded_dataviewer(self, id, resource_id):


================================================================
  Commit: a99df118842cbff468cb08b92b6b5d8b46609f51
      https://github.com/okfn/ckan/commit/a99df118842cbff468cb08b92b6b5d8b46609f51
  Author: Ross Jones <rossdjones at gmail.com>
  Date:   2012-04-26 (Thu, 26 Apr 2012)

  Changed paths:
    A doc/data-viewer.rst
    M doc/index.rst

  Log Message:
  -----------
  Merge branch 'release-v1.7' of https://github.com/okfn/ckan into release-v1.7


diff --git a/doc/data-viewer.rst b/doc/data-viewer.rst
new file mode 100644
index 0000000..64f8817
--- /dev/null
+++ b/doc/data-viewer.rst
@@ -0,0 +1,40 @@
+===========
+Data Viewer
+===========
+
+CKAN's resource page can provide a preview of the resource's data if it is of
+an appropriate format.  If the data is available through the CKAN `DataStore
+<datastore.html>`_ API, or if the data is a ``csv`` or ``xls`` file; then `Recline's
+<http://github.com/okfn/recline>`_ `Data Explorer`_ is used.  If the data is
+another webpage; a google doc; or an image; then it is embedded in an iframe
+for viewing.  Or if the data is text-like, then it's raw contents are
+displayed.
+
+Data Explorer
+=============
+
+The `Recline <http://github.com/okfn/recline>`_
+Data Explorer provides a rich, queryable view of the data.  The data can be filtered,
+faceted, graphed and mapped.  Furthermore, the grid, graph or map can then be
+embedded into your own site using the **Embed** button, and copying the provided
+html snippet into your webpage.
+
+How It Works (Technically)
+==========================
+
+The relevant code for setting up the data viewer is found in ``application.js``.
+
+All resources available through the `DataStore <datastore.html>`_ API are
+available for viewing through the `Data Explorer`_.  using recline's
+``elasticsearch`` backend.  If the datastore is not available, and the filetype
+is normalized to ``csv`` or ``xls``, then a dataproxy is used to attempt to view
+the data (using recline's ``dataproxy`` backend).
+
+Embedding
+---------
+
+If a resource is viewable through the Data Explorer, then it is also embeddable
+in third-party web pages.  ``/dataset/{name}/resource/{resource_id}/embed``
+provides a stripped-down page containing the data explorer.  The data
+explorer's state is passed through using the url's query parameters.
+
diff --git a/doc/index.rst b/doc/index.rst
index 601d4c7..735a64e 100644
--- a/doc/index.rst
+++ b/doc/index.rst
@@ -56,6 +56,7 @@ Publishing Datasets
    authorization
    publisher-profile
    geospatial
+   data-viewer
 
 The CKAN API
 ============


================================================================
Compare: https://github.com/okfn/ckan/compare/70876ee...a99df11


More information about the ckan-changes mailing list