aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Arter <davea@mysociety.org>2016-09-21 13:44:22 +0100
committerDave Arter <davea@mysociety.org>2016-09-23 10:52:46 +0100
commit78b34d4543c1c3808851351a9f083789a99c72c9 (patch)
treedcb549d79d15cf8ddb57b7755c011b3d16921ae6
parentcb1d47760c9b5c879211474d4ec40735a87df57e (diff)
Some minor admin fixes
- Superusers couldn't view response priorities due to invalid $c->forward call - Navigation to other areas of admin was broken on response priority admin pages
-rw-r--r--perllib/FixMyStreet/App/Controller/Admin/ResponsePriorities.pm2
-rw-r--r--templates/web/base/admin/navigation.html2
-rw-r--r--templates/web/base/admin/responsepriorities/index.html2
-rw-r--r--templates/web/base/admin/responsepriorities/list.html2
-rw-r--r--templates/web/base/admin/templates.html2
-rw-r--r--templates/web/base/admin/templates_index.html2
6 files changed, 6 insertions, 6 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Admin/ResponsePriorities.pm b/perllib/FixMyStreet/App/Controller/Admin/ResponsePriorities.pm
index f1110fbf0..ce17390d9 100644
--- a/perllib/FixMyStreet/App/Controller/Admin/ResponsePriorities.pm
+++ b/perllib/FixMyStreet/App/Controller/Admin/ResponsePriorities.pm
@@ -17,7 +17,7 @@ sub index : Path : Args(0) {
my $user = $c->user;
if ($user->is_superuser) {
- $c->forward('fetch_all_bodies');
+ $c->forward('/admin/fetch_all_bodies');
} elsif ( $user->from_body ) {
$c->forward('load_user_body', [ $user->from_body->id ]);
$c->res->redirect( $c->uri_for( '', $c->stash->{body}->id ) );
diff --git a/templates/web/base/admin/navigation.html b/templates/web/base/admin/navigation.html
index 895589822..e021ba81b 100644
--- a/templates/web/base/admin/navigation.html
+++ b/templates/web/base/admin/navigation.html
@@ -2,7 +2,7 @@
<p>
<strong>[% tprintf(loc('%s admin:', "%s here is the site name"), site_name) %]</strong>
[%- FOREACH link IN allowed_links %]
- <a href="[% c.uri_for( link ) %]">[% allowed_pages.$link.0 %]</a>
+ <a href="[% c.uri_for( '/admin/' _ link ) %]">[% allowed_pages.$link.0 %]</a>
[% IF NOT loop.last %]|[% END %]
[% END %]
</p>
diff --git a/templates/web/base/admin/responsepriorities/index.html b/templates/web/base/admin/responsepriorities/index.html
index d8a79420d..882a3c538 100644
--- a/templates/web/base/admin/responsepriorities/index.html
+++ b/templates/web/base/admin/responsepriorities/index.html
@@ -3,7 +3,7 @@
<ul>
[% FOR body IN bodies %]
<li>
- <a href="/admin/responsepriorities/[% body.id %]">[% body.name %]</a>
+ <a href="[% c.uri_for('', body.id) %]">[% body.name %]</a>
</li>
[% END %]
</ul>
diff --git a/templates/web/base/admin/responsepriorities/list.html b/templates/web/base/admin/responsepriorities/list.html
index b64941f86..c893a4c70 100644
--- a/templates/web/base/admin/responsepriorities/list.html
+++ b/templates/web/base/admin/responsepriorities/list.html
@@ -11,7 +11,7 @@
[% FOR p IN response_priorities %]
<tr [% 'class="is-deleted"' IF p.deleted %]>
<td> [% p.name %] </td>
- <td> <a href="/admin/responsepriorities/[% body.id %]/[% p.id %]" class="btn">[% loc('Edit') %]</a> </td>
+ <td> <a href="[% c.uri_for('', body.id, p.id) %]" class="btn">[% loc('Edit') %]</a> </td>
</tr>
[% END %]
</tbody>
diff --git a/templates/web/base/admin/templates.html b/templates/web/base/admin/templates.html
index 25cd181aa..f9dda7a4c 100644
--- a/templates/web/base/admin/templates.html
+++ b/templates/web/base/admin/templates.html
@@ -19,7 +19,7 @@
<td> [% t.title %] </td>
<td> [% t.text %] </td>
<td> [% t.created %] </td>
- <td> <a href="/admin/templates/[% body.id %]/[% t.id %]" class="btn">[% loc('Edit') %]</a> </td>
+ <td> <a href="[% c.uri_for('templates', body.id, t.id) %]" class="btn">[% loc('Edit') %]</a> </td>
</tr>
[% END %]
</tbody>
diff --git a/templates/web/base/admin/templates_index.html b/templates/web/base/admin/templates_index.html
index 1f45b84de..40e1be300 100644
--- a/templates/web/base/admin/templates_index.html
+++ b/templates/web/base/admin/templates_index.html
@@ -3,7 +3,7 @@
<ul>
[% FOR body IN bodies %]
<li>
- <a href="/admin/templates/[% body.id %]">[% body.name %]</a>
+ <a href="[% c.uri_for('templates', body.id) %]">[% body.name %]</a>
</li>
[% END %]
</ul>