aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2015-01-20 12:51:07 +0000
committerMatthew Somerville <matthew@mysociety.org>2015-01-20 13:10:25 +0000
commitc4d726bacd492bd4281b9eddbdc29d3190444d3c (patch)
tree0910fa9e48c61be292148802ab159463b387e955
parentd72a342f32661a099686b2392aed95391217026b (diff)
Rename 'body_edit' admin endpoint to 'body'.
-rw-r--r--perllib/FixMyStreet/App/Controller/Admin.pm9
-rw-r--r--perllib/FixMyStreet/Cobrand/Zurich.pm1
-rw-r--r--t/app/controller/admin.t12
-rw-r--r--templates/web/base/admin/body.html2
-rw-r--r--templates/web/base/admin/category_edit.html (renamed from templates/web/base/admin/body_edit.html)0
-rw-r--r--templates/web/zurich/admin/body.html2
6 files changed, 12 insertions, 14 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Admin.pm b/perllib/FixMyStreet/App/Controller/Admin.pm
index 3e5a1a95a..de13a76de 100644
--- a/perllib/FixMyStreet/App/Controller/Admin.pm
+++ b/perllib/FixMyStreet/App/Controller/Admin.pm
@@ -427,7 +427,7 @@ sub update_contacts : Private {
# Remove any others
$c->stash->{body}->body_areas->search( { area_id => [ keys %current ] } )->delete;
- $c->stash->{updated} = _('Configuration updated - contacts will be generated automatically later');
+ $c->stash->{updated} = _('Values updated');
}
}
@@ -485,13 +485,13 @@ sub lookup_body : Private {
}
# This is for if the category name contains a '/'
-sub body_edit_all : Path('body_edit') {
+sub category_edit_all : Path('body') {
my ( $self, $c, $body_id, @category ) = @_;
my $category = join( '/', @category );
- $c->go( 'body_edit', [ $body_id, $category ] );
+ $c->go( 'category_edit', [ $body_id, $category ] );
}
-sub body_edit : Path('body_edit') : Args(2) {
+sub category_edit : Path('body') : Args(2) {
my ( $self, $c, $body_id, $category ) = @_;
$c->stash->{body_id} = $body_id;
@@ -1201,7 +1201,6 @@ sub set_allowed_pages : Private {
'config' => [ _('Configuration'), 8],
'user_edit' => [undef, undef],
'body' => [undef, undef],
- 'body_edit' => [undef, undef],
'report_edit' => [undef, undef],
'update_edit' => [undef, undef],
'abuse_edit' => [undef, undef],
diff --git a/perllib/FixMyStreet/Cobrand/Zurich.pm b/perllib/FixMyStreet/Cobrand/Zurich.pm
index 087d9046b..577da9dd5 100644
--- a/perllib/FixMyStreet/Cobrand/Zurich.pm
+++ b/perllib/FixMyStreet/Cobrand/Zurich.pm
@@ -296,7 +296,6 @@ sub admin_pages {
$pages = { %$pages,
'bodies' => [_('Bodies'), 1],
'body' => [undef, undef],
- 'body_edit' => [undef, undef],
};
return $pages if $type eq 'dm';
diff --git a/t/app/controller/admin.t b/t/app/controller/admin.t
index 9ff5b5c90..58d7e0e96 100644
--- a/t/app/controller/admin.t
+++ b/t/app/controller/admin.t
@@ -201,12 +201,12 @@ subtest 'check contact creation' => sub {
note => 'test/note',
non_public => 'on',
} } );
- $mech->get_ok('/admin/body_edit/' . $body->id . '/test/category');
+ $mech->get_ok('/admin/body/' . $body->id . '/test/category');
};
subtest 'check contact editing' => sub {
- $mech->get_ok('/admin/body_edit/' . $body->id .'/test%20category');
+ $mech->get_ok('/admin/body/' . $body->id .'/test%20category');
$mech->submit_form_ok( { with_fields => {
email => 'test2@example.com',
@@ -219,7 +219,7 @@ subtest 'check contact editing' => sub {
$mech->content_contains( '<td>test2 note' );
$mech->content_contains( 'Private:&nbsp;No' );
- $mech->get_ok('/admin/body_edit/' . $body->id . '/test%20category');
+ $mech->get_ok('/admin/body/' . $body->id . '/test%20category');
$mech->submit_form_ok( { with_fields => {
email => 'test2@example.com',
note => 'test2 note',
@@ -228,12 +228,12 @@ subtest 'check contact editing' => sub {
$mech->content_contains( 'Private:&nbsp;Yes' );
- $mech->get_ok('/admin/body_edit/' . $body->id . '/test%20category');
+ $mech->get_ok('/admin/body/' . $body->id . '/test%20category');
$mech->content_contains( '<td><strong>test2@example.com' );
};
subtest 'check contact updating' => sub {
- $mech->get_ok('/admin/body_edit/' . $body->id . '/test%20category');
+ $mech->get_ok('/admin/body/' . $body->id . '/test%20category');
$mech->content_like(qr{test2\@example.com</strong>[^<]*</td>[^<]*<td>No}s);
$mech->get_ok('/admin/body/' . $body->id);
@@ -243,7 +243,7 @@ subtest 'check contact updating' => sub {
$mech->submit_form_ok({form_number => 1});
$mech->content_like(qr'test2@example.com</td>[^<]*<td>\s*Confirmed:&nbsp;Yes's);
- $mech->get_ok('/admin/body_edit/' . $body->id . '/test%20category');
+ $mech->get_ok('/admin/body/' . $body->id . '/test%20category');
$mech->content_like(qr{test2\@example.com[^<]*</td>[^<]*<td><strong>Yes}s);
};
diff --git a/templates/web/base/admin/body.html b/templates/web/base/admin/body.html
index e67cb2b07..1e3a8f824 100644
--- a/templates/web/base/admin/body.html
+++ b/templates/web/base/admin/body.html
@@ -61,7 +61,7 @@
</tr>
[% WHILE ( cat = contacts.next ) %]
<tr [% IF cat.deleted %]class="is-deleted"[% END %]>
- <td class="contact-category"><a href="[% c.uri_for( 'body_edit', body_id, cat.category ) %]">[% cat.category %]</a>
+ <td class="contact-category"><a href="[% c.uri_for( 'body', body_id, cat.category ) %]">[% cat.category %]</a>
<br>[% cat.email | html %]</td>
<td>
[% loc('Confirmed') %]:&nbsp;
diff --git a/templates/web/base/admin/body_edit.html b/templates/web/base/admin/category_edit.html
index ef7a0a11c..ef7a0a11c 100644
--- a/templates/web/base/admin/body_edit.html
+++ b/templates/web/base/admin/category_edit.html
diff --git a/templates/web/zurich/admin/body.html b/templates/web/zurich/admin/body.html
index 4cedc9838..771f1e537 100644
--- a/templates/web/zurich/admin/body.html
+++ b/templates/web/zurich/admin/body.html
@@ -19,7 +19,7 @@
</tr>
[% WHILE ( cat = contacts.next ) %]
<tr[% IF cat.deleted %] class="is-deleted"[% END %]>
- <td><a href="[% c.uri_for( 'body_edit', body_id, cat.category ) %]">[% cat.category %]</a></td>
+ <td><a href="[% c.uri_for( 'body', body_id, cat.category ) %]">[% cat.category %]</a></td>
<td>[% cat.email | html %]</td>
<td>[% cat.editor %]</td>
<td>[% cat.note | html %]</td>