summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJayaram R Pai2014-09-25 16:14:20 +0530
committerJayaram R Pai2014-09-25 16:14:20 +0530
commit0a1f6f7e58fb3ec9d3f9582a54b65e20f903c37f (patch)
tree4fcb7494af1ba11a9582bb12ab5ec582639967d9
parentb047e2143b719e9a693f421082f371f0b46b3a5d (diff)
parenta5d89d3cb8bd12a6acc3c6338d9edf94cde65474 (diff)
downloadscipy2014-0a1f6f7e58fb3ec9d3f9582a54b65e20f903c37f.tar.gz
scipy2014-0a1f6f7e58fb3ec9d3f9582a54b65e20f903c37f.tar.bz2
scipy2014-0a1f6f7e58fb3ec9d3f9582a54b65e20f903c37f.zip
Merge branch 'devel'
-rw-r--r--scipy/urls.py2
-rw-r--r--static/dajax/jquery.dajax.core.js2
-rw-r--r--static/dajaxice/dajaxice.core.js2
-rwxr-xr-xstatic/website/templates/base.html1
-rw-r--r--website/templatetags/tags.py7
5 files changed, 11 insertions, 3 deletions
diff --git a/scipy/urls.py b/scipy/urls.py
index 14eb39b..f4e2aa6 100644
--- a/scipy/urls.py
+++ b/scipy/urls.py
@@ -11,5 +11,5 @@ urlpatterns = patterns('',
url(dajaxice_config.dajaxice_url, include('dajaxice.urls')),
# For devel
- # url(r'^2014/', include('website.urls', namespace='website')),
+ url(r'^2014/', include('website.urls', namespace='website')),
)
diff --git a/static/dajax/jquery.dajax.core.js b/static/dajax/jquery.dajax.core.js
index 0bddd41..ed7eb46 100644
--- a/static/dajax/jquery.dajax.core.js
+++ b/static/dajax/jquery.dajax.core.js
@@ -46,7 +46,7 @@ var Dajax = {
break;
case 'red':
- window.setTimeout('window.location="/2014/'+elem.url+'";',elem.delay);
+ window.setTimeout('window.location="'+aliasUrl+elem.url+'";',elem.delay);
break;
case 'js':
diff --git a/static/dajaxice/dajaxice.core.js b/static/dajaxice/dajaxice.core.js
index e879d45..82c7153 100644
--- a/static/dajaxice/dajaxice.core.js
+++ b/static/dajaxice/dajaxice.core.js
@@ -65,7 +65,7 @@ var Dajaxice = {
var send_data = 'argv='+encodeURIComponent(JSON.stringify(argv)),
oXMLHttpRequest = new XMLHttpRequest,
- endpoint = '/2014/dajaxice/'+dajaxice_function+'/';
+ endpoint = aliasUrl+'/dajaxice/'+dajaxice_function+'/';
if(method == 'GET'){
endpoint = endpoint + '?' + send_data;
diff --git a/static/website/templates/base.html b/static/website/templates/base.html
index 13f41d8..cc0220c 100755
--- a/static/website/templates/base.html
+++ b/static/website/templates/base.html
@@ -90,6 +90,7 @@
<li><a href=""><img src="{% static 'website/images/googleplus.png' %}" alt="gp"></a></li>
</ul>
</div> <!-- /#social -->
+<script> aliasUrl = "{% settings_value 'ALIAS_URL' %}";</script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
<script src="{% static 'dajax/jquery.dajax.core.js' %}"></script>
diff --git a/website/templatetags/tags.py b/website/templatetags/tags.py
index 8861f95..d9fafd4 100644
--- a/website/templatetags/tags.py
+++ b/website/templatetags/tags.py
@@ -1,4 +1,5 @@
from django import template
+from django.conf import settings
register = template.Library()
@@ -7,3 +8,9 @@ def active(request, pattern):
if pattern in request.path:
return 'active'
return ''
+
+# settings value
+# usage: {% settings_value "LANGUAGE_CODE" %}
+@register.simple_tag
+def settings_value(name):
+ return getattr(settings, name, "")