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 775022187eff72cff0f9ac0807484d6812bd5701..1d3c760878eee60ac168734f60d69823957c4b4c 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 1dac5be55616827ad2dd284b4bd1de7613d629f4..829840caedfdea2ad0e9df2082b4310b1f41321b 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")
+