Skip to content

Commit

Permalink
Merge branch 'master' into smotornyuk-package-blueprint
Browse files Browse the repository at this point in the history
  • Loading branch information
amercader committed Jun 8, 2018
2 parents b788193 + 61a8b19 commit f27179a
Show file tree
Hide file tree
Showing 13 changed files with 56 additions and 130 deletions.
4 changes: 0 additions & 4 deletions ckan/config/routing.py
Expand Up @@ -239,10 +239,6 @@ def make_map():
m.connect('/revision/list', action='list')
m.connect('/revision/{id}', action='read')

with SubMapper(map, controller='ckan.controllers.storage:StorageController') as m:
m.connect('storage_file', '/storage/f/{label:.*}',
action='file')

with SubMapper(map, controller='util') as m:
m.connect('/i18n/strings_{lang}.js', action='i18n_js_strings')
m.connect('/util/redirect', action='redirect')
Expand Down
98 changes: 0 additions & 98 deletions ckan/controllers/storage.py

This file was deleted.

3 changes: 0 additions & 3 deletions ckan/public/base/less/masthead.less
Expand Up @@ -119,9 +119,6 @@
.section {
float: left;
}
input[type="text"] {
border-color: darken(@mastheadBackgroundColor, 5);
}
.navigation {
&.section {
@media (min-width: @screen-sm-min) and (max-width: @screen-sm-max) {
Expand Down
2 changes: 1 addition & 1 deletion ckan/templates-bs2/snippets/license.html
Expand Up @@ -18,7 +18,7 @@
{% block license_wrapper %}
<section class="module module-narrow module-shallow license">
{% block license_title %}
<h2 class="module-heading"><i class="fa fa-medium fa-lock"></i> {{ _('License') }}</h2>
<h2 class="module-heading"><i class="fa fa-lock"></i> {{ _('License') }}</h2>
{% endblock %}
{% block license_content %}
<p class="module-content">
Expand Down
2 changes: 1 addition & 1 deletion ckan/templates/snippets/license.html
Expand Up @@ -18,7 +18,7 @@
{% block license_wrapper %}
<section class="module module-narrow module-shallow license">
{% block license_title %}
<h2 class="module-heading"><i class="fa fa-medium fa-lock"></i> {{ _('License') }}</h2>
<h2 class="module-heading"><i class="fa fa-lock"></i> {{ _('License') }}</h2>
{% endblock %}
{% block license_content %}
<p class="module-content">
Expand Down
1 change: 0 additions & 1 deletion ckan/tests/test_coding_standards.py
Expand Up @@ -260,7 +260,6 @@ def find_unprefixed_string_literals(filename):
u'ckan/controllers/package.py',
u'ckan/controllers/partyline.py',
u'ckan/controllers/revision.py',
u'ckan/controllers/storage.py',
u'ckan/controllers/tag.py',
u'ckan/controllers/user.py',
u'ckan/controllers/util.py',
Expand Down
18 changes: 9 additions & 9 deletions doc/api/index.rst
Expand Up @@ -73,13 +73,13 @@ To call the CKAN API, post a JSON dictionary in an HTTP POST request to one of
CKAN's API URLs. The parameters for the API function should be given in the
JSON dictionary. CKAN will also return its response in a JSON dictionary.

One way to post a JSON dictionary to a URL is using the command-line HTTP
client `HTTPie <http://httpie.org/>`_. For example, to get a list of the names
One way to post a JSON dictionary to a URL is using the command-line
client `Curl <https://curl.haxx.se/>`_. For example, to get a list of the names
of all the datasets in the ``data-explorer`` group on demo.ckan.org, install
HTTPie and then call the ``group_list`` API function by running this command
curl and then call the ``group_list`` API function by running this command
in a terminal::

http http://demo.ckan.org/api/3/action/group_list
curl https://demo.ckan.org/api/3/action/group_list

The response from CKAN will look like this::

Expand Down Expand Up @@ -262,16 +262,16 @@ can be configured with the ``apikey_header_name`` option in your CKAN
configuration file.)

For example, to ask whether or not you're currently following the user
``markw`` on demo.ckan.org using HTTPie, run this command::
``markw`` on demo.ckan.org using curl, run this command::

http http://demo.ckan.org/api/3/action/am_following_user id=markw Authorization:XXX
curl -H "Authorization: XXX" https://demo.ckan.org/api/3/action/am_following_user?id=markw

(Replacing ``XXX`` with your API key.)

Or, to get the list of activities from your user dashboard on demo.ckan.org,
run this Python code::

request = urllib2.Request('http://demo.ckan.org/api/3/action/dashboard_activity_list')
request = urllib2.Request('https://demo.ckan.org/api/3/action/dashboard_activity_list')
request.add_header('Authorization', 'XXX')
response_dict = json.loads(urllib2.urlopen(request, '{}').read())

Expand Down Expand Up @@ -374,9 +374,9 @@ Uploading a new version of a resource file
You can use the ``upload`` parameter of the
:py:func:`~ckan.logic.action.update.resource_update` function to upload a
new version of a resource file. This requires a ``multipart/form-data``
request, with httpie you can do this using the ``@file.csv``::
request, with curl you can do this using the ``@file.csv``::

http --json POST http://demo.ckan.org/api/3/action/resource_update id=<resource id> upload=@updated_file.csv Authorization:<api key>
curl -X POST -H "Content-Type: multipart/form-data" -H "Authorization: XXXX" -F "id=<resource_id>" -F "upload=@updated_file.csv" https://demo.ckan.org/api/3/action/resource_update


.. _api-reference:
Expand Down
36 changes: 33 additions & 3 deletions doc/conf.py
Expand Up @@ -183,10 +183,26 @@ def get_status_of_this_version():
return 'unsupported'


def get_current_release_tag():
''' Return the name of the tag for the current release
e.g.: "ckan-2.7.4"
'''
release_tags_ = get_release_tags()

current_tag = "ckan-{}".format(version)

if release_tags_.__contains__(current_tag):
return current_tag
else:
return 'COULD_NOT_DETECT_TAG_VERSION'


def get_latest_release_tag():
'''Return the name of the git tag for the latest stable release.
e.g.: "ckan-2.1.1"
e.g.: "ckan-2.7.4"
This requires git to be installed.
Expand All @@ -212,6 +228,19 @@ def get_latest_release_version():
return version


def get_current_release_version():
'''Return the version number of the current release.
e.g. "2.1.1"
'''
version = get_current_release_tag()[len('ckan-'):]

# TODO: We could assert here that latest_version matches X.Y.Z.

return version


def get_latest_package_name(distro='trusty'):
'''Return the filename of the Ubuntu package for the latest stable release.
Expand Down Expand Up @@ -266,7 +295,8 @@ def write_substitutions_file(**kwargs):
f.write('.. |{name}| replace:: {substitution}\n'.format(
name=name, substitution=substitution))


current_release_tag = get_current_release_tag()
current_release_version = get_current_release_version()
latest_release_tag_value = get_latest_release_tag()
latest_release_version = get_latest_release_version()
latest_minor_version = latest_release_version[:3]
Expand All @@ -276,7 +306,7 @@ def write_substitutions_file(**kwargs):

write_substitutions_file(
latest_release_tag=latest_release_tag_value,
latest_release_version=get_latest_release_version(),
latest_release_version=latest_release_version,
latest_package_name_precise=get_latest_package_name('precise'),
latest_package_name_trusty=get_latest_package_name('trusty'),
latest_package_name_xenial=get_latest_package_name('xenial'),
Expand Down
2 changes: 1 addition & 1 deletion doc/contributing/documentation.rst
Expand Up @@ -492,7 +492,7 @@ is a nice way to include a list of related links::
:doc:`The DataStore extension <datastore>`
A CKAN extension for storing data.

CKAN's `demo site <http://demo.ckan.org/>`_
CKAN's `demo site <https://demo.ckan.org/>`_
A demo site running the latest CKAN beta version.

Seealso boxes are particularly useful when two pages are related, but don't
Expand Down
8 changes: 5 additions & 3 deletions doc/maintaining/installing/install-from-docker-compose.rst
Expand Up @@ -69,9 +69,11 @@ Clone CKAN into a directory of your choice::
git clone https://github.com/ckan/ckan.git

This will use the latest CKAN master, which may not be stable enough for production use.
To use a stable version, checkout the respective tag, e.g.::
To use a stable version, checkout the respective tag, e.g.:

git checkout tags/ckan-2.6.2
.. parsed-literal::
git checkout tags/|latest_release_tag|
----------------------
2. Build Docker images
Expand Down Expand Up @@ -173,7 +175,7 @@ a. Create and configure datastore database

With running CKAN containers, execute the built-in setup scripts against the ``db`` container::

docker exec -it db psql -U ckan -f 00_create_datastore.sql
docker exec -it db psql -U ckan -f 00_create_datastore.sh
docker exec ckan /usr/local/bin/ckan-paster --plugin=ckan datastore set-permissions -c /etc/ckan/production.ini | docker exec -i db psql -U ckan

The first script will create the datastore database and the datastore readonly user in the ``db``
Expand Down
8 changes: 4 additions & 4 deletions doc/maintaining/linked-data-and-rdf.rst
Expand Up @@ -9,10 +9,10 @@ https://github.com/ckan/ckanext-dcat
These features include the RDF serializations of CKAN datasets based on `DCAT`_, that used to be generated
using templates hosted on the main CKAN repo, eg:

* http://demo.ckan.org/dataset/newcastle-city-council-payments-over-500.xml
* http://demo.ckan.org/dataset/newcastle-city-council-payments-over-500.ttl
* http://demo.ckan.org/dataset/newcastle-city-council-payments-over-500.n3
* http://demo.ckan.org/dataset/newcastle-city-council-payments-over-500.jsonld
* https://demo.ckan.org/dataset/newcastle-city-council-payments-over-500.xml
* https://demo.ckan.org/dataset/newcastle-city-council-payments-over-500.ttl
* https://demo.ckan.org/dataset/newcastle-city-council-payments-over-500.n3
* https://demo.ckan.org/dataset/newcastle-city-council-payments-over-500.jsonld

ckanext-dcat offers many more `features <https://github.com/ckan/ckanext-dcat#overview>`_,
including catalog-wide endpoints and harvesters to import RDF data into CKAN. Please check
Expand Down
2 changes: 1 addition & 1 deletion doc/maintaining/stats.rst
Expand Up @@ -42,4 +42,4 @@ Viewing the Statistics
======================

To view the statistics reported by the stats extension, visit the ``/stats``
page, for example: http://demo.ckan.org/stats
page, for example: https://demo.ckan.org/stats
2 changes: 1 addition & 1 deletion doc/user-guide.rst
Expand Up @@ -140,7 +140,7 @@ Adding a new dataset

You may need to be a member of an organization in order to add and edit
datsets. See the section :ref:`creating_an_organization` below. On
http://demo.ckan.org, you can add a dataset without being in an organization,
https://demo.ckan.org, you can add a dataset without being in an organization,
but dataset features relating to authorization and organizations will not be
available.

Expand Down

0 comments on commit f27179a

Please sign in to comment.