Skip to content

Commit

Permalink
Merge branch 'master' of github.com:okfn/ckan
Browse files Browse the repository at this point in the history
  • Loading branch information
tobes committed Apr 30, 2012
2 parents 38f1b56 + 681d544 commit fe97371
Show file tree
Hide file tree
Showing 8 changed files with 112 additions and 82 deletions.
3 changes: 2 additions & 1 deletion ckan/logic/converters.py
Expand Up @@ -77,7 +77,8 @@ def callable(key, data, errors, context):
for k in data.keys():
if k[0] == 'tags':
if data[k].get('vocabulary_id') == v.id:
tags.append(data[k]['name'])
name = data[k].get('display_name', data[k]['name'])
tags.append(name)
data[key] = tags
return callable

2 changes: 1 addition & 1 deletion ckan/templates/_snippet/data-api-help.html
Expand Up @@ -17,7 +17,7 @@ <h3>
<div class="modal-body">
<p><strong>Access resource data via a web API with powerful query
support</strong>. Further information in the <a
href="http://docs.ckan.org/en/latest/storage/datastore.html" target="_blank">main
href="http://docs.ckan.org/en/latest/using-data-api.html" target="_blank">main
CKAN Data API and DataStore documentation</a>.</p>

<div class="accordion-group">
Expand Down
111 changes: 56 additions & 55 deletions ckan/templates/js_strings.html
Expand Up @@ -13,61 +13,62 @@
/*
* Used in application.js.
*/
CKAN.Strings.checking = "${_('Checking...')}";
CKAN.Strings.urlIsTooShort = "${_('Type at least two characters...')}";
CKAN.Strings.urlIsUnchanged = "${_('This is the current URL.')}";
CKAN.Strings.urlIsAvailable = "${_('This URL is available!')}";
CKAN.Strings.urlIsNotAvailable = "${_('This URL is already used, please use a different one.')}";
CKAN.Strings.failedToSave = "${_('Failed to save, possibly due to invalid data ')}";
CKAN.Strings.addDataset = "${_('Add Dataset')}";
CKAN.Strings.addGroup = "${_('Add Group')}";
CKAN.Strings.youHaveUnsavedChanges = "${_("You have unsaved changes. Make sure to click 'Save Changes' below before leaving this page.")}";
CKAN.Strings.loading = "${_('Loading...')}";
CKAN.Strings.noNameBrackets = "${_('(no name)')}";
CKAN.Strings.deleteThisResourceQuestion = "${_('Delete the resource \'%name%\'?')}";
CKAN.Strings.previewNotAvailableForDataType = "${_('Preview not available for data type: ')}";
CKAN.Strings.failedToGetCredentialsForUpload = "${_('Failed to get credentials for storage upload. Upload cannot proceed')}";
CKAN.Strings.checkingUploadPermissions = "${_('Checking upload permissions ...')}";
CKAN.Strings.uploadingFile = "${_('Uploading file ...')}";
CKAN.Strings.dataFile = "${_('Data File')}";
CKAN.Strings.api = "${_('API')}";
CKAN.Strings.visualization = "${_('Visualization')}";
CKAN.Strings.image = "${_('Image')}";
CKAN.Strings.metadata = "${_('Metadata')}";
CKAN.Strings.documentation = "${_('Documentation')}";
CKAN.Strings.code = "${_('Code')}";
CKAN.Strings.example = "${_('Example')}";
CKAN.Strings = ${
h.json.dumps(dict(
checking = _('Checking...'),
urlIsTooShort = _('Type at least two characters...'),
urlIsUnchanged = _('This is the current URL.'),
urlIsAvailable = _('This URL is available!'),
urlIsNotAvailable = _('This URL is already used, please use a different one.'),
failedToSave = _('Failed to save, possibly due to invalid data '),
addDataset = _('Add Dataset'),
addGroup = _('Add Group'),
youHaveUnsavedChanges = _("You have unsaved changes. Make sure to click 'Save Changes' below before leaving this page."),
loading = _('Loading...'),
noNameBrackets = _('(no name)'),
deleteThisResourceQuestion = _('Delete the resource \'%name%\'?'),
previewNotAvailableForDataType = _('Preview not available for data type: '),
failedToGetCredentialsForUpload = _('Failed to get credentials for storage upload. Upload cannot proceed'),
checkingUploadPermissions = _('Checking upload permissions ...'),
uploadingFile = _('Uploading file ...'),
dataFile = _('Data File'),
api = _('API'),
visualization = _('Visualization'),
image = _('Image'),
metadata = _('Metadata'),
documentation = _('Documentation'),
code = _('Code'),
example = _('Example'),

upload = _('Upload'),
cancel = _('Cancel'),
name = _('Name'),
description = _('Description'),
url = _('Url'),
format = _('Format'),
resourceType = _('Resource Type'),
datastoreEnabled = _('DataStore enabled'),
sizeBracketsBytes = _('Size (Bytes)'),
mimetype = _('Mimetype'),
created = _('Created'),
lastModified = _('Last Modified'),
mimetypeInner = _('Mimetype (Inner)'),
hash = _('Hash'),
id = _('ID'),
doneEditing = _('Done'),
resourceHasUnsavedChanges = _('This resource has unsaved changes.'),
edit = _('Edit'),
preview = _('Preview'),
resourceFormatPlaceholder = _('e.g. csv, html, xls, rdf, ...'),
unknown = _('Unknown'),
extraFields = _('Extra Fields'),
addExtraField = _('Add Extra Field'),
deleteResource = _('Delete Resource'),
youCanUseMarkdown = _('You can use %aMarkdown formatting%b here.'),
shouldADataStoreBeEnabled = _('Should a %aDataStore table and Data API%b be enabled for this resource?'),
datesAreInISO = _('Dates are in %aISO Format%b &mdash; eg. %c2012-12-25%d or %c2010-05-31T14:30%d.'),
dataFileUploaded = _('Data File (Uploaded)')
), indent=4)}

