Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into 3414-datastore-info
Browse files Browse the repository at this point in the history
  • Loading branch information
wardi committed Jan 27, 2017
2 parents 10b60d5 + 0bb141a commit 7ebfe61
Show file tree
Hide file tree
Showing 144 changed files with 1,951 additions and 7,432 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.rst
Expand Up @@ -19,6 +19,10 @@ API changes and deprecations:
helper) now default to not include package_count. Pass
include_dataset_count=True if you need the package_count values.
* ``resource['size']`` will change from string to long integer (#3205)
* upgrade Font-Awesome from version 3.2.1 to 4.0.3
please refer to
https://github.com/FortAwesome/Font-Awesome/wiki/Upgrading-from-3.2.1-to-4
to upgrade your code accordingly.

v2.6.0 2016-11-02
=================
Expand Down
48 changes: 24 additions & 24 deletions ckan/config/routing.py
Expand Up @@ -239,24 +239,24 @@ def make_map():
'api_data',
])))
m.connect('dataset_edit', '/dataset/edit/{id}', action='edit',
ckan_icon='edit')
ckan_icon='pencil-square-o')
m.connect('dataset_followers', '/dataset/followers/{id}',
action='followers', ckan_icon='group')
action='followers', ckan_icon='users')
m.connect('dataset_activity', '/dataset/activity/{id}',
action='activity', ckan_icon='time')
action='activity', ckan_icon='clock-o')
m.connect('/dataset/activity/{id}/{offset}', action='activity')
m.connect('dataset_groups', '/dataset/groups/{id}',
action='groups', ckan_icon='group')
action='groups', ckan_icon='users')
m.connect('dataset_resources', '/dataset/resources/{id}',
action='resources', ckan_icon='reorder')
action='resources', ckan_icon='bars')
m.connect('dataset_read', '/dataset/{id}', action='read',
ckan_icon='sitemap')
m.connect('/dataset/{id}/resource/{resource_id}',
action='resource_read')
m.connect('/dataset/{id}/resource_delete/{resource_id}',
action='resource_delete')
m.connect('resource_edit', '/dataset/{id}/resource_edit/{resource_id}',
action='resource_edit', ckan_icon='edit')
action='resource_edit', ckan_icon='pencil-square-o')
m.connect('/dataset/{id}/resource/{resource_id}/download',
action='resource_download')
m.connect('/dataset/{id}/resource/{resource_id}/download/{filename}',
Expand All @@ -269,12 +269,12 @@ def make_map():
m.connect('/dataset/{id}/resource/{resource_id}/preview',
action='resource_datapreview')
m.connect('views', '/dataset/{id}/resource/{resource_id}/views',
action='resource_views', ckan_icon='reorder')
action='resource_views', ckan_icon='bars')
m.connect('new_view', '/dataset/{id}/resource/{resource_id}/new_view',
action='edit_view', ckan_icon='edit')
action='edit_view', ckan_icon='pencil-square-o')
m.connect('edit_view',
'/dataset/{id}/resource/{resource_id}/edit_view/{view_id}',
action='edit_view', ckan_icon='edit')
action='edit_view', ckan_icon='pencil-square-o')
m.connect('resource_view',
'/dataset/{id}/resource/{resource_id}/view/{view_id}',
action='resource_view')
Expand Down Expand Up @@ -306,13 +306,13 @@ def make_map():
'activity',
])))
m.connect('group_about', '/group/about/{id}', action='about',
ckan_icon='info-sign'),
ckan_icon='info-circle'),
m.connect('group_edit', '/group/edit/{id}', action='edit',
ckan_icon='edit')
ckan_icon='pencil-square-o')
m.connect('group_members', '/group/members/{id}', action='members',
ckan_icon='group'),
ckan_icon='users'),
m.connect('group_activity', '/group/activity/{id}/{offset}',
action='activity', ckan_icon='time'),
action='activity', ckan_icon='clock-o'),
m.connect('group_read', '/group/{id}', action='read',
ckan_icon='sitemap')

