Commit 09befd2a by Will Daly

Merge pull request #1757 from edx/will/static-url-double-slash

Static URL double-slash
parents 3853c926 e0fe8bcd
...@@ -90,7 +90,10 @@ with open(CONFIG_ROOT / CONFIG_PREFIX + "env.json") as env_file: ...@@ -90,7 +90,10 @@ with open(CONFIG_ROOT / CONFIG_PREFIX + "env.json") as env_file:
STATIC_URL_BASE = ENV_TOKENS.get('STATIC_URL_BASE', None) STATIC_URL_BASE = ENV_TOKENS.get('STATIC_URL_BASE', None)
if STATIC_URL_BASE: if STATIC_URL_BASE:
# collectstatic will fail if STATIC_URL is a unicode string # collectstatic will fail if STATIC_URL is a unicode string
STATIC_URL = STATIC_URL_BASE.encode('ascii') + "/" + git.revision + "/" STATIC_URL = STATIC_URL_BASE.encode('ascii')
if not STATIC_URL.endswith("/"):
STATIC_URL += "/"
STATIC_URL += git.revision + "/"
# GITHUB_REPO_ROOT is the base directory # GITHUB_REPO_ROOT is the base directory
# for course data # for course data
......
...@@ -124,7 +124,9 @@ if STATIC_ROOT_BASE: ...@@ -124,7 +124,9 @@ if STATIC_ROOT_BASE:
STATIC_URL_BASE = ENV_TOKENS.get('STATIC_URL_BASE', None) STATIC_URL_BASE = ENV_TOKENS.get('STATIC_URL_BASE', None)
if STATIC_URL_BASE: if STATIC_URL_BASE:
# collectstatic will fail if STATIC_URL is a unicode string # collectstatic will fail if STATIC_URL is a unicode string
STATIC_URL = STATIC_URL_BASE.encode('ascii') + "/" STATIC_URL = STATIC_URL_BASE.encode('ascii')
if not STATIC_URL.endswith("/"):
STATIC_URL += "/"
PLATFORM_NAME = ENV_TOKENS.get('PLATFORM_NAME', PLATFORM_NAME) PLATFORM_NAME = ENV_TOKENS.get('PLATFORM_NAME', PLATFORM_NAME)
# For displaying on the receipt. At Stanford PLATFORM_NAME != MERCHANT_NAME, but PLATFORM_NAME is a fine default # For displaying on the receipt. At Stanford PLATFORM_NAME != MERCHANT_NAME, but PLATFORM_NAME is a fine default
......
...@@ -48,27 +48,27 @@ ...@@ -48,27 +48,27 @@
<ul> <ul>
<li class="nav-social-01"> <li class="nav-social-01">
<a href="http://www.meetup.com/edX-Global-Community/" rel="external"> <a href="http://www.meetup.com/edX-Global-Community/" rel="external">
<img src="${EDX_ROOT_URL}/static/images/social/ico-social-meetup.png" alt="edX on Meetup" /> <img src="${static.url('images/social/ico-social-meetup.png')}" alt="edX on Meetup" />
</a> </a>
</li> </li>
<li class="nav-social-02"> <li class="nav-social-02">
<a href="http://www.facebook.com/EdxOnline" rel="external"> <a href="http://www.facebook.com/EdxOnline" rel="external">
<img src="${EDX_ROOT_URL}/static/images/social/ico-social-facebook.png" alt="edX on Facebook" /> <img src="${static.url('images/social/ico-social-facebook.png')}" alt="edX on Facebook" />
</a> </a>
</li> </li>
<li class="nav-social-03"> <li class="nav-social-03">
<a href="https://twitter.com/edXOnline" rel="external"> <a href="https://twitter.com/edXOnline" rel="external">
<img src="${EDX_ROOT_URL}/static/images/social/ico-social-twitter.png" alt="edX on Twitter" /> <img src="${static.url('images/social/ico-social-twitter.png')}" alt="edX on Twitter" />
</a> </a>
</li> </li>
<li class="nav-social-04"> <li class="nav-social-04">
<a href="https://plus.google.com/108235383044095082735/posts" rel="external"> <a href="https://plus.google.com/108235383044095082735/posts" rel="external">
<img src="${EDX_ROOT_URL}/static/images/social/ico-social-google.png" alt="edX on Google+" /> <img src="${static.url('images/social/ico-social-google.png')}" alt="edX on Google+" />
</a> </a>
</li> </li>
<li class="nav-social-05"> <li class="nav-social-05">
<a href="http://youtube.com/user/edxonline" rel="external"> <a href="http://youtube.com/user/edxonline" rel="external">
<img src="${EDX_ROOT_URL}/static/images/social/ico-social-youtube.png" alt="edX on YouTube" /> <img src="${static.url('images/social/ico-social-youtube.png')}" alt="edX on YouTube" />
</a> </a>
</li> </li>
</ul> </ul>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment