Skip to content

Commit

Permalink
-[Fixes #9921] Original Layer / Dataset not offered as Download on la…
Browse files Browse the repository at this point in the history
…yer detail page (#9942)
  • Loading branch information
marthamareal authored Aug 30, 2022
1 parent 37eb0e7 commit 97e378f
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 12 deletions.
2 changes: 1 addition & 1 deletion geonode/base/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
logger = logging.getLogger('geonode.base.utils')

_names = ['Zipped Shapefile', 'Zipped', 'Shapefile', 'GML 2.0', 'GML 3.1.1', 'CSV',
'GeoJSON', 'Excel', 'Legend', 'GeoTIFF', 'GZIP', 'Original Dataset',
'GeoJSON', 'Excel', 'Legend', 'GeoTIFF', 'GZIP', 'Original Layer',
'ESRI Shapefile', 'View in Google Earth', 'KML', 'KMZ', 'Atom', 'DIF',
'Dublin Core', 'ebRIM', 'FGDC', 'ISO', 'ISO with XSL']

Expand Down
2 changes: 1 addition & 1 deletion geonode/layers/templates/layers/layer_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ <h4 class="modal-title" id="myModalLabel">{% trans "Download Layer" %}</h4>
<br></br>
</div>
{% for link in links_download %}
{% if link.name == 'Original Dataset' %}
{% if link.name == 'Original Layer' %}
{% original_link_available resource.id link.url as original_dwn_link_available %}
{% if original_dwn_link_available %}
<a href="{{ link.url }}" target="_blank" id="{{ link.name | slugify }}" class="urls">{% trans "Download original files" %}</a>
Expand Down
24 changes: 14 additions & 10 deletions geonode/templates/metadata_detail.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{% extends "geonode_base.html" %}
{% load i18n %}
{% load proxy_lib_tags %}
{% load bootstrap_tags %}
{% load thesaurus %}

Expand Down Expand Up @@ -443,17 +444,20 @@ <h2 class="page-title">{% trans "Metadata" %} : {{ resource.title }}</h2>
{% endblock doc_file %}

<hr>

{% if "download_resourcebase" in perms_list %}


{% for link in resource.link_set.download %}
<dt>{{link.name}}</dt>
<dd><a href="{{link.url}}">{{resource.title}}.{{link.extension}}</a></dd>
{% endfor %}

<hr>

{% for link in resource.link_set.download %}
{% if link.name == 'Original Layer' %}
{% original_link_available resource.id link.url as original_dwn_link_available %}
{% if original_dwn_link_available %}
<dt>{{link.name}}</dt>
<dd><a href="{{link.url}}">{{resource.title}}.{{link.extension}}</a></dd>
{% endif %}
{% else %}
<dt>{{link.name}}</dt>
<dd><a href="{{link.url}}">{{resource.title}}.{{link.extension}}</a></dd>
{% endif %}
{% endfor %}
<hr>
{% endif %}

{% for link in resource.link_set.ows %}
Expand Down

0 comments on commit 97e378f

Please sign in to comment.