Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/ckan/ckan
Browse files Browse the repository at this point in the history
  • Loading branch information
gerbyzation committed Nov 6, 2017
2 parents 1741e7f + bb6991b commit 563ebff
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 1 deletion.
26 changes: 26 additions & 0 deletions ckan/templates-bs2/package/resource_read.html
Expand Up @@ -32,6 +32,7 @@
{% endif %}
{% if res.url and h.is_url(res.url) %}
<li>
<div class="btn-group">
<a class="btn btn-primary resource-url-analytics resource-type-{{ res.resource_type }}" href="{{ res.url }}">
{% if res.resource_type in ('listing', 'service') %}
<i class="fa fa-eye"></i> {{ _('View') }}
Expand All @@ -43,6 +44,31 @@
<i class="fa fa-arrow-circle-o-down"></i> {{ _('Download') }}
{% endif %}
</a>
{% block download_resource_button %} {%if res.datastore_active %}
<button class="btn btn-primary dropdown-toggle" data-toggle="dropdown">
<span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li>
<a href="{{ h.url_for(controller='ckanext.datastore.controller:DatastoreController', action='dump', resource_id=res.id, bom=True) }}"
target="_blank">
<span>CSV</span>
</a>
<a href="{{ h.url_for(controller='ckanext.datastore.controller:DatastoreController', action='dump', resource_id=res.id, format='tsv', bom=True) }}"
target="_blank">
<span>TSV</span>
</a>
<a href="{{ h.url_for(controller='ckanext.datastore.controller:DatastoreController', action='dump', resource_id=res.id, format='json') }}"
target="_blank">
<span>JSON</span>
</a>
<a href="{{ h.url_for(controller='ckanext.datastore.controller:DatastoreController', action='dump', resource_id=res.id, format='xml') }}"
target="_blank">
<span>XML</span>
</a>
</li>
</ul>
{%endif%} {% endblock %}
</li>
{% endif %}
{% endblock %}
Expand Down
20 changes: 20 additions & 0 deletions ckan/templates/package/resource_read.html
Expand Up @@ -32,6 +32,7 @@
{% endif %}
{% if res.url and h.is_url(res.url) %}
<li>
<div class="btn-group">
<a class="btn btn-primary resource-url-analytics resource-type-{{ res.resource_type }}" href="{{ res.url }}">
{% if res.resource_type in ('listing', 'service') %}
<i class="fa fa-eye"></i> {{ _('View') }}
Expand All @@ -43,6 +44,25 @@
<i class="fa fa-arrow-circle-o-down"></i> {{ _('Download') }}
{% endif %}
</a>
{% block download_resource_button %}
{%if res.datastore_active %}
<button class="btn btn-primary dropdown-toggle" data-toggle="dropdown">
<span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li>
<a href="{{ h.url_for(controller='ckanext.datastore.controller:DatastoreController', action='dump', resource_id=res.id, bom=True) }}"
target="_blank"><span>CSV</span></a>
<a href="{{ h.url_for(controller='ckanext.datastore.controller:DatastoreController', action='dump', resource_id=res.id, format='tsv', bom=True) }}"
target="_blank"><span>TSV</span></a>
<a href="{{ h.url_for(controller='ckanext.datastore.controller:DatastoreController', action='dump', resource_id=res.id, format='json') }}"
target="_blank"><span>JSON</span></a>
<a href="{{ h.url_for(controller='ckanext.datastore.controller:DatastoreController', action='dump', resource_id=res.id, format='xml') }}"
target="_blank"><span>XML</span></a>
</li>
</ul>
{%endif%} {% endblock %}
</div>
</li>
{% endif %}
{% endblock %}
Expand Down
2 changes: 1 addition & 1 deletion ckan/views/__init__.py
Expand Up @@ -54,7 +54,7 @@ def set_cors_headers_for_response(response):

cors_origin_allowed = None
if asbool(config.get(u'ckan.cors.origin_allow_all')):
cors_origin_allowed = u'*'
cors_origin_allowed = b'*'
elif config.get(u'ckan.cors.origin_whitelist') and \
request.headers.get(u'Origin') \
in config[u'ckan.cors.origin_whitelist'].split(u' '):
Expand Down

0 comments on commit 563ebff

Please sign in to comment.