adds conditional for display of media edit link
authorCaleb Forbes Davis V <caldavis@gmail.com>
Wed, 22 Jun 2011 17:13:29 +0000 (12:13 -0500)
committerCaleb Forbes Davis V <caldavis@gmail.com>
Wed, 22 Jun 2011 17:13:29 +0000 (12:13 -0500)
mediagoblin/templates/mediagoblin/user_pages/media.html

index 44bc38b86842136d8427ff1228f2b90008fe1e3d..ade7f0c6fdb1a2d7cc21856e0f1e0d73c06b40be 100644 (file)
     by
     <a href="{{ request.urlgen('mediagoblin.user_pages.user_home',
                                user= media.uploader().username) }}">
-      {{- media.uploader().username }}</a></p>
-    <p><a href="{{ request.urlgen('mediagoblin.edit.edit_media',
-                               user= media.uploader().username,
-                               media= media._id) }}">Edit</a></p>
+      {{- media.uploader().username }}</a></p>   
+    {% if media.uploader().username == request.user.username %}
+      <p><a href="{{ request.urlgen('mediagoblin.edit.edit_media',
+                                    user= media.uploader().username,
+                                    media= media._id) }}">Edit</a></p>
+    {% endif %}
   {% else %}
   <p>Sorry, no such media found.<p/>
   {% endif %}