Commit 86bd3c7c authored by fred's avatar fred

do not display "view online" for objects that are not viewable

parent e6be735c
...@@ -16,7 +16,7 @@ def online_url(object): ...@@ -16,7 +16,7 @@ def online_url(object):
return settings.WEBSITE_BASE_URL + 'emissions/' + object.emission.slug + '/' + object.slug return settings.WEBSITE_BASE_URL + 'emissions/' + object.emission.slug + '/' + object.slug
if isinstance(object, SoundFile): if isinstance(object, SoundFile):
return settings.WEBSITE_BASE_URL + 'emissions/' + object.episode.emission.slug + '/' + object.episode.slug return settings.WEBSITE_BASE_URL + 'emissions/' + object.episode.emission.slug + '/' + object.episode.slug
return '#' return ''
@register.filter @register.filter
......
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
<a href="{% url 'home' %}" class="icon-home-space">Accueil</a> <a href="{% url 'home' %}" class="icon-home-space">Accueil</a>
<a target="blank" href="http://stats.radiopanik.org/index.php?module=Login&action=logme&login=panikdb&password=d48fb8e3a453d965901339e6b020538f" class="icon-bar-chart">Statistiques</a> <a target="blank" href="http://stats.radiopanik.org/index.php?module=Login&action=logme&login=panikdb&password=d48fb8e3a453d965901339e6b020538f" class="icon-bar-chart">Statistiques</a>
{% block online-url %} {% block online-url %}
{% if object %} {% if object and object|online_url %}
<a href="{{ object|online_url }}" target="blank" class="icon-eye-open">Voir en ligne</a> <a href="{{ object|online_url }}" target="blank" class="icon-eye-open">Voir en ligne</a>
{% endif %} {% endif %}
{% endblock %} {% endblock %}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment