summaryrefslogtreecommitdiff
path: root/chimere/actions.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2016-05-27 13:13:23 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2016-05-27 13:13:47 +0200
commit49c32c2cca03f812d6bfb92ec9678f709a84d956 (patch)
tree11f4cfc9abf4f097b97fdba67162c824e75ebbd2 /chimere/actions.py
parent9fe603b08813a2a0f95a5f2db702dac66adb4e15 (diff)
downloadChimère-49c32c2cca03f812d6bfb92ec9678f709a84d956.tar.bz2
Chimère-49c32c2cca03f812d6bfb92ec9678f709a84d956.zip
Filter action available and redirect properly
Diffstat (limited to 'chimere/actions.py')
-rw-r--r--chimere/actions.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/chimere/actions.py b/chimere/actions.py
index ac2bbaf..1fac738 100644
--- a/chimere/actions.py
+++ b/chimere/actions.py
@@ -36,18 +36,19 @@ class Action:
try:
self.url = reverse(
self.path,
- args=[area_name if area_name else ''] + self.extra_url_args)
+ args=[area_name + '/' if area_name else '']
+ + self.extra_url_args)
except NoReverseMatch:
# backward url management
self.url = reverse(
self.path,
- args=[area_name + '/' if area_name else '']
- + self.extra_url_args)
+ args=[area_name if area_name else ''] + self.extra_url_args)
default_actions = [
(Action('view', 'chimere:index', _('View')), []),
(Action('contribute', 'chimere:edit', _('Contribute')),
- (Action('edit', 'chimere:edit', _('Add a new point of interest')),
+ (Action('edit-marker', 'chimere:editmarker',
+ _('Add a new point of interest')),
Action('edit-route', 'chimere:editroute', _('Add a new route')),
Action('edit-polygon', 'chimere:editpolygon', _('Add a new polygon'))),
)]
@@ -82,7 +83,8 @@ def actions(area_name=''):
real_childs = []
for child_act in childs:
if area:
- if (child_act.id == 'edit' and not area.allow_point_edition) \
+ if (child_act.id == 'edit-marker'
+ and not area.allow_point_edition) \
or (child_act.id == 'edit-route'
and not area.allow_route_edition) \
or (child_act.id == 'edit-polygon'