From ef51a2496fc2b8d981d57c6db71fae1ba0cf4f89 Mon Sep 17 00:00:00 2001 From: Max Goodman Date: Wed, 20 Mar 2013 00:45:42 -0700 Subject: [PATCH] Add extra_stylesheets knob to Reddit. This provides an easy way for plugins to add extra separate stylesheets to the site. --- r2/r2/lib/pages/pages.py | 1 + r2/r2/templates/reddit.html | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/r2/r2/lib/pages/pages.py b/r2/r2/lib/pages/pages.py index a24082eba..7c4327b9a 100755 --- a/r2/r2/lib/pages/pages.py +++ b/r2/r2/lib/pages/pages.py @@ -130,6 +130,7 @@ class Reddit(Templated): content_id = None css_class = None extra_page_classes = None + extra_stylesheets = [] def __init__(self, space_compress = True, nav_menus = None, loginbox = True, infotext = '', content = None, short_description='', title = '', robots = None, diff --git a/r2/r2/templates/reddit.html b/r2/r2/templates/reddit.html index ab7eef02f..dfeb8f738 100644 --- a/r2/r2/templates/reddit.html +++ b/r2/r2/templates/reddit.html @@ -97,6 +97,10 @@ ${adminbar_stylesheet()} + + %for extra_stylesheet in getattr(thing, 'extra_stylesheets', ()): + ${less_stylesheet(extra_stylesheet)} + %endfor <%def name="javascript()">