Skip to content

Commit

Permalink
use sld_url to retrieve the correct sld location, fixes #2048
Browse files Browse the repository at this point in the history
  • Loading branch information
simod committed Nov 18, 2015
1 parent 1108644 commit 4018825
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions geonode/layers/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ class Style(models.Model):
def __str__(self):
return "%s" % self.name.encode('utf-8')

def absolute_url(self):
return self.sld_url.split('geoserver/', 1)[1]


class LayerManager(ResourceBaseManager):

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 @@ -319,7 +319,7 @@ <h4>{% trans "Styles" %}</h4>
{% else %}
<input type="radio" name="style" id="{{ style.name }}" value="{{ style.title }}"/>
{% endif %}
<a href="{{ GEOSERVER_BASE_URL }}styles/{{ style.name }}.sld" >{{ style.sld_title }}</a>
<a href="{{ GEOSERVER_BASE_URL }}{{ style.absolute_url }}" >{{ style.sld_title }}</a>
</li>
{% empty %}
<li>{% trans "No styles associated with this layer" %}</li>
Expand Down

0 comments on commit 4018825

Please sign in to comment.