Skip to content

Commit

Permalink
Merge branch 'enhancement-2371-fanstatic' into feature-2375-demo-theme
Browse files Browse the repository at this point in the history
  • Loading branch information
tobes committed May 10, 2012
2 parents c588ba0 + 84cbc83 commit cb39109
Show file tree
Hide file tree
Showing 82 changed files with 2,811 additions and 1,034 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
24 changes: 24 additions & 0 deletions LICENSE.txt
Expand Up @@ -114,4 +114,28 @@ The above copyright notice and this permission notice shall be included in all c

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

rjsmin / rcssmin
----------------

Parts of these packages are include in the include directory of ckan.
Full packages can be found at.
http://opensource.perlig.de/rjsmin/
http://opensource.perlig.de/rcssmin/

They both are licensed under Approved License, Version 2

Copyright 2011, 2012
Andr\xe9 Malo or his licensors, as applicable

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

2 changes: 1 addition & 1 deletion ckan/config/environment.py
Expand Up @@ -151,7 +151,7 @@ def find_controller(self, controller):
config['pylons.app_globals'] = app_globals.Globals()

# add helper functions
restrict_helpers = asbool(config.get('ckan.restrict_template_vars', 'false'))
restrict_helpers = asbool(config.get('ckan.restrict_template_vars', 'true'))
helpers = _Helpers(h, restrict_helpers)
config['pylons.h'] = helpers

Expand Down
21 changes: 21 additions & 0 deletions ckan/config/middleware.py
Expand Up @@ -17,6 +17,7 @@
from routes.middleware import RoutesMiddleware
from repoze.who.config import WhoConfig
from repoze.who.middleware import PluggableAuthenticationMiddleware
from fanstatic import Fanstatic

from ckan.plugins import PluginImplementations
from ckan.plugins.interfaces import IMiddleware
Expand Down Expand Up @@ -134,9 +135,29 @@ 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)

# Fanstatic
if config.get('ckan.include_support', '').lower()[:3] == 'dev':
fanstatic_config = {
'versioning' : True,
'recompute_hashes' : True,
'minified' : False,
'bottom' : True,
'bundle' : False,
}
else:
fanstatic_config = {
'versioning' : True,
'recompute_hashes' : False,
'minified' : True,
'bottom' : True,
'bundle' : True,
}
app = Fanstatic(app, **fanstatic_config)

# Tracking
if asbool(config.get('ckan.tracking_enabled', 'false')):
app = TrackingMiddleware(app, config)

return app

class I18nMiddleware(object):
Expand Down
1 change: 1 addition & 0 deletions ckan/config/routing.py
Expand Up @@ -297,6 +297,7 @@ def make_map():
m.connect('storage_file', '/storage/f/{label:.*}',
action='file')

map.connect('/i18n/strings_{lang}.js', controller='i18n', action='strings')

for plugin in routing_plugins:
map = plugin.after_map(map)
Expand Down
12 changes: 12 additions & 0 deletions ckan/controllers/i18n.py
@@ -0,0 +1,12 @@
import re
import ckan.lib.base as base
import ckan.lib.i18n as i18n

class I18NController(base.BaseController):

def strings(self, lang):
i18n.set_lang(lang)
html = base.render('js_strings.html', cache_force=True)
html = re.sub('<[^\>]*>', '', html)
base.response.headers['Content-type'] = "text/javascript; charset=utf-8"
return html
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
8 changes: 5 additions & 3 deletions ckan/controllers/related.py
Expand Up @@ -18,17 +18,19 @@ def list(self, id):

try:
logic.check_access('package_show', context, data_dict)
except logic.NotFound:
base.abort(404, base._('Dataset not found'))
except logic.NotAuthorized:
abort(401, _('Not authorized to see this page'))
base.abort(401, base._('Not authorized to see this page'))

try:
c.pkg_dict = logic.get_action('package_show')(context, data_dict)
c.pkg = context['package']
c.resources_json = h.json.dumps(c.pkg_dict.get('resources',[]))
except logic.NotFound:
abort(404, _('Dataset not found'))
base.abort(404, base._('Dataset not found'))
except logic.NotAuthorized:
abort(401, _('Unauthorized to read package %s') % id)
base.abort(401, base._('Unauthorized to read package %s') % id)

c.related_count = len(c.pkg.related)

Expand Down

0 comments on commit cb39109

Please sign in to comment.