/*
* Used in templates.js.
*/
CKAN.Strings.upload = "${_('Upload')}";
CKAN.Strings.cancel = "${_('Cancel')}";
CKAN.Strings.name = "${_('Name')}";
CKAN.Strings.description = "${_('Description')}";
CKAN.Strings.url = "${_('Url')}";
CKAN.Strings.format = "${_('Format')}";
CKAN.Strings.resourceType = "${_('Resource Type')}";
CKAN.Strings.datastoreEnabled = "${_('DataStore enabled')}";
CKAN.Strings.sizeBracketsBytes = "${_('Size (Bytes)')}";
CKAN.Strings.mimetype = "${_('Mimetype')}";
CKAN.Strings.created = "${_('Created')}";
CKAN.Strings.lastModified = "${_('Last Modified')}";
CKAN.Strings.mimetypeInner = "${_('Mimetype (Inner)')}";
CKAN.Strings.hash = "${_('Hash')}";
CKAN.Strings.id = "${_('ID')}";
CKAN.Strings.doneEditing = "${_('Done')}";
CKAN.Strings.resourceHasUnsavedChanges = "${_('This resource has unsaved changes.')}";
CKAN.Strings.edit = "${_('Edit')}";
CKAN.Strings.preview = "${_('Preview')}";
CKAN.Strings.resourceFormatPlaceholder = "${_('e.g. csv, html, xls, rdf, ...')}";
CKAN.Strings.unknown = "${_('Unknown')}";
CKAN.Strings.extraFields = "${_('Extra Fields')}";
CKAN.Strings.addExtraField = "${_('Add Extra Field')}";
CKAN.Strings.deleteResource = "${_('Delete Resource')}";
CKAN.Strings.youCanUseMarkdown = "${_('You can use %aMarkdown formatting%b here.')}";
CKAN.Strings.shouldADataStoreBeEnabled = "${_('Should a %aDataStore table and Data API%b be enabled for this resource?')}";
CKAN.Strings.datesAreInISO = "${_('Dates are in %aISO Format%b &mdash; eg. %c2012-12-25%d or %c2010-05-31T14:30%d.')}";
CKAN.Strings.dataFileUploaded = "${_('Data File (Uploaded)')}";
</script>

8 changes: 5 additions & 3 deletions ckan/templates/package/layout.html
Expand Up @@ -34,18 +34,20 @@
</li>
</py:otherwise>
</py:choose>
<li class="${'active' if c.action=='history' else ''}">${h.subnav_link(h.icon('page_stack') + _('History'), controller='package', action='history', id=c.pkg.name)}</li>

<li class="${'active' if c.action=='related' else ''}">${h.subnav_link(h.icon('package') + _('Related') + ' (%s)' % c.related_count, controller='related', action='list', id=c.pkg.name)}</li>


<py:if test="h.check_access('package_update',{'id':c.pkg.id})">
<li class="divider">|</li>
</py:if>
<li class="${'active' if c.action=='history' else ''}">${h.subnav_link(h.icon('page_stack') + _('History'), controller='package', action='history', id=c.pkg.name)}</li>

<py:if test="h.check_access('package_update',{'id':c.pkg.id})">
<li class="${'active' if c.action=='edit' else ''}">
${h.subnav_link(h.icon('package_edit') + _('Settings'), controller='package', action='edit', id=c.pkg.name)}
</li>
</py:if>


<li class="${'active' if c.action=='authz' else ''}" py:if="h.check_access('package_edit_permissions',{'id':c.pkg.id})">
${h.subnav_link(h.icon('lock') + _('Authorization'), controller='package', action='authz', id=c.pkg.name)}
</li>
Expand Down
2 changes: 1 addition & 1 deletion ckanext/multilingual/plugin.py
Expand Up @@ -75,7 +75,7 @@ def translate_data_dict(data_dict):
translated_flattened[key] = fallback_translations.get(
value, value)

