Permalink
Browse files

Add a context processor for settings, and expose PRODUCTION_DOMAIN.

  • Loading branch information...
1 parent 1865b05 commit d71316f8de8501bc95cdbdcb7e475a7c387651a1 @ericholscher ericholscher committed Nov 20, 2012
Showing with 9 additions and 8 deletions.
  1. +2 −1 readthedocs/settings/base.py
  2. +7 −7 readthedocs/templates/core/project_details.html
@@ -91,7 +91,8 @@
"django.core.context_processors.debug",
"django.core.context_processors.i18n",
"django.core.context_processors.media",
- "django.core.context_processors.request"
+ "django.core.context_processors.request",
+ "core.context_processors.readthedocs_processor",
)
INSTALLED_APPS = [
@@ -71,13 +71,13 @@
{% endif %}
-{% if project.get_latest_build.success %}
- <h3>{% trans "Short URLs" %}</h3>
- <p>
- <a href="//{{ project.slug}}.readthedocs.org">{{ project.slug }}.readthedocs.org</a><br>
- <a href="//{{ project.slug}}.rtfd.org">{{ project.slug }}.rtfd.org</a>
- </p>
-{% endif %}
+<h3>{% trans "Short URLs" %}</h3>
+<p>
+ <a href="//{{ project.slug}}.{{ PRODUCTION_DOMAIN }}">{{ project.slug }}.{{ PRODUCTION_DOMAIN }}</a><br>
+ {% if PRODUCTION_DOMAIN == "readthedocs.org" %}
+ <a href="//{{ project.slug}}.rtfd.org">{{ project.slug }}.rtfd.org</a>
+ {% endif %}
+</p>
{% if project.django_packages_url %}
<h3>{% trans "Open Comparison" %}</h3>

0 comments on commit d71316f

Please sign in to comment.