Skip to content

Commit

Permalink
- Display only default style legend at startup
Browse files Browse the repository at this point in the history
  • Loading branch information
afabiani committed Nov 14, 2018
1 parent c0ea75a commit e268a7e
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions geonode/layers/templates/layers/layer_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -562,18 +562,20 @@ <h5 class="modal-title" id="myModalLabel">Attribute Information</h5>
<li class="list-group-item">
<h4 class="list-group-item-heading">{%trans "Legend" %}</h4>
{% for style in resource.styles.all %}
{% for legend in resource.get_legend %}
{% if legend.link_type == 'image' and style.name in legend.url %}
<p>{{ style.sld_title|default:style.name }}</p>
{% if request.user.is_authenticated and 'access_token' in request.session %}
<p><img id="legend_icon" src="{{ legend.url }}&access_token={{ request.session.access_token }}"></p>
{% else %}
<p><img id="legend_icon" src="{{ legend.url }}"></p>
{% endif %}
{% else %}
<div id='legend_placeholder'></div>
{% endif %}
{% endfor %}
{% if resource.default_style == style %}
{% for legend in resource.get_legend %}
{% if legend.link_type == 'image' and style.name in legend.url %}
<!-- p>{{ style.sld_title|default:style.name }}</p -->
{% if request.user.is_authenticated and 'access_token' in request.session %}
<p><img id="legend_icon" src="{{ legend.url }}&access_token={{ request.session.access_token }}"></p>
{% else %}
<p><img id="legend_icon" src="{{ legend.url }}"></p>
{% endif %}
{% else %}
<div id='legend_placeholder'></div>
{% endif %}
{% endfor %}
{% endif %}
{% endfor %}
</li>
{% endif %}
Expand Down

0 comments on commit e268a7e

Please sign in to comment.