Skip to content

Commit

Permalink
Merge branch '1273-resource-uploads' of github.com:okfn/ckan into 127…
Browse files Browse the repository at this point in the history
…3-resource-uploads
  • Loading branch information
kindly committed Nov 19, 2013
2 parents 57397c2 + 2936692 commit 0912849
Show file tree
Hide file tree
Showing 12 changed files with 114 additions and 20 deletions.
2 changes: 2 additions & 0 deletions CONTRIBUTING.rst
Expand Up @@ -61,13 +61,15 @@ When writing code for CKAN, try to respect our coding standards:
css-coding-standards
javascript-coding-standards
testing-coding-standards
upgrading-dependencies

* `CKAN coding standards <http://docs.ckan.org/en/latest/ckan-coding-standards.html>`_
* `Python coding standards <http://docs.ckan.org/en/latest/python-coding-standards.html>`_
* `HTML coding standards <http://docs.ckan.org/en/latest/html-coding-standards.html>`_
* `CSS coding standards <http://docs.ckan.org/en/latest/css-coding-standards.html>`_
* `JavaScript coding standards <http://docs.ckan.org/en/latest/javascript-coding-standards.html>`_
* `Testing coding standards <http://docs.ckan.org/en/latest/testing-coding-standards.html>`_
* `Upgrading CKAN's dependencies <http://docs.ckan.org/en/latest/upgrading-dependencies.html>`_


---------------
Expand Down
2 changes: 1 addition & 1 deletion bin/travis-install-dependencies
Expand Up @@ -16,7 +16,7 @@ fi
# We need this ppa so we can install postgres-8.4
sudo add-apt-repository -yy ppa:pitti/postgresql
sudo apt-get update -qq
sudo apt-get install solr-jetty postgresql-$PGVERSION
sudo apt-get install postgresql-$PGVERSION solr-jetty libcommons-fileupload-java:amd64=1.2.2-1

sudo service postgresql reload

Expand Down
6 changes: 1 addition & 5 deletions ckan/controllers/user.py
Expand Up @@ -68,7 +68,7 @@ def _setup_template_variables(self, context, data_dict):
try:
user_dict = get_action('user_show')(context, data_dict)
except NotFound:
h.redirect_to(controller='user', action='login', id=None)
abort(404, _('User not found'))
except NotAuthorized:
abort(401, _('Not authorized to see this page'))
c.user_dict = user_dict
Expand Down Expand Up @@ -117,10 +117,6 @@ def read(self, id=None):
'for_view': True}
data_dict = {'id': id,
'user_obj': c.userobj}
try:
check_access('user_show', context, data_dict)
except NotAuthorized:
abort(401, _('Not authorized to see this page'))

context['with_related'] = True