Expand All @@ -330,16 +330,16 @@ def make_map():
'history'
])))
m.connect('organization_activity', '/organization/activity/{id}/{offset}',
action='activity', ckan_icon='time')
action='activity', ckan_icon='clock-o')
m.connect('organization_read', '/organization/{id}', action='read')
m.connect('organization_about', '/organization/about/{id}',
action='about', ckan_icon='info-sign')
action='about', ckan_icon='info-circle')
m.connect('organization_read', '/organization/{id}', action='read',
ckan_icon='sitemap')
m.connect('organization_edit', '/organization/edit/{id}',
action='edit', ckan_icon='edit')
action='edit', ckan_icon='pencil-square-o')
m.connect('organization_members', '/organization/members/{id}',
action='members', ckan_icon='group')
action='members', ckan_icon='users')
m.connect('organization_bulk_process',
'/organization/bulk_process/{id}',
action='bulk_process', ckan_icon='sitemap')
Expand All @@ -363,20 +363,20 @@ def make_map():
m.connect('user_generate_apikey', '/user/generate_key/{id}', action='generate_apikey')
m.connect('/user/activity/{id}/{offset}', action='activity')
m.connect('user_activity_stream', '/user/activity/{id}',
action='activity', ckan_icon='time')
action='activity', ckan_icon='clock-o')
m.connect('user_dashboard', '/dashboard', action='dashboard',
ckan_icon='list')
m.connect('user_dashboard_datasets', '/dashboard/datasets',
action='dashboard_datasets', ckan_icon='sitemap')
m.connect('user_dashboard_groups', '/dashboard/groups',
action='dashboard_groups', ckan_icon='group')
action='dashboard_groups', ckan_icon='users')
m.connect('user_dashboard_organizations', '/dashboard/organizations',
action='dashboard_organizations', ckan_icon='building')
action='dashboard_organizations', ckan_icon='building-o')
m.connect('/dashboard/{offset}', action='dashboard')
m.connect('user_follow', '/user/follow/{id}', action='follow')
m.connect('/user/unfollow/{id}', action='unfollow')
m.connect('user_followers', '/user/followers/{id:.*}',
action='followers', ckan_icon='group')
action='followers', ckan_icon='users')
m.connect('user_edit', '/user/edit/{id:.*}', action='edit',
ckan_icon='cog')
m.connect('user_delete', '/user/delete/{id}', action='delete')
Expand Down Expand Up @@ -410,11 +410,11 @@ def make_map():
m.connect('/feeds/custom.atom', action='custom')

map.connect('ckanadmin_index', '/ckan-admin', controller='admin',
action='index', ckan_icon='legal')
action='index', ckan_icon='gavel')
map.connect('ckanadmin_config', '/ckan-admin/config', controller='admin',
action='config', ckan_icon='check')
action='config', ckan_icon='check-square-o')
map.connect('ckanadmin_trash', '/ckan-admin/trash', controller='admin',
action='trash', ckan_icon='trash')
action='trash', ckan_icon='trash-o')
map.connect('ckanadmin', '/ckan-admin/{action}', controller='admin')

