Skip to content

Commit

Permalink
[master][#1626][templates,doc,tests]: All-new About page.
Browse files Browse the repository at this point in the history
  • Loading branch information
David Read committed Jan 10, 2012
1 parent 65da74c commit 517aec4
Show file tree
Hide file tree
Showing 6 changed files with 69 additions and 46 deletions.
1 change: 1 addition & 0 deletions ckan/lib/app_globals.py
Expand Up @@ -23,6 +23,7 @@ def __init__(self):
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.site_about = config.get('ckan.site_about', '')

self.facets = config.get('search.facets', 'groups tags res_format license').split()

Expand Down
1 change: 0 additions & 1 deletion ckan/public/images/ckan-features.png

This file was deleted.

58 changes: 24 additions & 34 deletions ckan/templates/home/about.html
Expand Up @@ -6,41 +6,31 @@
<py:def function="page_title">About</py:def>

<div py:match="content">
<h2>About CKAN</h2>

<p i18n:msg="">CKAN is the Comprehensive Knowledge Archive Network, a <strong>registry</strong> of <a
href="http://opendefinition.org/">open knowledge</a> datasets and projects
(and a few closed ones).</p>

<p i18n:msg="">CKAN makes it easy to <strong>find, share and reuse open
content and data</strong>, especially in ways that are machine
automatable.
</p>

<p>As a system CKAN functions as a synthesis of several different services:</p>

<img src="${g.site_url}/images/ckan-features.png" alt="CKAN Features Overview" style="margin-left: 4em; margin-bottom: 2em;" />

<p i18n:msg="">As the diagram shows, CKAN combines the features of a listing/registry,
a dataset index and a wiki. As a registry it acts like <a
href="http://www.freshmeat.net/">freshmeat</a> but for open data and
content resources. However it adds to a simple registry in key ways.</p>

<p i18n:msg="">First, thanks to its underlying <a
href="http://www.okfn.org/vdm/">versioned domain model</a> CKAN has a
wiki-like interface that lets anyone add and material held in it. Second,
and unlike a wiki, CKAN can store 'structured' information, which allows it
to provide 'index'-like features such as automated registration, discovery
and installation of material. In this respect it behaves like <a
href="http://www.cpan.org/">CPAN</a> or <a
href="http://pypi.python.org">PyPI</a> in the software world -- though
again for <a href="http://opendefinition.org/">open data and content</a>
not code.</p>
<h2>About ${g.site_title}</h2>

<p i18n:msg="">More about CKAN, and the background to its creation can
be found in <a
href="http://m.okfn.org/files/talks/opentech_20080705/">these
slides</a>.</p>
<py:choose>
<py:when test="not g.site_about">
<p i18n:msg="">What was the <a href="http://thedatahub.org/dataset/house-prices-uk-from-1930">average price</a> of a house in the UK in 1935? When will India's projected population <a href="http://thedatahub.org/dataset/guardian-population-unitednations">overtake</a> that of China? Where can you see <a href="http://thedatahub.org/dataset/seattle-public-art">publicly-funded art</a> in Seattle? Data to answer many, many questions like these is out there on the Internet somewhere - but it is not always easy to find.</p>

<p>${g.site_title} is a community-run catalogue of useful sets of data on the Internet. You can collect links here to data from around the web for yourself and others to use, or search for data that others have collected. Depending on the type of data (and its conditions of use), ${g.site_title} may also be able to store a copy of the data or host it in a database, and provide some basic visualisation tools.</p>
</py:when>
<py:otherwise>
<p>${Markup(g.site_about.replace('${g.site_title}', g.site_title))}</p>
</py:otherwise>
</py:choose>

<h2>How it works</h2>

<p>This site is running a powerful piece of open-source data cataloguing software called <a href="http://ckan.org">CKAN</a>, written and maintained by the <a href="http://okfn.org">Open Knowledge Foundation</a>. Each 'dataset' record on CKAN contains a description of the data and other useful information, such as what formats it is available in, who owns it and whether it is freely available, and what subject areas the data is about. Other users can improve or add to this information (CKAN keeps a fully versioned history).</p>

<p i18n:msg="">CKAN powers a number of data catalogues on the Internet. <a href="http://thedatahub.org">The Data Hub</a> is an openly editable open data catalogue, in the style of Wikipedia. The UK Government uses CKAN to run <a href="http://data.gov.uk/">data.gov.uk</a>, which currently lists 8,000 government datasets. Official public data from most European countries is listed in a CKAN catalogue at <a href="http://publicdata.eu/">publicdata.eu</a>. There is a comprehensive list of catalogues like these around the world at <a href="http://datacatalogs.org/">datacatalogs.org</a>, which is itself powered by CKAN.
</p>

<h2>Open data and the Open Knowledge Foundation</h2>

<p>Most of the data indexed at ${g.site_title} is openly licensed, meaning anyone is free to use or re-use it however they like. Perhaps someone will take that nice dataset of a city's public art that you found, and add it to a tourist map - or even make a neat app for your phone that'll help you find artworks when you visit the city. Open data means more enterprise, collaborative science and transparent government. You can read more about open data in the <a href="http://opendatamanual.org/introduction/index.html" >Open Data Manual</a>.</p>

<p i18n:msg="">The <a href="http://okfn.org">Open Knowledge Foundation</a> is a non-profit organisation <a href="http://okfn.org/about/vision/">promoting</a> open knowledge: writing and improving CKAN is one of the ways we do that. If you want to get involved with its design or code, join the discussion or development <a href="http://ckan.org/contact/">mailing lists</a>, or take a look at the <a href="http://okfn.org">OKFN</a> site to find out about our other projects.</p>

</div>

Expand Down
3 changes: 0 additions & 3 deletions ckan/tests/functional/api/test_action.py
Expand Up @@ -1180,7 +1180,4 @@ def test_4_sort_by_metadata_modified(self):
result_names = [r['name'] for r in result['results']]
assert result_names == ['warandpeace', 'annakarenina'], result_names

<<<<<<< HEAD

=======
>>>>>>> release-v1.5.1c
27 changes: 19 additions & 8 deletions ckan/tests/functional/test_home.py
Expand Up @@ -33,20 +33,12 @@ def test_home_page(self):
assert "Dave's books has 2 datasets" in res, res
assert "Roger's books has 1 datasets" in res, res





@search_related
def test_packages_link(self):
offset = url_for('home')
res = self.app.get(offset)
res.click('Search', index=0)

def test_404(self):
offset = '/some_nonexistent_url'
res = self.app.get(offset, status=404)

def test_template_head_end(self):
offset = url_for('home')
res = self.app.get(offset)
Expand Down Expand Up @@ -240,6 +232,25 @@ def test_update_profile_notice(self):
assert fullname_notice not in response
assert email_and_fullname_notice not in response

class TestHomeControllerWithoutSearch(TestController, PylonsTestCase, HtmlCheckMethods):
@classmethod
def setup_class(cls):
PylonsTestCase.setup_class()

@classmethod
def teardown_class(self):
model.repo.rebuild_db()

def test_404(self):
offset = '/some_nonexistent_url'
res = self.app.get(offset, status=404)

def test_about(self):
offset = url_for(controller='home', action='about')
res = self.app.get(url_for('about'))
assert 'CKAN is a community-run catalogue' in res.body, res.body


class TestDatabaseNotInitialised(TestController):
@classmethod
def setup_class(cls):
Expand Down
25 changes: 25 additions & 0 deletions doc/configuration.rst
Expand Up @@ -70,6 +70,31 @@ This sets the logo used in the title bar.
.. index::
single: package_hide_extras

site_about
^^^^^^^^^^

Example::

ckan.site_about=${g.site_title} is a community-driven catalogue of open data for the Greenfield area.

Default value::

What was the <a href="http://thedatahub.org/dataset/house-prices-uk-from-1930">average price</a> of a house in the UK in 1935? When will India's projected population <a href="http://thedatahub.org/dataset/guardian-population-unitednations">overtake</a> that of China? Where can you see <a href="http://thedatahub.org/dataset/seattle-public-art">publicly-funded art</a> in Seattle? Data to answer many, many questions like these is out there on the Internet somewhere - but it is not always easy to find.</p>
<p i18n:msg="">${g.site_title} is a community-run catalogue of useful sets of data on the Internet. You can collect links here to data from around the web for yourself and others to use, or search for data that others have collected. Depending on the type of data (and its conditions of use), ${g.site_title} may also be able to store a copy of the data or host it in a database, and provide some basic visualisation tools.

This changes the text about the site on the 'About' page. i.e. replaces the text in the "About <site_name" section. The other sections of the About page are not affected.

Format tips:

* multiline strings can be used by indenting following lines

* the format is basically HTML, but with Genshi-format strings

* the about text will be automatically be placed with-in paragraph tags ``<p>...</p>`` but you can start new paragraphs within that by using ``</p><p>``

.. note:: Whilst the default text is translated into many languages (switchable in the page footer), the text in this configuration option will not be translatable.

package_hide_extras
^^^^^^^^^^^^^^^^^^^

Expand Down

0 comments on commit 517aec4

Please sign in to comment.