Skip to content

Commit

Permalink
Merge branch 'master' into 2375-demo-theme-development
Browse files Browse the repository at this point in the history
Conflicts:
	ckan/__init__.py

version -> 2.0a in head

	ckan/controllers/group.py

sort order change went with master head is commented out name asc

	ckan/i18n/ckan.pot
	ckan/i18n/zh_TW/LC_MESSAGES/ckan.mo
	ckan/i18n/zh_TW/LC_MESSAGES/ckan.po

removed branch changes

	ckan/lib/helpers.py

various new functions in head kept

	ckan/lib/maintain.py

new functions in head kept

	ckan/model/__init__.py

new model kept
  • Loading branch information
tobes committed Aug 29, 2012
2 parents 61b33f6 + 2b59d11 commit 62e31cc
Show file tree
Hide file tree
Showing 95 changed files with 59,094 additions and 35,900 deletions.
2 changes: 1 addition & 1 deletion .tx/config
@@ -1,7 +1,7 @@
[main]
host = http://www.transifex.net

[ckan.1-7]
[ckan.1-8]
file_filter = ckan/i18n/<lang>/LC_MESSAGES/ckan.po
source_file = ckan/i18n/ckan.pot
source_lang = en
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.txt
Expand Up @@ -30,6 +30,7 @@ v1.8
available by `setting ckan.restrict_template_vars = false` in your
.ini config file. Only restricted functions will be allowed in
future versions of CKAN.
* [#2842] Allow sort ordering of dataset listings on group pages

API changes and deprecation:
* [#2313] Deprecated functions related to the old faceting data structure have
Expand Down
1 change: 1 addition & 0 deletions ckan/__init__.py
@@ -1,4 +1,5 @@
__version__ = '2.0a'

__description__ = 'Comprehensive Knowledge Archive Network (CKAN) Software'
__long_description__ = \
'''CKAN software provides a hub for datasets. The flagship site running CKAN
Expand Down
38 changes: 34 additions & 4 deletions ckan/config/deployment.ini_tmpl
Expand Up @@ -158,10 +158,12 @@ ckan.backup_dir = %(here)s/backup
# Locale/languages
ckan.locale_default = en
#ckan.locales_offered =
# Default order is roughly by number of people speaking it in Europe:
# http://en.wikipedia.org/wiki/Languages_of_the_European_Union#Knowledge
ckan.locale_order = en de fr it es pl ru nl sv no cs_CZ hu pt_BR fi bg ca sq sr sr_Latn
ckan.locales_filtered_out = el ro lt sl
# Languages are grouped by percentage of strings in CKAN 1.8 translated
# (those with 100% first, then those with >=80%, then >=50%, then <50%) and
# within these groups roughly sorted by number of worldwide native speakers
# according to Wikipedia.
ckan.locale_order = en pt_BR ja it cs_CZ ca es fr el sv sr sr@latin no sk fi ru de pl nl bg ko_KR hu sa sl lv
ckan.locales_filtered_out =

## Atom Feeds
#
Expand Down Expand Up @@ -196,6 +198,34 @@ ckan.feeds.author_name =
# If not set, then the value in `ckan.site_url` is used.
ckan.feeds.author_link =

## File Store
#
# CKAN allows users to upload files directly to file storage either on the local
# file system or to online ‘cloud’ storage like Amazon S3 or Google Storage.
#
# If you are using local file storage, remember to set ckan.site_url.
#
# To enable cloud storage (Google or S3), first run: pip install boto
#
# @see http://docs.ckan.org/en/latest/filestore.html

# 'Bucket' to use for file storage
#ckan.storage.bucket = my-bucket-name

# To enable local file storage:
#ofs.impl = pairtree
#ofs.storage_dir = /my/path/to/storage/root/directory

# To enable Google cloud storage:
#ofs.impl = google
#ofs.gs_access_key_id =
#ofs.gs_secret_access_key =

# To enable S3 cloud storage:
#ofs.impl = s3
#ofs.aws_access_key_id = ....
#ofs.aws_secret_access_key = ....

## Webstore
## Uncommment to enable datastore
# ckan.datastore.enabled = 1
Expand Down
4 changes: 3 additions & 1 deletion ckan/config/environment.py
Expand Up @@ -17,7 +17,6 @@
import ckan.model as model
import ckan.plugins as p
import ckan.lib.helpers as h
import ckan.lib.search as search
import ckan.lib.app_globals as app_globals

log = logging.getLogger(__name__)
Expand Down Expand Up @@ -168,6 +167,9 @@ def find_controller(self, controller):

# Init SOLR settings and check if the schema is compatible
#from ckan.lib.search import SolrSettings, check_solr_schema_version

# lib.search is imported here as we need the config enabled and parsed
import ckan.lib.search as search
search.SolrSettings.init(config.get('solr_url'),
config.get('solr_user'),
config.get('solr_password'))
Expand Down
2 changes: 1 addition & 1 deletion ckan/controllers/feed.py
Expand Up @@ -432,7 +432,7 @@ def _parse_url_params(self):
"""

try:
page = int(request.params.get('page', 1))
page = int(request.params.get('page', 1)) or 1
except ValueError:
abort(400, ('"page" parameter must be an integer'))

Expand Down
9 changes: 7 additions & 2 deletions ckan/controllers/group.py
Expand Up @@ -52,6 +52,9 @@ def _read_template(self, group_type):
def _history_template(self, group_type):
return lookup_group_plugin(group_type).history_template()

def _edit_template(self, group_type):
return lookup_group_plugin(group_type).edit_template()

## end hooks

def _guess_group_type(self, expecting_name=False):
Expand Down Expand Up @@ -139,7 +142,8 @@ def read(self, id):
# most search operations should reset the page counter:
params_nopage = [(k, v) for k, v in request.params.items()
if k != 'page']
sort_by = request.params.get('sort', 'name asc')
#sort_by = request.params.get('sort', 'name asc')
sort_by = request.params.get('sort', None)

def search_url(params):
url = h.url_for(controller='group', action='read',
Expand Down Expand Up @@ -302,7 +306,7 @@ def edit(self, id, data=None, errors=None, error_summary=None):

self._setup_template_variables(context, data, group_type=group_type)
c.form = render(self._group_form(group_type), extra_vars=vars)
return render('group/edit.html')
return render(self._edit_template(c.group.type))

def _get_group_type(self, id):
"""
Expand Down Expand Up @@ -351,6 +355,7 @@ def _save_edit(self, id, context):
tuplize_dict(parse_params(request.params))))
context['message'] = data_dict.get('log_message', '')
data_dict['id'] = id
context['allow_partial_update'] = True
group = get_action('group_update')(context, data_dict)

if id != group['name']:
Expand Down
8 changes: 4 additions & 4 deletions ckan/controllers/home.py
Expand Up @@ -87,10 +87,10 @@ def index(self):
'https://www.google.com/accounts/o8/id')
if not c.userobj.email and (is_google_id and
not c.userobj.fullname):
msg = _('Please <a href="{link}">update your profile</a>'
' and add your email address and your full name. '
'{site} uses your email address'
' if you need to reset your password.'.format(link=url,
msg = _(u'Please <a href="{link}">update your profile</a>'
u' and add your email address and your full name. '
u'{site} uses your email address'
u' if you need to reset your password.'.format(link=url,
site=g.site_title))
elif not c.userobj.email:
msg = _('Please <a href="%s">update your profile</a>'
Expand Down
8 changes: 7 additions & 1 deletion ckan/controllers/package.py
Expand Up @@ -278,7 +278,7 @@ def read(self, id, format='html'):
ctype, format, loader = "text/html; charset=utf-8", "html", \
MarkupTemplate
else:
ctype, extension, loader = self._content_type_from_accept()
ctype, format, loader = self._content_type_from_accept()

response.headers['Content-Type'] = ctype

Expand Down Expand Up @@ -1265,6 +1265,12 @@ def _parse_recline_state(self, params):
recline_state.pop('height', None)
recline_state['readOnly'] = True

# previous versions of recline setup used elasticsearch_url attribute
# for data api url - see http://trac.ckan.org/ticket/2639
# fix by relocating this to url attribute which is the default location
if 'dataset' in recline_state and 'elasticsearch_url' in recline_state['dataset']:
recline_state['dataset']['url'] = recline_state['dataset']['elasticsearch_url']

# Ensure only the currentView is available
# default to grid view if none specified
if not recline_state.get('currentView', None):
Expand Down
6 changes: 3 additions & 3 deletions ckan/controllers/related.py
Expand Up @@ -38,7 +38,7 @@ def dashboard(self):
try:
page = int(base.request.params.get('page', 1))
except ValueError, e:
abort(400, ('"page" parameter must be an integer'))
base.abort(400, ('"page" parameter must be an integer'))

# Update ordering in the context
query = logic.get_action('related_list')(context,data_dict)
Expand Down Expand Up @@ -84,12 +84,12 @@ def read(self, id):
try:
logic.check_access('related_show', context, data_dict)
except logic.NotAuthorized:
abort(401, _('Not authorized to see this page'))
base.abort(401, _('Not authorized to see this page'))

related = model.Session.query(model.Related).\
filter(model.Related.id == id).first()
if not related:
abort(404, _('The requested related item was not found'))
base.abort(404, _('The requested related item was not found'))

related.view_count = model.Related.view_count + 1

Expand Down
4 changes: 2 additions & 2 deletions ckan/controllers/storage.py
Expand Up @@ -187,7 +187,7 @@ def file(self, label):
fapp = FileApp(filepath, headers=None, **headers)
return fapp(request.environ, self.start_response)
else:
h.redirect_to(file_url)
h.redirect_to(file_url.encode('ascii','ignore'))


class StorageAPIController(BaseController):
Expand Down Expand Up @@ -270,7 +270,7 @@ def get_metadata(self, label):
qualified=False
)
if url.startswith('/'):
url = config.get('ckan.site_url','').rstrip('/') + '/' + url
url = config.get('ckan.site_url','').rstrip('/') + url

if not self.ofs.exists(bucket, label):
abort(404)
Expand Down
Binary file modified ckan/i18n/bg/LC_MESSAGES/ckan.mo
Binary file not shown.

0 comments on commit 62e31cc

Please sign in to comment.