with SubMapper(map, controller='ckan.controllers.storage:StorageController') as m:
Expand Down
3 changes: 2 additions & 1 deletion ckan/controllers/admin.py
Expand Up @@ -50,7 +50,8 @@ def _get_config_form_items(self):
{'name': 'ckan.site_title', 'control': 'input', 'label': _('Site Title'), 'placeholder': ''},
{'name': 'ckan.main_css', 'control': 'select', 'options': styles, 'label': _('Style'), 'placeholder': ''},
{'name': 'ckan.site_description', 'control': 'input', 'label': _('Site Tag Line'), 'placeholder': ''},
{'name': 'ckan.site_logo', 'control': 'input', 'label': _('Site Tag Logo'), 'placeholder': ''},
{'name': 'ckan.site_logo', 'control': 'image_upload', 'label': _('Site Tag Logo'), 'placeholder': '', 'upload_enabled':h.uploads_enabled(),
'field_url': 'ckan.site_logo', 'field_upload': 'logo_upload', 'field_clear': 'clear_logo_upload'},
{'name': 'ckan.site_about', 'control': 'markdown', 'label': _('About'), 'placeholder': _('About page text')},
{'name': 'ckan.site_intro_text', 'control': 'markdown', 'label': _('Intro Text'), 'placeholder': _('Text on home page')},
{'name': 'ckan.site_custom_css', 'control': 'textarea', 'label': _('Custom CSS'), 'placeholder': _('Customisable css inserted into the page header')},
Expand Down
14 changes: 7 additions & 7 deletions ckan/lib/activity_streams.py
Expand Up @@ -165,24 +165,24 @@ def activity_stream_string_follow_group(context, activity):
# A dictionary mapping activity types to the icons associated to them
activity_stream_string_icons = {
'added tag': 'tag',
'changed group': 'group',
'changed group': 'users',
'changed package': 'sitemap',
'changed package_extra': 'edit',
'changed package_extra': 'pencil-square-o',
'changed resource': 'file',
'changed user': 'user',
'deleted group': 'group',
'deleted group': 'users',
'deleted package': 'sitemap',
'deleted package_extra': 'edit',
'deleted package_extra': 'pencil-square-o',
'deleted resource': 'file',
'new group': 'group',
'new group': 'users',
'new package': 'sitemap',
'new package_extra': 'edit',
'new package_extra': 'pencil-square-o',
'new resource': 'file',
'new user': 'user',
'removed tag': 'tag',
'follow dataset': 'sitemap',
'follow user': 'user',
'follow group': 'group',
'follow group': 'users',
'changed organization': 'briefcase',
'deleted organization': 'briefcase',
'new organization': 'briefcase',
Expand Down
2 changes: 1 addition & 1 deletion ckan/lib/helpers.py
Expand Up @@ -541,7 +541,7 @@ def _create_link_text(text, **kwargs):
if kwargs.pop('inner_span', None):
text = literal('<span>') + text + literal('</span>')
if icon:
text = literal('<i class="icon-%s"></i> ' % icon) + text
text = literal('<i class="fa fa-%s"></i> ' % icon) + text
return text

icon = kwargs.pop('icon', None)
Expand Down
8 changes: 4 additions & 4 deletions ckan/lib/plugins.py
Expand Up @@ -184,19 +184,19 @@ def register_group_plugins(map):
'unfollow', 'admins', 'activity'])))
map.connect('%s_edit' % group_type, '/%s/edit/{id}' % group_type,
controller=group_controller, action='edit',
ckan_icon='edit')
ckan_icon='pencil-square-o')
map.connect('%s_members' % group_type,
'/%s/members/{id}' % group_type,
controller=group_controller,
action='members',
ckan_icon='group')
ckan_icon='users')
map.connect('%s_activity' % group_type,
'/%s/activity/{id}/{offset}' % group_type,
controller=group_controller,
action='activity', ckan_icon='time'),
action='activity', ckan_icon='clock-o'),
map.connect('%s_about' % group_type, '/%s/about/{id}' % group_type,
controller=group_controller,
action='about', ckan_icon='info-sign')
action='about', ckan_icon='info-circle')
map.connect('%s_bulk_process' % group_type,
'/%s/bulk_process/{id}' % group_type,
controller=group_controller,
Expand Down
9 changes: 9 additions & 0 deletions ckan/logic/action/update.py
Expand Up @@ -11,6 +11,7 @@
from ckan.common import config
import paste.deploy.converters as converters

import ckan.lib.helpers as h
import ckan.plugins as plugins
import ckan.logic as logic
import ckan.logic.schema as schema_
Expand Down Expand Up @@ -1249,13 +1250,21 @@ def config_option_update(context, data_dict):

raise ValidationError(msg, error_summary={'message': msg})

upload = uploader.get_uploader('admin')
upload.update_data_dict(data_dict, 'ckan.site_logo',
'logo_upload', 'clear_logo_upload')
upload.upload(uploader.get_max_image_size())
data, errors = _validate(data_dict, schema, context)
if errors:
model.Session.rollback()
raise ValidationError(errors)

for key, value in data.iteritems():

# Set full Logo url
if key =='ckan.site_logo' and value and not value.startswith('http'):
value = h.url_for_static('uploads/admin/{0}'.format(value))

# Save value in database
model.set_system_info(key, value)

Expand Down
2 changes: 2 additions & 0 deletions ckan/logic/schema.py
Expand Up @@ -665,6 +665,8 @@ def default_update_configuration_schema():
'ckan.site_custom_css': [unicode],
'ckan.main_css': [unicode],
'ckan.homepage_style': [is_positive_integer],
'logo_upload': [ignore_missing, unicode],
'clear_logo_upload': [ignore_missing, unicode],
}

# Add ignore_missing to all fields, otherwise you need to provide them all
Expand Down
4 changes: 2 additions & 2 deletions ckan/plugins/interfaces.py
Expand Up @@ -312,7 +312,7 @@ def info(self):
:param default_description: default description that will be used if
the view is created automatically (optional, defaults to '').
:param icon: icon for the view type. Should be one of the
`Font Awesome`_ types without the `icon-` prefix eg. `compass`
`Font Awesome`_ types without the `fa fa-` prefix eg. `compass`
(optional, defaults to 'picture').
:param always_available: the view type should be always available when
creating new views regardless of the format of the resource
Expand Down Expand Up @@ -343,7 +343,7 @@ def info(self):
'schema': {
'image_url': [ignore_empty, unicode]
},
'icon': 'picture',
'icon': 'picture-o',
'always_available': True,
'iframed': False,
}
Expand Down

0 comments on commit 7ebfe61

Please sign in to comment.