Skip to content

Commit

Permalink
Merge branch 'master' into clean-models
Browse files Browse the repository at this point in the history
Conflicts:
	ckan/model/__init__.py
  • Loading branch information
tobes committed May 10, 2012
2 parents 1565758 + b9ee2fa commit e445eb7
Show file tree
Hide file tree
Showing 41 changed files with 805 additions and 69 deletions.
1 change: 0 additions & 1 deletion .gitattributes
@@ -1,3 +1,2 @@
*.po -diff
*.mo -diff
*.pot -diff
2 changes: 1 addition & 1 deletion .tx/config
@@ -1,7 +1,7 @@
[main]
host = http://www.transifex.net

[ckan.1-6]
[ckan.1-7]
file_filter = ckan/i18n/<lang>/LC_MESSAGES/ckan.po
source_file = ckan/i18n/ckan.pot
source_lang = en
Expand Down
61 changes: 50 additions & 11 deletions CHANGELOG.txt
@@ -1,6 +1,45 @@
CKAN CHANGELOG
++++++++++++++

v1.7 2012-05-09
===============

Major:
* Updated SOLR schema (#2327). Note: This will require and update of the SOLR schema file and a reindex.
* Support for Organization based workflow, with membership determinig access permissions to datasets (#1669,#2255)
* Related items such as visualizations, applications or ideas can now be added to datasets (#2204)
* Restricted vocabularies for tags, allowing grouping related tags together (#1698)
* Internal analytics that track number of views and downloads for datasets and resources (#2251)
* Consolidated multilingual features in an included extension (#1821,#1820)
* Atom feeds for publishers, tags and search results (#1593,#2277)
* RDF dump paster command (#2303)
* Better integration with the DataStore, based on ElasticSearch, with nice helper docs (#1797)
* Updated the Recline data viewer with new features such as better graphs and a map view (#2236,#2283)
* Improved and redesigned documentation (#2226,#2245,#2248)

Minor:
* Groups can have an image associated (#2275)
* Basic resource validation (#1711)
* Ability to search without accents for accented words (#906)
* Weight queries so that title is more important than rest of body (#1826)
* Enhancements in the dataset and resource forms (#1506)
* OpenID can now be disabled (#1830)
* API and forms use same validation (#1792)
* More robust bulk search indexing, with options to ignore exceptions and just refresh (#1616i,#2232)
* Modify where the language code is placed in URLs (#2261)
* Simplified licenses list (#1359)
* Add extension point for dataset view (#1741)

Bug fixes:
* Catch exceptions on the QA archiver (#1809)
* Error when changing language when CKAN is mounted in URL (#1804)
* Naming of a new package/group can clash with a route (#1742)
* Can't delete all of a package's resources over REST API (#2266)
* Group edit form didn't allow adding multiple datasets at once (#2292)
* Fix layout bugs in IE 7 (#1788)
* Bug with Portugese translation and Javascript (#2318)
* Fix broken parse_rfc_2822 helper function (#2314)

v1.6 2012-02-24
===============

Expand Down Expand Up @@ -158,7 +197,7 @@ Minor:
* Speed up tag reading (98d72)
* Cope with new WebOb version 1 (#1267)
* Avoid exceptions caused by bots hitting error page directly (#1176)
* Too minor to mention: #1234,
* Too minor to mention: #1234,

Bug fixes:
* Re-adding tags to a package failed (since 1.4.1 in Web UI, 1.4 in API) (#1239)
Expand Down Expand Up @@ -197,7 +236,7 @@ Major:
* Refactor Web interface to use logic layer rather than model objects directly. Forms now defined in navl schema and designed in HTML template. Forms use of Formalchemy is deprecated. (#1078)

Minor:
* Links in user-supplied text made less attractive to spammers (nofollow) #1181
* Links in user-supplied text made less attractive to spammers (nofollow) #1181
* Package change notifications - remove duplicates (#1149)
* Metadata dump linked to (#1169)
* Refactor authorization code to be common across Package, Group and Authorization Group (#1074)
Expand All @@ -223,7 +262,7 @@ Bug fixes:
* Visitor can't create packages on new CKAN install - since v1.3.3 (#1090)
* OpenID user pages couldn't be accessed - since v1.3.2 (#1056)
* Default site_url configured to ckan.net, so pages obtains CSS from ckan.net- since v1.3 (#1085)


v1.3.3 2011-04-08
=================
Expand Down Expand Up @@ -256,7 +295,7 @@ Major:
* Resources can have extra fields (although not in web interface yet) (#826)
* CSW Harvesting - numerous of fixes & improvements. Ready for deployment. (#738 etc)
* Language switcher (82002)

Minor:
* Wordpress integration refactored as a Middleware plugin (#1013)
* Unauthorized actions lead to a flash message (#366)
Expand Down Expand Up @@ -308,7 +347,7 @@ Highlights of changes:
* WordPress twentyten compatible theming (#797)
* Caching support (ETag) (#693)
* Harvesting GEMINI2 metadata records from OGC CSW servers (#566)

Minor:
* New API key header (#466)
* Group metadata now revisioned (#231)
Expand All @@ -326,14 +365,14 @@ Highlights of changes:
* Resource search in API (#336)
* Visual theming of CKAN now easy (#340, #320)
* Greater integration with external Web UIs (#335, #347, #348)
* Plug-ins can be configured to handle web requests from specified URIs and
* Plug-ins can be configured to handle web requests from specified URIs and
insert HTML into pages.

Minor:
* Search engine optimisations e.g. alphabetical browsing (#350)
* CSV and JSON dumps improved (#315)


v1.0.2 2010-08-27
=================

Expand Down Expand Up @@ -384,7 +423,7 @@ Highlights of changes:
(#247)

Bugfixes:

* Resources were losing their history (#292)
* Extra fields now work with spaces in the name (#278, #280) and
international characters (#288)
Expand Down Expand Up @@ -426,7 +465,7 @@ For a full listing of tickets see: <http://ckan.org/milestone/v0.11>. Main highl

* Change to UUIDs for revisions and all domain objects
* Improved search performance and better pagination
* Significantly improved performance in API and WUI via judicious caching
* Significantly improved performance in API and WUI via judicious caching


v0.10 2009-09-30
Expand All @@ -446,7 +485,7 @@ v0.10 2009-09-30
* Convert to use formalchemy for all forms (#76)
* Use paginate in webhelpers (#118)

* Minor:
* Minor:

* Add author and maintainer attributes to package (#91)
* Change package state in the WUI (delete and undelete) (#126)
Expand Down Expand Up @@ -491,7 +530,7 @@ v0.6 2008-07-08
* Autocompletion (+ suggestion) of tags when adding tags to a package.
* Paginated lists for packages, tags, and revisions.
* RESTful machine API for package access, update, listing and creation.
* API Keys for users who wish to modify information via the REST API.
* API Keys for users who wish to modify information via the REST API.
* Update to vdm v0.2 (SQLObject) which fixes ordering of lists.
* Better immunity to SQL injection attacks.

Expand Down
2 changes: 1 addition & 1 deletion ckan/config/middleware.py
Expand Up @@ -134,7 +134,7 @@ def make_app(global_conf, full_stack=True, static_files=True, **app_conf):
if asbool(config.get('ckan.page_cache_enabled')):
app = PageCacheMiddleware(app, config)

# Tracking
# Tracking add config option
if asbool(config.get('ckan.tracking_enabled', 'false')):
app = TrackingMiddleware(app, config)
return app
Expand Down
7 changes: 4 additions & 3 deletions ckan/controllers/package.py
Expand Up @@ -452,16 +452,17 @@ def edit(self, id, data=None, errors=None, error_summary=None):
'user': c.user or c.author, 'extras_as_string': True,
'save': 'save' in request.params,
'moderated': config.get('moderated'),
'for_edit': True,
'pending': True,}

if context['save'] and not data:
return self._save_edit(id, context)
try:
c.pkg_dict = get_action('package_show')(context, {'id':id})
context['for_edit'] = True
old_data = get_action('package_show')(context, {'id':id})
# old data is from the database and data is passed from the
# user if there is a validation error. Use users data if there.
data = data or old_data
# Merge all elements for the complete package dictionary
c.pkg_dict = dict(old_data.items() + data.items())
except NotAuthorized:
abort(401, _('Unauthorized to read package %s') % '')
except NotFound:
Expand Down
7 changes: 4 additions & 3 deletions ckan/lib/dictization/model_dictize.py
Expand Up @@ -98,9 +98,10 @@ def resource_dictize(res, context):
if extras:
resource.update(extras)
#tracking
model = context['model']
tracking = model.TrackingSummary.get_for_resource(res.url)
resource['tracking_summary'] = tracking
if not context.get('for_edit'):
model = context['model']
tracking = model.TrackingSummary.get_for_resource(res.url)
resource['tracking_summary'] = tracking
return resource

def related_dictize(rel, context):
Expand Down
5 changes: 5 additions & 0 deletions ckan/logic/action/get.py
Expand Up @@ -484,6 +484,11 @@ def resource_show(context, data_dict):

def resource_status_show(context, data_dict):

try:
import ckan.lib.celery_app as celery_app
except ImportError:
return {'message': 'queue is not installed on this instance'}

model = context['model']
id = get_or_bust(data_dict, 'id')

Expand Down
20 changes: 11 additions & 9 deletions ckan/model/__init__.py
Expand Up @@ -197,15 +197,17 @@ def init_db(self):
self.upgrade_db()
## make sure celery tables are made as celery only makes
## them after adding a task
import ckan.lib.celery_app as celery_app
import celery.db.session as celery_session

## This creates the database tables it is a slight hack
## to celery.
backend = celery_app.celery.backend
celery_result_session = backend.ResultSession()
engine = celery_result_session.bind
celery_session.ResultModelBase.metadata.create_all(engine)
try:
import ckan.lib.celery_app as celery_app
import celery.db.session as celery_session
## This creates the database tables it is a slight
## hack to celery.
backend = celery_app.celery.backend
celery_result_session = backend.ResultSession()
engine = celery_result_session.bind
celery_session.ResultModelBase.metadata.create_all(engine)
except ImportError:
pass

self.init_configuration_data()
self.tables_created_and_initialised = True
Expand Down
8 changes: 5 additions & 3 deletions ckan/public/css/style.css
Expand Up @@ -422,8 +422,11 @@ body.index.home .front-page .action-box {
background: #FFF7C0;
}
body.index.home .front-page .action-box-inner {
margin: 0 20px 5px;
min-height: 15em;
padding: 0 20px 20px;
min-height: 13.4em;
}
body.index.home .front-page .action-box-inner :last-child {
margin-bottom: 0;
}
body.index.home .front-page .action-box-inner.collaborate {
background:url(../img/collaborate.png) no-repeat right top;
Expand Down Expand Up @@ -456,7 +459,6 @@ body.index.home .front-page .action-box-inner .create-button {
float: right;
font-weight: normal;
font-family: 'Ubuntu';
margin-top: 1.5em;
border-radius: 10px;
background-color: #B22;
border: 0px;
Expand Down
2 changes: 1 addition & 1 deletion ckan/templates/_util.html
Expand Up @@ -128,7 +128,7 @@
<py:def function="related_summary(related)">
<li id="related-item-${related.id}" class="span3">
<div class="thumbnail">
<button py:if="c.user and (c.userobj.id == related.owner_id or h.check_access('package_update',{'id':c.pkg.id}))" class="close" data-action="delete" data-related-id="${related.id}">×</button>
<button py:if="c.user and (c.userobj.id == related.owner_id or h.check_access('package_update',{'id':c.pkg.id}))" class="close" onclick="related_delete('${related.id}');">×</button>
<a href="${related.url}" class="image">
<img src="${related.image_url}" width="210" py:if="related.image_url" />
<img src="/images/photo-placeholder.png" width="210" py:if="not related.image_url" />
Expand Down
6 changes: 6 additions & 0 deletions ckan/templates/authorization_group/authz.html
Expand Up @@ -6,6 +6,12 @@
<py:def function="page_heading">Authorization: ${c.authorization_group_name}</py:def>

<div py:match="content">

<div class="alert alert-error">
Warning: Authorization groups are deprecated and no longer supported. They will be removed
completely on the next CKAN release.
</div>

<h3>Update Existing Roles</h3>

<form id="theform" method="POST">
Expand Down
6 changes: 6 additions & 0 deletions ckan/templates/authorization_group/edit.html
Expand Up @@ -6,6 +6,12 @@
<py:def function="page_heading">Edit: ${c.authorization_group.name if c.authorization_group else ''}</py:def>

<div py:match="content">

<div class="alert alert-error">
Warning: Authorization groups are deprecated and no longer supported. They will be removed
completely on the next CKAN release.
</div>

${Markup(c.form)}
</div>

Expand Down
6 changes: 6 additions & 0 deletions ckan/templates/authorization_group/index.html
Expand Up @@ -7,6 +7,12 @@
<py:def function="page_heading">Authorization Groups</py:def>

<div py:match="content">

<div class="alert alert-error">
Warning: Authorization groups are deprecated and no longer supported. They will be removed
completely on the next CKAN release.
</div>

<p i18n:msg="item_count">There are <strong>${c.page.item_count}</strong> authorization groups.</p>

${c.page.pager()}
Expand Down
6 changes: 6 additions & 0 deletions ckan/templates/authorization_group/new.html
Expand Up @@ -6,6 +6,12 @@
<py:def function="page_heading">New Authorization Group</py:def>

<div py:match="content">

<div class="alert alert-error">
Warning: Authorization groups are deprecated and no longer supported. They will be removed
completely on the next CKAN release.
</div>

${Markup(c.form)}
</div>

Expand Down
6 changes: 6 additions & 0 deletions ckan/templates/authorization_group/read.html
Expand Up @@ -7,6 +7,12 @@
<py:def function="page_heading">${c.authorization_group.name}</py:def>

<div py:match="content">

<div class="alert alert-error">
Warning: Authorization groups are deprecated and no longer supported. They will be removed
completely on the next CKAN release.
</div>

<h3>Members</h3>
<p i18n:msg="item_count">There are ${c.page.item_count} users in this authorization group.</p>
${c.page.pager()}
Expand Down
2 changes: 1 addition & 1 deletion ckan/templates/group/edit.html
Expand Up @@ -4,7 +4,7 @@

<py:def function="page_title">Edit: ${c.group.display_name}</py:def>
<py:def function="page_heading">Edit: ${c.group.display_name}</py:def>
<py:def function="body_class">no-sidebar</py:def>
<py:def function="body_class">${h.literal('no-sidebar')}</py:def>


<div py:match="content" class="group-edit-form">
Expand Down
20 changes: 10 additions & 10 deletions ckan/templates/home/index.html
Expand Up @@ -4,7 +4,7 @@
py:strip=""
>

<py:def function="body_class">no-sidebar</py:def>
<py:def function="body_class">${h.literal('no-sidebar')}</py:def>

<py:def function="page_title">Welcome</py:def>

Expand All @@ -15,24 +15,24 @@ <h1 class="page_heading">Welcome to ${g.site_title}!</h1>
<div class="row">
<div class="span4">
<div class="action-box">
<div class="action-box-inner find">
<div class="action-box-inner find clearfix">
<h1>Find data</h1>

<form action="${h.url_for(controller='package', action='search')}" method="GET">
<input name="q" value="" class="search-field" placeholder="${_('Find datasets')}" />
</form>
${g.site_title} contains <a href="${h.url_for(controller='package', action='search')}">${c.package_count} datasets</a> that you can
browse, learn about and download.
<p>${g.site_title} contains <a href="${h.url_for(controller='package', action='search')}">${c.package_count} datasets</a> that you can
browse, learn about and download.</p>
</div>
</div>
</div>
<div class="span4">
<div class="action-box">
<div class="action-box-inner share">
<div class="action-box-inner share clearfix">
<h1>Share data</h1>

Add your own datasets to share them with others and
to find other people interested in your data.
<p>Add your own datasets to share them with others and
to find other people interested in your data.</p>

<py:choose test="h.check_access('package_create')">
<a py:when="" href="${h.url_for(controller='package', action='new')}" class="create-button">Create a dataset &raquo;</a>
Expand All @@ -45,11 +45,11 @@ <h1>Share data</h1>
</div>
<div class="span4">
<div class="action-box">
<div class="action-box-inner collaborate">
<div class="action-box-inner collaborate clearfix">
<h1>Collaborate</h1>

Find out more about working with open data by exploring
these resources:
<p>Find out more about working with open data by exploring
these resources:</p>
<ul>
<li><a href="http://getthedata.org">GetTheData.org</a></li>
<li><a href="http://datapatterns.org">DataPatterns.org</a></li>
Expand Down

0 comments on commit e445eb7

Please sign in to comment.