Commits

Chris Chambers committed 694197f

Updated templates to use the url template tag rather than assuming that the urls are on the base dir and removed the hack of base address that I added in last time

  • Participants
  • Parent commits 54eaf69

Comments (0)

Files changed (5)

File settings/defaults.py

 # Mango's behaviour, create a file named custom.py in this directory. This way
 # custom settings are not affected by the update process.
 
-BASE_URL = 'http://example.com/'
+BASE_URL = 'http://example.com/' #TODO - This can be autogenerated from django, we should use that rather than requiring the user to set it correctly
 
 # set to 0 to disable caching
 

File templates/index.dhtml

 			</article>
 	{% else %}{% if forloop.last %}
 			<h2>Want more?</h2>
-			<p>Check out the <a href="/archives/">archives</a>.</p>
+			<p>Check out the <a href="{% url mango.views.archives %}">archives</a>.</p>
 	{% endif %}{% endif %}{% empty %}
 			<h2>Welcome to your new blog</h2>
 			<p>It's lookin' a bit empty, though. Get to work!</p>

File templates/post.dhtml

 						<h4 class="structural">This post has the following tags:</h4>
 						<ol>
 						{% for tag in meta.tags %}
-							<li><a href="{{ base_url }}/tag/{{ tag|slugify }}/">{{ tag }}</a></li>
+							<li><a href="{% url mango.views.tagged_as tag %}">{{ tag }}</a></li>
 						{% endfor %}
 						</ol>
 					</footer>

File templates/tags.dhtml

 	{% if tags %}
 			<dl id="tags">
 		{% for tag, count in tags %}
-				<dt><a href="/tag/{{ tag|slugify }}/">{{ tag }}</a></dt>
+				<dt><a href="{% url mango.views.tagged_as tag %}">{{ tag }}</a></dt>
 				<dd>{{ count }}</dd>
 		{% endfor %}
 			</dl>
                     'form': form,
                     'new_comment': comment,
                     'short_url': short_url,
-                    'base_url': BASE_URL.rstrip('/'),
                     'thread': thread,
                     'type': 'post' if 'datetime' in context['meta'] else 'page',
                 }, **context_defaults(request))))