git.ithinksw.org
/
philo.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a991afc
)
Fixed the node_url templatetag's generation of URLs.
author
Joseph Spiros
<joseph.spiros@ithinksw.com>
Thu, 15 Jul 2010 03:05:36 +0000
(23:05 -0400)
committer
Joseph Spiros
<joseph.spiros@ithinksw.com>
Thu, 15 Jul 2010 03:05:36 +0000
(23:05 -0400)
templatetags/nodes.py
patch
|
blob
|
history
diff --git
a/templatetags/nodes.py
b/templatetags/nodes.py
index
3be8194
..
0cb2289
100644
(file)
--- a/
templatetags/nodes.py
+++ b/
templatetags/nodes.py
@@
-28,10
+28,13
@@
class NodeURLNode(template.Node):
node = context['node']
current_site = Site.objects.get_current()
if node.has_ancestor(current_site.root_node):
- url = node.get_path(root=current_site.root_node)
+ url =
'/' +
node.get_path(root=current_site.root_node)
if self.with_obj:
with_obj = self.with_obj.resolve(context)
- url += node.view.get_subpath(with_obj)
+ subpath = node.view.get_subpath(with_obj)
+ if subpath[0] is '/':
+ subpath = subpath[1:]
+ url += subpath
else:
return settings.TEMPLATE_STRING_IF_INVALID