added /videos/featured and /photos/featured URLs
authorAndrew Engelbrecht <sudoman@ninthfloor.org>
Mon, 6 Mar 2017 19:54:20 +0000 (14:54 -0500)
committerAndrew Engelbrecht <sudoman@ninthfloor.org>
Mon, 6 Mar 2017 19:54:20 +0000 (14:54 -0500)
media tagged with "featured" should show up on these pages.

mediagoblin_libreplanet/__init__.py
mediagoblin_libreplanet/views.py

index 7750221..1d3c760 100644 (file)
@@ -76,6 +76,10 @@ register_routes([('all-videos', '/videos',
                   'mediagoblin.plugins.libreplanet.views:video_listing'),
                  ('all-photos', '/photos',
                   'mediagoblin.plugins.libreplanet.views:image_listing')
+                 ('all-photos', '/videos/featured',
+                  'mediagoblin.plugins.libreplanet.views:featured_video_listing')
+                 ('all-photos', '/photos/featured',
+                  'mediagoblin.plugins.libreplanet.views:featured_image_listing')
              ])
 
 # This is a dict that specifies which hooks this plugin uses.
index 1dac5be..829840c 100644 (file)
@@ -50,3 +50,12 @@ def image_listing(request, page):
 @uses_pagination
 def video_listing(request, page):
     return type_listing(u'mediagoblin.media_types.video', 'Videos', request, page)
+
+@uses_pagination
+def featured_image_listing(request, page):
+    return type_listing(u'mediagoblin.media_types.image', 'Featured Photos', request, page, "featured")
+
+@uses_pagination
+def featured_video_listing(request, page):
+    return type_listing(u'mediagoblin.media_types.video', 'Featured Videos', request, page, "featured")
+