Current location

narf Source control manager Git

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier Mehani <shtrom@ssji.net>2018-05-20 21:25:51 +1000
committerOlivier Mehani <shtrom@ssji.net>2018-05-20 21:35:47 +1000
commit0c092bf3a9e0b29279d060c7ae51b5508d00e53a (patch)
tree25a3f022b7386dbad30e7c7196ea23cd234680bf
parentf6d0891d8fce42abded8f4b206ad3560d61c195b (diff)
squash! Limit access to media to logged in usersshtrom/2018-05-20
Prevent collection listing
-rw-r--r--mediagoblin/templates/mediagoblin/user_pages/collection.html11
-rw-r--r--mediagoblin/templates/mediagoblin/user_pages/collection_list.html11
2 files changed, 22 insertions, 0 deletions
diff --git a/mediagoblin/templates/mediagoblin/user_pages/collection.html b/mediagoblin/templates/mediagoblin/user_pages/collection.html
index 71ba4451..10a2c6c3 100644
--- a/mediagoblin/templates/mediagoblin/user_pages/collection.html
+++ b/mediagoblin/templates/mediagoblin/user_pages/collection.html
@@ -56,6 +56,7 @@
<a class="button_action" href="{{ delete_url }}">{% trans %}Delete{% endtrans %}</a>
{% endif %}
+ {% if request.user %}
<p>
{% autoescape False %}
{{ collection.description_html }}
@@ -68,5 +69,15 @@
user=user.username,
collection=collection.slug ) %}
{% include "mediagoblin/utils/feed_link.html" %}
+ {% else %}
+ <p><a href=
+ {% if persona_auth is defined %}
+ "javascript:;" id="persona_login"
+ {% else %}
+ "{{ request.urlgen('mediagoblin.auth.login') }}"
+ {% endif %}
+ >{%- trans %}Log in{% endtrans -%}
+ </a> to access media.</p>
+ {% endif %}
{% endblock %}
diff --git a/mediagoblin/templates/mediagoblin/user_pages/collection_list.html b/mediagoblin/templates/mediagoblin/user_pages/collection_list.html
index 4b449c76..169cb5c1 100644
--- a/mediagoblin/templates/mediagoblin/user_pages/collection_list.html
+++ b/mediagoblin/templates/mediagoblin/user_pages/collection_list.html
@@ -44,6 +44,7 @@
{% endif %}
{% endif %}
+ {% if request.user %}
<ul>
{% for coll in collections %}
{%- set coll_url = coll.url_for_self(request.urlgen) %}
@@ -52,5 +53,15 @@
</li>
{% endfor %}
</ul>
+ {% else %}
+ <p><a href=
+ {% if persona_auth is defined %}
+ "javascript:;" id="persona_login"
+ {% else %}
+ "{{ request.urlgen('mediagoblin.auth.login') }}"
+ {% endif %}
+ >{%- trans %}Log in{% endtrans -%}
+ </a> to access media.</p>
+ {% endif %}
{% endblock %}