aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEdmund von der Burg <evdb@mysociety.org>2011-04-01 11:13:32 +0100
committerEdmund von der Burg <evdb@mysociety.org>2011-04-01 11:13:32 +0100
commit4249138c5f1ba30708fe50971c8adf9f93adc1de (patch)
tree4d7de1c3245964240e23811fd1f2492b24718fbc
parent53fbccab8e7471fa9e06496a56f136b1edb43351 (diff)
Change '/reports/new' to '/report/new'
Fix broken links to '/reports/<<id>>' Get correct base under CGI and FastCGI
-rw-r--r--conf/httpd.conf37
-rw-r--r--notes/INSTALL-catalyst.txt2
-rw-r--r--notes/catalyst-master-merge-todos.txt6
-rw-r--r--perllib/FixMyStreet/App/Controller/Report/New.pm (renamed from perllib/FixMyStreet/App/Controller/Reports/New.pm)8
-rw-r--r--perllib/FixMyStreet/App/Controller/Tokens.pm2
-rw-r--r--perllib/FixMyStreet/Map.pm2
-rw-r--r--t/app/controller/report_import.t (renamed from t/app/controller/reports_import.t)0
-rw-r--r--t/app/controller/report_new.t (renamed from t/app/controller/reports_new.t)30
-rw-r--r--templates/web/default/report/new/all_councils_text.html (renamed from templates/web/default/reports/new/all_councils_text.html)0
-rw-r--r--templates/web/default/report/new/fill_in_details.html (renamed from templates/web/default/reports/new/fill_in_details.html)12
-rw-r--r--templates/web/default/report/new/fill_in_details_text.html (renamed from templates/web/default/reports/new/fill_in_details_text.html)0
-rw-r--r--templates/web/default/report/new/form_heading.html (renamed from templates/web/default/reports/new/form_heading.html)0
-rw-r--r--templates/web/default/report/new/no_councils_text.html (renamed from templates/web/default/reports/new/no_councils_text.html)0
-rw-r--r--templates/web/default/report/new/notes.html (renamed from templates/web/default/reports/new/notes.html)0
-rw-r--r--templates/web/default/report/new/report_import.html (renamed from templates/web/default/reports/new/report_import.html)0
-rw-r--r--templates/web/default/report/new/report_new.html (renamed from templates/web/default/reports/new/report_new.html)2
-rw-r--r--templates/web/default/report/new/some_councils_text.html (renamed from templates/web/default/reports/new/some_councils_text.html)0
-rw-r--r--templates/web/emptyhomes/report/new/all_councils_text.html (renamed from templates/web/emptyhomes/reports/new/all_councils_text.html)0
-rw-r--r--templates/web/emptyhomes/report/new/fill_in_details_text.html (renamed from templates/web/emptyhomes/reports/new/fill_in_details_text.html)0
-rw-r--r--templates/web/emptyhomes/report/new/form_heading.html (renamed from templates/web/emptyhomes/reports/new/form_heading.html)0
-rw-r--r--templates/web/emptyhomes/report/new/no_councils_text.html (renamed from templates/web/emptyhomes/reports/new/no_councils_text.html)0
-rw-r--r--templates/web/emptyhomes/report/new/notes.html (renamed from templates/web/emptyhomes/reports/new/notes.html)0
-rw-r--r--templates/web/emptyhomes/tokens/confirm_problem.html2
-rwxr-xr-xweb/index.cgi2
24 files changed, 50 insertions, 55 deletions
diff --git a/conf/httpd.conf b/conf/httpd.conf
index 56b363b71..0a8323e69 100644
--- a/conf/httpd.conf
+++ b/conf/httpd.conf
@@ -43,9 +43,6 @@ RewriteEngine on
# RewriteLog /var/log/apache2/rewrite.log
# RewriteLogLevel 3
-# catch some Catalyst urls early as they are deep in the site
-RewriteRule /reports/new(.*) /fixmystreet_app_cgi.cgi [L]
-
# End slashes goodbye
RewriteRule ^/admin/ - [L]
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-d
@@ -105,26 +102,26 @@ RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -f
RewriteRule /(.+) /$1 [L]
# Explicitly capture all cgi files so that we can remove them one by one
-RewriteRule /ajax(.*) /ajax.cgi$1 [L]
-RewriteRule /alert(.*) /alert.cgi$1 [L]
-RewriteRule /confirm(.*) /confirm.cgi$1 [L]
-RewriteRule /contact(.*) /contact.cgi$1 [L]
-RewriteRule /flickr(.*) /flickr.cgi$1 [L]
-RewriteRule /fun(.*) /fun.cgi$1 [L]
-RewriteRule /$ /index.cgi [L]
-RewriteRule /index(.*) /index.cgi$1 [L]
-RewriteRule /json(.*) /json.cgi$1 [L]
-RewriteRule /photo(.*) /photo.cgi$1 [L]
-RewriteRule /questionnaire(.*) /questionnaire.cgi$1 [L]
-RewriteRule /reports(.*) /reports.cgi$1 [L]
-RewriteRule /rss(.*) /rss.cgi$1 [L]
-RewriteRule /test(.*) /test.cgi$1 [L]
-RewriteRule /tms-signup(.*) /tms-signup.cgi$1 [L]
-RewriteRule /upload(.*) /upload.cgi$1 [L]
+RewriteRule ^/ajax(.*) /ajax.cgi$1 [L]
+RewriteRule ^/alert(.*) /alert.cgi$1 [L]
+RewriteRule ^/confirm(.*) /confirm.cgi$1 [L]
+RewriteRule ^/contact(.*) /contact.cgi$1 [L]
+RewriteRule ^/flickr(.*) /flickr.cgi$1 [L]
+RewriteRule ^/fun(.*) /fun.cgi$1 [L]
+RewriteRule ^/$ /index.cgi [L]
+RewriteRule ^/index(.*) /index.cgi$1 [L]
+RewriteRule ^/json(.*) /json.cgi$1 [L]
+RewriteRule ^/photo(.*) /photo.cgi$1 [L]
+RewriteRule ^/questionnaire(.*) /questionnaire.cgi$1 [L]
+RewriteRule ^/reports(.*) /reports.cgi$1 [L]
+RewriteRule ^/rss(.*) /rss.cgi$1 [L]
+RewriteRule ^/test(.*) /test.cgi$1 [L]
+RewriteRule ^/tms-signup(.*) /tms-signup.cgi$1 [L]
+RewriteRule ^/upload(.*) /upload.cgi$1 [L]
# trap anything that reaches us here and send it to the Catalyst app - this is
# so that we can gradually move functionality into the app without having to
# touch the existing code.
-RewriteRule ^(.*)$ /fixmystreet_app_cgi.cgi [L]
+RewriteRule ^(.*)$ /fixmystreet_app_cgi.cgi$1 [L]
diff --git a/notes/INSTALL-catalyst.txt b/notes/INSTALL-catalyst.txt
index 3d89d48c8..c3dfd0256 100644
--- a/notes/INSTALL-catalyst.txt
+++ b/notes/INSTALL-catalyst.txt
@@ -102,6 +102,6 @@ Run all the tests using:
or a specific test in verbose mode using:
- prove -lv t/app/controller/reports_new.t
+ prove -lv t/app/controller/report_new.t
For all the lovely options do 'prove --help'. Note I've made no attempt to make the tests be able to run in parallel, the database fiddling would not be worth it. \ No newline at end of file
diff --git a/notes/catalyst-master-merge-todos.txt b/notes/catalyst-master-merge-todos.txt
index 5f87cbc5a..273e0c3cc 100644
--- a/notes/catalyst-master-merge-todos.txt
+++ b/notes/catalyst-master-merge-todos.txt
@@ -1,7 +1,3 @@
-fix reports/123 to report/123
-
-test creation of partial reports
-
scan through code for all fixmes
make email sending respect STAGING
@@ -12,3 +8,5 @@ should we ditch flickr import? (does not seem to be getting huge usage and those
add js to maps
+add 'remember me on this computer' to auth login. What should default session lifetime be?
+
diff --git a/perllib/FixMyStreet/App/Controller/Reports/New.pm b/perllib/FixMyStreet/App/Controller/Report/New.pm
index 3f0b949a6..ffdd44f9d 100644
--- a/perllib/FixMyStreet/App/Controller/Reports/New.pm
+++ b/perllib/FixMyStreet/App/Controller/Report/New.pm
@@ -1,4 +1,4 @@
-package FixMyStreet::App::Controller::Reports::New;
+package FixMyStreet::App::Controller::Report::New;
use Moose;
use namespace::autoclean;
@@ -16,7 +16,7 @@ use mySociety::EmailUtil;
=head1 NAME
-FixMyStreet::App::Controller::Reports::New
+FixMyStreet::App::Controller::Report::New
=head1 DESCRIPTION
@@ -88,7 +88,7 @@ sub report_new : Path : Args(0) {
&& $c->forward('load_councils');
# create a problem from the submitted details
- $c->stash->{template} = "reports/new/fill_in_details.html";
+ $c->stash->{template} = "report/new/fill_in_details.html";
$c->forward('setup_categories_and_councils');
$c->forward('generate_map');
@@ -1129,7 +1129,7 @@ sub redirect_or_confirm_creation : Private {
# If confirmed send the user straigh there.
if ( $report->confirmed ) {
- my $report_uri = $c->uri_for( '/reports', $report->id );
+ my $report_uri = $c->uri_for( '/report', $report->id );
$c->res->redirect($report_uri);
$c->detach;
}
diff --git a/perllib/FixMyStreet/App/Controller/Tokens.pm b/perllib/FixMyStreet/App/Controller/Tokens.pm
index 9a719a59d..1d64d9e18 100644
--- a/perllib/FixMyStreet/App/Controller/Tokens.pm
+++ b/perllib/FixMyStreet/App/Controller/Tokens.pm
@@ -79,7 +79,7 @@ Redirect user to continue filling in a partial problem.
sub redirect_to_partial_problem : Path('/L') {
my ( $self, $c, $token_code ) = @_;
- my $url = $c->uri_for( "/reports/new", { partial => $token_code } );
+ my $url = $c->uri_for( "/report/new", { partial => $token_code } );
return $c->res->redirect( $url );
}
diff --git a/perllib/FixMyStreet/Map.pm b/perllib/FixMyStreet/Map.pm
index 64cc38a2e..edb4fedc9 100644
--- a/perllib/FixMyStreet/Map.pm
+++ b/perllib/FixMyStreet/Map.pm
@@ -38,7 +38,7 @@ sub header {
my $cobrand = Page::get_cobrand($q);
my $cobrand_form_elements =
Cobrand::form_elements( $cobrand, 'mapForm', $q );
- my $form_action = Cobrand::url( $cobrand, '/reports/new', $q );
+ my $form_action = Cobrand::url( $cobrand, '/report/new', $q );
my $encoding = '';
$encoding = ' enctype="multipart/form-data"' if $type == 2;
my $pc = $q->param('pc') || '';
diff --git a/t/app/controller/reports_import.t b/t/app/controller/report_import.t
index 5c16324d3..5c16324d3 100644
--- a/t/app/controller/reports_import.t
+++ b/t/app/controller/report_import.t
diff --git a/t/app/controller/reports_new.t b/t/app/controller/report_new.t
index c87571a9d..5221a601a 100644
--- a/t/app/controller/reports_new.t
+++ b/t/app/controller/report_new.t
@@ -6,10 +6,10 @@ use FixMyStreet::TestMech;
use Web::Scraper;
my $mech = FixMyStreet::TestMech->new;
-$mech->get_ok('/reports/new');
+$mech->get_ok('/report/new');
# TODO: {
-# local $TODO = "paths to '/reports/new' not handled by catalyst yet";
+# local $TODO = "paths to '/report/new' not handled by catalyst yet";
# fail "Test that clicking on map sends user here";
# fail "Test that clicking on 'skip map' link sends user here";
# fail
@@ -50,7 +50,7 @@ foreach my $test (
)
{
subtest "test bad pc value '$test->{pc}'" => sub {
- $mech->get_ok('/reports/new');
+ $mech->get_ok('/report/new');
$mech->submit_form_ok( { with_fields => { pc => $test->{pc} } },
"bad location" );
is_deeply $mech->form_errors, $test->{errors},
@@ -80,7 +80,7 @@ foreach my $test (
)
{
subtest "check lat/lng for '$test->{pc}'" => sub {
- $mech->get_ok('/reports/new');
+ $mech->get_ok('/report/new');
$mech->submit_form_ok( { with_fields => { pc => $test->{pc} } },
"good location" );
is_deeply $mech->form_errors, [], "no errors for pc '$test->{pc}'";
@@ -279,7 +279,7 @@ foreach my $test (
)
{
subtest "check form errors where $test->{msg}" => sub {
- $mech->get_ok('/reports/new');
+ $mech->get_ok('/report/new');
# submit initial pc form
$mech->submit_form_ok( { with_fields => { pc => $test->{pc} } },
@@ -313,7 +313,7 @@ subtest "test report creation for a user who does not have an account" => sub {
"test user does not exist";
# submit initial pc form
- $mech->get_ok('/reports/new');
+ $mech->get_ok('/report/new');
$mech->submit_form_ok( { with_fields => { pc => 'SW1A 1AA', } },
"submit location" );
$mech->submit_form_ok(
@@ -345,7 +345,7 @@ subtest "test report creation for a user who does not have an account" => sub {
# check that the report is not available yet.
is $report->state, 'unconfirmed', "report not confirmed";
- is $mech->get( '/reports/' . $report->id )->code, 404, "report not found";
+ is $mech->get( '/report/' . $report->id )->code, 404, "report not found";
# receive token
my $email = $mech->get_email;
@@ -362,8 +362,8 @@ subtest "test report creation for a user who does not have an account" => sub {
is $report->state, 'confirmed', "report is now confirmed";
TODO: {
- local $TODO = "'/reports/<<id>>' not handled by catalyst yet";
- $mech->get_ok( '/reports/' . $report->id );
+ local $TODO = "'/report/<<id>>' not handled by catalyst yet";
+ $mech->get_ok( '/report/' . $report->id );
}
# user is created and logged in
@@ -390,13 +390,13 @@ subtest "test report creation for a user who is logged in" => sub {
my $user = $mech->log_in_ok($test_email);
# submit initial pc form
- $mech->get_ok('/reports/new');
+ $mech->get_ok('/report/new');
$mech->submit_form_ok( { with_fields => { pc => 'SW1A 1AA', } },
"submit location" );
TODO: {
local $TODO =
-"'/reports/<<id>>' not handled by catalyst yet - form creation redirects to there on success if logged in";
+"'/report/<<id>>' not handled by catalyst yet - form creation redirects to there on success if logged in";
eval {
$mech->submit_form_ok(
{
@@ -419,8 +419,8 @@ subtest "test report creation for a user who is logged in" => sub {
my $report = $user->problems->first;
ok $report, "Found the report";
- # check that we got redirected to /reports/
- is $mech->uri->path, "/reports/" . $report->id, "redirected to report page";
+ # check that we got redirected to /report/
+ is $mech->uri->path, "/report/" . $report->id, "redirected to report page";
# check that no emails have been sent
$mech->email_count_is(0);
@@ -428,8 +428,8 @@ subtest "test report creation for a user who is logged in" => sub {
# check report is confirmed and available
is $report->state, 'confirmed', "report is now confirmed";
TODO: {
- local $TODO = "'/reports/<<id>>' not handled by catalyst yet";
- $mech->get_ok( '/reports/' . $report->id );
+ local $TODO = "'/report/<<id>>' not handled by catalyst yet";
+ $mech->get_ok( '/report/' . $report->id );
}
# user is still logged in
diff --git a/templates/web/default/reports/new/all_councils_text.html b/templates/web/default/report/new/all_councils_text.html
index 2cd90b213..2cd90b213 100644
--- a/templates/web/default/reports/new/all_councils_text.html
+++ b/templates/web/default/report/new/all_councils_text.html
diff --git a/templates/web/default/reports/new/fill_in_details.html b/templates/web/default/report/new/fill_in_details.html
index b58d0b827..a11e5a08e 100644
--- a/templates/web/default/reports/new/fill_in_details.html
+++ b/templates/web/default/report/new/fill_in_details.html
@@ -11,18 +11,18 @@
%]
[% IF area_ids_to_list.size == 0 %]
- [% INCLUDE 'reports/new/no_councils_text.html' %]
+ [% INCLUDE 'report/new/no_councils_text.html' %]
[% ELSIF area_ids_to_list.size == all_councils.size %]
- [% INCLUDE 'reports/new/all_councils_text.html' %]
+ [% INCLUDE 'report/new/all_councils_text.html' %]
[% ELSE %]
- [% INCLUDE 'reports/new/some_councils_text.html' %]
+ [% INCLUDE 'report/new/some_councils_text.html' %]
[% END %]
[% IF skipped %]
[% loc('Please fill in the form below with details of the problem, and describe the location as precisely as possible in the details box.') %]
[% ELSE %]
- [% INCLUDE 'reports/new/fill_in_details_text.html' %]
+ [% INCLUDE 'report/new/fill_in_details_text.html' %]
[% END %]
<input type="hidden" name="latitude" value="[% latitude | html %]">
@@ -36,7 +36,7 @@
<div id="problem_form">
-[% INCLUDE 'reports/new/form_heading.html' %]
+[% INCLUDE 'report/new/form_heading.html' %]
<div id="fieldset">
@@ -136,7 +136,7 @@
<small>[% loc('(optional)') %]</small>
</div>
-[% INCLUDE 'reports/new/notes.html' %]
+[% INCLUDE 'report/new/notes.html' %]
[% IF partial_token %]
<input type="hidden" name="partial" value="[% partial_token.token %]">
diff --git a/templates/web/default/reports/new/fill_in_details_text.html b/templates/web/default/report/new/fill_in_details_text.html
index 44c60ed6e..44c60ed6e 100644
--- a/templates/web/default/reports/new/fill_in_details_text.html
+++ b/templates/web/default/report/new/fill_in_details_text.html
diff --git a/templates/web/default/reports/new/form_heading.html b/templates/web/default/report/new/form_heading.html
index e69de29bb..e69de29bb 100644
--- a/templates/web/default/reports/new/form_heading.html
+++ b/templates/web/default/report/new/form_heading.html
diff --git a/templates/web/default/reports/new/no_councils_text.html b/templates/web/default/report/new/no_councils_text.html
index c3dade610..c3dade610 100644
--- a/templates/web/default/reports/new/no_councils_text.html
+++ b/templates/web/default/report/new/no_councils_text.html
diff --git a/templates/web/default/reports/new/notes.html b/templates/web/default/report/new/notes.html
index 44d1b5d83..44d1b5d83 100644
--- a/templates/web/default/reports/new/notes.html
+++ b/templates/web/default/report/new/notes.html
diff --git a/templates/web/default/reports/new/report_import.html b/templates/web/default/report/new/report_import.html
index 7aa105afe..7aa105afe 100644
--- a/templates/web/default/reports/new/report_import.html
+++ b/templates/web/default/report/new/report_import.html
diff --git a/templates/web/default/reports/new/report_new.html b/templates/web/default/report/new/report_new.html
index 14d68b029..7a7b9bdaf 100644
--- a/templates/web/default/reports/new/report_new.html
+++ b/templates/web/default/report/new/report_new.html
@@ -19,7 +19,7 @@
Please select where to create this report:
[% END %]
-<form action="/reports/new" method="POST">
+<form action="/report/new" method="POST">
[% IF pc_error %]
<div class='form-error'>[% pc_error %]</div>
diff --git a/templates/web/default/reports/new/some_councils_text.html b/templates/web/default/report/new/some_councils_text.html
index 7de7c3f45..7de7c3f45 100644
--- a/templates/web/default/reports/new/some_councils_text.html
+++ b/templates/web/default/report/new/some_councils_text.html
diff --git a/templates/web/emptyhomes/reports/new/all_councils_text.html b/templates/web/emptyhomes/report/new/all_councils_text.html
index 8bdad1c1f..8bdad1c1f 100644
--- a/templates/web/emptyhomes/reports/new/all_councils_text.html
+++ b/templates/web/emptyhomes/report/new/all_councils_text.html
diff --git a/templates/web/emptyhomes/reports/new/fill_in_details_text.html b/templates/web/emptyhomes/report/new/fill_in_details_text.html
index b557a9942..b557a9942 100644
--- a/templates/web/emptyhomes/reports/new/fill_in_details_text.html
+++ b/templates/web/emptyhomes/report/new/fill_in_details_text.html
diff --git a/templates/web/emptyhomes/reports/new/form_heading.html b/templates/web/emptyhomes/report/new/form_heading.html
index 911804a58..911804a58 100644
--- a/templates/web/emptyhomes/reports/new/form_heading.html
+++ b/templates/web/emptyhomes/report/new/form_heading.html
diff --git a/templates/web/emptyhomes/reports/new/no_councils_text.html b/templates/web/emptyhomes/report/new/no_councils_text.html
index 7edb75852..7edb75852 100644
--- a/templates/web/emptyhomes/reports/new/no_councils_text.html
+++ b/templates/web/emptyhomes/report/new/no_councils_text.html
diff --git a/templates/web/emptyhomes/reports/new/notes.html b/templates/web/emptyhomes/report/new/notes.html
index d355cc1ba..d355cc1ba 100644
--- a/templates/web/emptyhomes/reports/new/notes.html
+++ b/templates/web/emptyhomes/report/new/notes.html
diff --git a/templates/web/emptyhomes/tokens/confirm_problem.html b/templates/web/emptyhomes/tokens/confirm_problem.html
index 501f9234a..c4d246430 100644
--- a/templates/web/emptyhomes/tokens/confirm_problem.html
+++ b/templates/web/emptyhomes/tokens/confirm_problem.html
@@ -33,7 +33,7 @@
[% END %]
<p>
- <a href="[% c.uri_for( '/reports', problem.id ) | html %]">[% loc('View your report') %]</a>.
+ <a href="[% c.uri_for( '/report', problem.id ) | html %]">[% loc('View your report') %]</a>.
</p>
[% INCLUDE 'footer.html' %]
diff --git a/web/index.cgi b/web/index.cgi
index d9e781682..6c7a2f86d 100755
--- a/web/index.cgi
+++ b/web/index.cgi
@@ -938,7 +938,7 @@ sub display_location {
my $url_skip = NewURL(
$q,
- -url => '/reports/new',
+ -url => '/report/new',
-retain => 1,
x => undef,
y => undef,