Merge pull request #2682 from edx/frances/experiments/rtl

RTL platform support
This commit is contained in:
frances botsford
2014-10-17 15:22:36 -04:00
94 changed files with 1666 additions and 360 deletions

View File

@@ -1,6 +1,7 @@
<%!
from staticfiles.storage import staticfiles_storage
from pipeline_mako import compressed_css, compressed_js
from django.utils.translation import get_language_bidi
%>
<%def name='url(file, raw=False)'><%
@@ -11,6 +12,13 @@ except:
%>${url}${"?raw" if raw else ""}</%def>
<%def name='css(group, raw=False)'>
<%
rtl_group = '{}-rtl'.format(group)
if get_language_bidi() and rtl_group in settings.PIPELINE_CSS:
group = rtl_group
%>
% if settings.FEATURES['USE_DJANGO_PIPELINE']:
${compressed_css(group, raw=raw)}
% else:

View File

@@ -12,6 +12,8 @@ from django.core import cache
# If we can't find a 'general' CACHE defined in settings.py, we simply fall back
# to returning the default cache. This will happen with dev machines.
from django.utils.translation import get_language
try:
cache = cache.get_cache('general')
except Exception:
@@ -45,7 +47,7 @@ def cache_if_anonymous(view_func):
# same view accessed through different domain names may
# return different things, so include the domain name in the key.
domain = str(request.META.get('HTTP_HOST')) + '.'
cache_key = domain + "cache_if_anonymous." + request.path
cache_key = domain + "cache_if_anonymous." + get_language() + '.' + request.path
response = cache.get(cache_key)
if not response:
response = view_func(request, *args, **kwargs)