elif isinstance(value, int):
elif isinstance(value, (int, dict)):
translated_flattened[key] = value

else:
Expand Down
6 changes: 3 additions & 3 deletions ckanext/organizations/forms.py
Expand Up @@ -221,9 +221,9 @@ def package_form(self):
def db_to_form_schema(self):
'''This is an interface to manipulate data from the database
into a format suitable for the form (optional)'''
schema = default_package_schema()
schema['groups']['capacity'] = [ ignore_missing, unicode ]
return schema
#schema = default_package_schema()
#schema['groups']['capacity'] = [ ignore_missing, unicode ]
#return schema

def form_to_db_schema(self):
schema = default_package_schema()
Expand Down
59 changes: 43 additions & 16 deletions ckanext/organizations/templates/organization_package_form.html
Expand Up @@ -143,6 +143,49 @@ <h2>Errors in form</h2>
<div class="instructions">
<p>Upload or link data files, APIs and other materials related to your dataset.</p>
</div>
<div class="row">
<div class="span4">
<ul class="resource-list resource-list-edit drag-drop-list">
</ul>
<ul class="resource-list resource-list-add">
<li><a href="#" class="js-resource-add">${h.icon('page_white_add')}New resource...</a></li>
</ul>
</div>
<div class="span8">
<div style="display: none;" class="resource-panel">
<button class="btn btn-danger resource-panel-close">x</button>
<div class="resource-details resource-add">
<ul class="nav nav-tabs">
<li><a data-toggle="tab" href="#link-file">Link to a file</a></li>
<li><a data-toggle="tab" href="#link-api">Link to an API</a></li>
<li><a data-toggle="tab" href="#upload-file">Upload a file</a></li>
</ul>
<div class="tab-content">
<div class="tab-pane" id="link-file">
<div class="form-inline js-add-url-form">
<label class="field_opt" for="url">File URL</label>
<input name="add-resource-url" type="text" class="input-small" placeholder="http://mydataset.com/file.csv"/>
<input name="add-resource-save" type="submit" class="btn btn-primary" value="Add" />
</div>
</div>
<div class="tab-pane" id="link-api">
<div class="form-inline js-add-api-form">
<label class="field_opt" for="url">API URL</label>
<input name="add-resource-url" type="text" class="input-small" placeholder="http://mydataset.com/api/"/>
<input name="add-resource-save" type="submit" class="btn btn-primary" value="Add" />
</div>
</div>
<div class="tab-pane" id="upload-file">
<div class="js-add-upload-form">
</div>
<div class="alert alert-block" style="display: none;"></div>
</div>
</div>
</div>
</div>
</div>
</div>

<div class="js-resource-edit-barebones">
<!-- The resource editor deletes these fields and replaces them with a dynamic editor.
They are required for the form to render correctly when not in resource-edit mode. -->
Expand All @@ -152,22 +195,6 @@ <h2>Errors in form</h2>
</py:for>
</py:for>
</div>
<ul class="resource-list resource-list-edit drag-drop-list">
</ul>
<ul class="resource-list resource-list-add">
<li><a href="#" class="js-resource-add">${h.icon('page_white_add')}New resource...</a></li>
</ul>
<div style="display: none;" class="resource-panel">
<button class="btn btn-danger resource-panel-close">x</button>
<div class="resource-details resource-add">
<ul class="button-row">
<li><h4>Add a resource:</h4></li>
<li><button class="btn js-link-file">Link to a file</button></li>
<li><button class="btn js-link-api">Link to an API</button></li>
<li class="js-upload-file ckan-logged-in" style="display: none;"><button class="btn js-upload-file">Upload a file</button></li>
</ul>
</div>
</div>
</fieldset>

<fieldset class="tab-pane fade" id='further-information'>
Expand Down
3 changes: 1 addition & 2 deletions doc/solr-setup.rst
Expand Up @@ -50,13 +50,12 @@ and the admin site::

http://localhost:8983/solr/admin

.. note:: If you get the message `Could not start Jetty servlet engine because no Java Development Kit (JDK) was found.` then you will have to edit /etc/profile and add this line to the end such as this to the end (adjusting the path for your machine's jdk install):
.. note:: If you get the message ``Could not start Jetty servlet engine because no Java Development Kit (JDK) was found.`` then you will have to edit the ``JAVA_HOME`` setting in ``/etc/default/jetty`` (adjusting the path for your machine's JDK install):

``JAVA_HOME=/usr/lib/jvm/java-6-openjdk-amd64/``

Now run::

export JAVA_HOME
sudo service jetty start


Expand Down

0 comments on commit fe97371

Please sign in to comment.