add /photos/libreplanet, /videos/libreplanet pages
authorAndrew Engelbrecht <sudoman@ninthfloor.org>
Mon, 6 Mar 2017 21:57:59 +0000 (16:57 -0500)
committerAndrew Engelbrecht <sudoman@ninthfloor.org>
Mon, 6 Mar 2017 21:57:59 +0000 (16:57 -0500)
for displaying media tagged as "libreplanet"

mediagoblin_libreplanet/__init__.py
mediagoblin_libreplanet/views.py

index 09ded6c..414297d 100644 (file)
@@ -79,7 +79,12 @@ register_routes([('all-videos', '/videos',
                  ('all-photos', '/videos/featured',
                   'mediagoblin.plugins.libreplanet.views:featured_video_listing'),
                  ('all-photos', '/photos/featured',
-                  'mediagoblin.plugins.libreplanet.views:featured_image_listing')
+                  'mediagoblin.plugins.libreplanet.views:featured_image_listing'),
+
+                 ('libreplanet-videos', '/videos/libreplanet',
+                  'mediagoblin.plugins.libreplanet.views:libreplanet_video_listing'),
+                 ('libreplanet-photos', '/photos/libreplanet',
+                  'mediagoblin.plugins.libreplanet.views:libreplanet_image_listing')
              ])
 
 # This is a dict that specifies which hooks this plugin uses.
index 829840c..84bac4e 100644 (file)
@@ -59,3 +59,11 @@ def featured_image_listing(request, page):
 def featured_video_listing(request, page):
     return type_listing(u'mediagoblin.media_types.video', 'Featured Videos', request, page, "featured")
 
+@uses_pagination
+def libreplanet_image_listing(request, page):
+    return type_listing(u'mediagoblin.media_types.image', 'LibrePlanet Photos', request, page, "libreplanet")
+
+@uses_pagination
+def libreplanet_video_listing(request, page):
+    return type_listing(u'mediagoblin.media_types.video', 'LibrePlanet Videos', request, page, "libreplanet")
+