Expand Down
38 changes: 38 additions & 0 deletions ckan/public/base/css/main.css
Expand Up @@ -6126,6 +6126,7 @@ textarea {
}
.js .image-upload .btn-remove-url .icon-remove {
margin-right: 0;
}
.add-member-form .control-label {
width: 100%;
text-align: left;
Expand Down Expand Up @@ -7716,6 +7717,9 @@ h4 small {
-moz-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}
.activity .item.no-avatar p {
margin-left: 40px;
}
.activity .load-less {
margin-bottom: 15px;
}
Expand All @@ -7733,9 +7737,28 @@ h4 small {
float: right;
text-decoration: none;
}
.popover .popover-content {
font-size: 14px;
line-height: 20px;
color: #444444;
word-break: break-all;
}
.popover .popover-content dl {
margin: 0;
}
.popover .popover-content dl dd {
margin-left: 0;
margin-bottom: 10px;
}
.activity .item .icon {
background-color: #999999;
}
.activity .item.failure .icon {
background-color: #b95252;
}
.activity .item.success .icon {
background-color: #69a67a;
}
.activity .item.added-tag .icon {
background-color: #6995a6;
}
Expand Down Expand Up @@ -7986,6 +8009,21 @@ h4 small {
font-size: 16px;
margin: 3px 0;
}
.datapusher-status-link:hover {
text-decoration: none;
}
.datapusher-status.status-unknown {
color: #bbb;
}
.datapusher-status.status-pending {
color: #FFCC00;
}
.datapusher-status.status-error {
color: red;
}
.datapusher-status.status-complete {
color: #009900;
}
body {
background: #005d7a url("../../../base/images/bg.png");
}
Expand Down
Binary file added doc/_static/ckanlogo.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion doc/_themes/sphinx-theme-okfn
6 changes: 3 additions & 3 deletions doc/authorization.rst
@@ -1,6 +1,6 @@
=============
Authorization
=============
===============================
Organizations and authorization
===============================

.. versionchanged:: 2.0
Previous versions of CKAN used a different authorization system.
Expand Down
11 changes: 4 additions & 7 deletions doc/conf.py
Expand Up @@ -81,7 +81,7 @@
master_doc = 'index'

# General information about the project.
project = u'CKAN Documentation'
project = u'CKAN'
project_short_name = u'CKAN'
copyright = u'''&copy; 2009-2013, <a href="http://okfn.org/">Open Knowledge Foundation</a>.
Licensed under <a
Expand Down Expand Up @@ -153,15 +153,12 @@
html_theme_path = ['_themes']
html_theme = 'sphinx-theme-okfn'
html_theme_options = {
'logo_icon': 'http://assets.okfn.org/p/opendatahandbook/img/data-wrench-inverted.png',
'logo_icon': 'ckanlogo.png',
'show_version': True
}

html_sidebars = {
'**': ['relations.html', 'globaltoc.html'],
# There's no point in showing the table of contents in the sidebar on the
# table of contents page! So:
'index': ['relations.html'],
'**': ['globaltoc.html'],
}

# The style sheet to use for HTML and HTML Help pages. A file of that name
Expand All @@ -188,7 +185,7 @@
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
#html_static_path = ['.static']
html_static_path = ['_static']

# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
# using the given strftime format.
Expand Down
2 changes: 1 addition & 1 deletion doc/configuration.rst
Expand Up @@ -1046,7 +1046,7 @@ DataPusher Settings
.. _ckan.datapusher.formats:

ckan.datapusher.formats
^^^^^^^^^^^^^^^^^^
^^^^^^^^^^^^^^^^^^^^^^^

Example::
ckan.datapusher.formats = csv xls xlsx
Expand Down
Binary file removed doc/images/ckan_logo_box.png
Binary file not shown.
3 changes: 1 addition & 2 deletions doc/index.rst
Expand Up @@ -30,9 +30,8 @@ advanced documentation last:
covering CKAN's config file options and the differences between CKAN
releases.

----

.. toctree::
:hidden:
:maxdepth: 2

installing
Expand Down
62 changes: 62 additions & 0 deletions doc/upgrading-dependencies.rst
@@ -0,0 +1,62 @@
--------------------------
Upgrading the dependencies
--------------------------

The Python modules that CKAN depends on are pinned to specific versions, so we
can guarantee that whenever anyone installs CKAN, they'll always get the same
versions of the Python modules in their virtual environment.

Our dependencies are defined in three files:

requirements.in
This file is only used to create a new version of the ``requirements.txt``
file when upgrading the dependencies.
Contains our direct dependencies only (not dependencies of dependencies)
with loosely defined versions. For example, ``apachemiddleware>=0.1.1,<0.2``.

requirements.txt
This is the file that people actually use to install CKAN's dependencies into
their virtualenvs. It contains every dependency, including dependencies of
dependencies, each pinned to a specific version.
For example, ``simplejson==3.3.1``.

dev-requirements.txt
Contains those dependencies only needed by developers, not needed for
production sites. These are pinned to a specific version. For example,
``factory-boy==2.1.1``.

We haven't created a ``dev-requirements.in`` file because we have too few dev
dependencies, we don't update them often, and none of them have a known
incompatible version.

Steps to upgrade
================

These steps will upgrade all of CKAN's dependencies to the latest versions that
work with CKAN:

#. Create a new virtualenv: ``virtualenv --no-site-packages upgrading``

#. Install the requirements with unpinned versions: ``pip install -r
requirements.in``

#. Save the new dependencies versions: ``pip freeze > requirements.txt``. We
have to do this before installing the other dependencies so we get only what
was in ``requirements.in``

#. Install CKAN: ``python setup.py develop``

#. Install the development dependencies: ``pip install -r
dev-requirements.txt``

#. Run the tests to make sure everything still works (see :doc:`test`).

- If not, try to fix the problem. If it's too complicated, pinpoint which
dependency's version broke our tests, find an older version that still
works, and add it to ``requirements.in`` (i.e., if ``python-dateutil``
2.0.0 broke CKAN, you'd add ``python-dateutil>=1.5.0,<2.0.0``). Go back to
step 1.

#. Navigate a bit on CKAN to make sure the tests didn't miss anything. Review
the dependencies changes and their changelogs. If everything seems fine, go
ahead and make a pull request (see :ref:`making a pull request`).

0 comments on commit 0912849

Please sign in to comment.