summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTyler Mandry <tmandry@gmail.com>2013-03-14 16:46:17 -0500
committerTyler Mandry <tmandry@gmail.com>2013-03-16 01:10:50 -0500
commitdcb2cf752a24ef78899bdcef65962c93cda40855 (patch)
tree87aebd64cd74b9c98283d7533a6923de3065669d
parentcb0c3f008a8d71b84ce3412c065b67250ee284a5 (diff)
downloadaskbot-dcb2cf752a24ef78899bdcef65962c93cda40855.tar.gz
askbot-dcb2cf752a24ef78899bdcef65962c93cda40855.tar.bz2
askbot-dcb2cf752a24ef78899bdcef65962c93cda40855.zip
Add ability to use LESS development mode with extra.less
-rw-r--r--askbot/skins/loaders.py10
-rw-r--r--askbot/templates/meta/html_head_stylesheets.html5
2 files changed, 11 insertions, 4 deletions
diff --git a/askbot/skins/loaders.py b/askbot/skins/loaders.py
index 50276f34..367433eb 100644
--- a/askbot/skins/loaders.py
+++ b/askbot/skins/loaders.py
@@ -59,9 +59,15 @@ class SkinEnvironment(CoffinEnvironment):
or empty string - depending on the existence of file
SKIN_PATH/media/style/extra.css
"""
- url = utils.get_media_url('style/extra.css', ignore_missing = True)
+ url = None
+ if django_settings.ASKBOT_CSS_DEVEL is True:
+ url = utils.get_media_url('style/extra.less', ignore_missing = True)
+ rel = "stylesheet/less"
+ if url is None:
+ url = utils.get_media_url('style/extra.css', ignore_missing = True)
+ rel = "stylesheet"
if url is not None:
- return '<link href="%s" rel="stylesheet" type="text/css" />' % url
+ return '<link href="%s" rel="%s" type="text/css" />' % (url, rel)
return ''
def load_skins():
diff --git a/askbot/templates/meta/html_head_stylesheets.html b/askbot/templates/meta/html_head_stylesheets.html
index 23750239..cb02f8e5 100644
--- a/askbot/templates/meta/html_head_stylesheets.html
+++ b/askbot/templates/meta/html_head_stylesheets.html
@@ -4,14 +4,15 @@
{% if settings.ASKBOT_CSS_DEVEL == False %}
<link href="{{"/style/style.css"|media }}" rel="stylesheet" type="text/css" />
+{{ skin.get_extra_css_link() }}
{% else %}
<link href="{{"/style/style.less"|media }}" rel="stylesheet/less" type="text/css" />
+{{ skin.get_extra_css_link() }}
<script type="text/javascript" src="{{"/js/less.min.js"|media}}"></script>
{% endif %}
<link href="{{'/bootstrap/css/bootstrap.css'|media}}" rel="stylesheet" type="text/css" />
-{{ skin.get_extra_css_link() }}
{% if settings.USE_CUSTOM_CSS %}
- <link
+ <link
href="{% url "custom_css" %}?v={{settings.MEDIA_RESOURCE_REVISION}}"
rel="stylesheet"
type="text/css"