diff options
Diffstat (limited to 'web')
-rwxr-xr-x | web/about.cgi | 52 | ||||
-rwxr-xr-x | web/confirm.cgi | 68 | ||||
-rw-r--r-- | web/css/core.css | 2 | ||||
-rwxr-xr-x | web/fixmystreet_app_cgi.cgi | 35 | ||||
-rwxr-xr-x | web/fixmystreet_app_fastcgi.cgi | 53 | ||||
-rwxr-xr-x | web/index.cgi | 15 | ||||
-rw-r--r-- | web/xsl.xsl | 2 |
7 files changed, 102 insertions, 125 deletions
diff --git a/web/about.cgi b/web/about.cgi deleted file mode 100755 index 6b0347ecf..000000000 --- a/web/about.cgi +++ /dev/null @@ -1,52 +0,0 @@ -#!/usr/bin/perl -w -I../perllib - -# about.cgi: -# For EHA -# -# Copyright (c) 2008 UK Citizens Online Democracy. All rights reserved. -# Email: matthew@mysociety.org. WWW: http://www.mysociety.org -# -# $Id: about.cgi,v 1.10 2009-08-03 10:45:28 matthew Exp $ - -use strict; -use Standard -db; - -my $lastmodified = (stat $0)[9]; - -# Main code for index.cgi -sub main { - my $q = shift; - print Page::header($q, title=>_('About us')); - if ($q->{site} eq 'emptyhomes') { - print $q->h1(_('About us')); - print '<div style="float: left; width: 48%;">'; - print _(<<ABOUTUS); -<h2>The Empty Homes Agency</h2> -<p>The Empty Homes agency is an independent campaigning charity. We are not -part of government, and have no formal links with local councils although we -work in cooperation with both. We exist to highlight the waste of empty -property and work with others to devise and promote sustainable solutions to -bring empty property back into use. We are based in London but work across -England. We also work in partnership with other charities across the UK.</p> -ABOUTUS - print '</div> <div style="float: right; width:48%;">'; - print _(<<ABOUTUS); -<h2>Shelter Cymru</h2> -Shelter Cymru is Wales’ people and homes charity and wants everyone in Wales to -have a decent home. We believe a home is a fundamental right and essential to -the health and well-being of people and communities. We work for people in -housing need. We have offices all over Wales and prevent people from losing -their homes by offering free, confidential and independent advice. When -necessary we constructively challenge on behalf of people to ensure they are -properly assisted and to improve practice and learning. We believe that -bringing empty homes back into use can make a significant contribution to the -supply of affordable homes in Wales. -<a href="http://www.sheltercymru.org.uk/shelter/advice/pdetail.asp?cat=20">Further information about our work on -empty homes</a>. -ABOUTUS - print '</div>'; - } - print Page::footer($q); -} -Page::do_fastcgi(\&main, $lastmodified); - diff --git a/web/confirm.cgi b/web/confirm.cgi index c4a37c67f..cb9f5d4c8 100755 --- a/web/confirm.cgi +++ b/web/confirm.cgi @@ -27,8 +27,6 @@ sub main { if ($data) { if ($type eq 'update') { $out = confirm_update($q, $data); - } elsif ($type eq 'problem') { - $out = confirm_problem($q, $data); } elsif ($type eq 'questionnaire') { $out = add_questionnaire($q, $data, $token); } @@ -120,72 +118,6 @@ sub confirm_update { return $out; } -sub confirm_problem { - my ($q, $id) = @_; - my $cobrand = Page::get_cobrand($q); - my ($council, $email, $name, $cobrand_data) = dbh()->selectrow_array("select council, email, name, cobrand_data from problem where id=?", {}, $id); - - (my $domain = $email) =~ s/^.*\@//; - if (dbh()->selectrow_array('select email from abuse where lower(email)=? or lower(email)=?', {}, lc($email), lc($domain))) { - dbh()->do("update problem set state='hidden', lastupdate=ms_current_timestamp() where id=?", {}, $id); - return $q->p(_('Sorry, there has been an error confirming your problem.')); - } else { - dbh()->do("update problem set state='confirmed', confirmed=ms_current_timestamp(), lastupdate=ms_current_timestamp() - where id=? and state='unconfirmed'", {}, $id); - } - my $out; - if ($q->{site} eq 'emptyhomes') { - if ($council) { - $out = $q->p(_('Thank you for reporting an empty property on -ReportEmptyHomes.com. We have emailed the lead officer for empty homes in the council -responsible with details, and asked them to do whatever they can to get the -empty property back into use as soon as possible.')) . -$q->p(_('It is worth noting however that the process can sometimes be slow, -especially if the property is in very poor repair or the owner is unwilling to -act. In most cases it can take six months or more before you can expect to see -anything change and sometimes there may be considerable barries to a property -being brought back into use. This doesn’t mean the council isn’t -doing anything. We encourage councils to update the website so you can -see what is happening. It may be a long process, but you reporting your -concerns about this property to the council is a valuable first step.')) . -$q->p(_('We may contact you periodically to ask if anything has changed -with the property you reported.')) . -$q->p(_('Thank you for using ReportEmptyHomes.com. Your action is already helping -to resolve the UK’s empty homes crisis.')) . -$q->p('<a href="/report/' . $id . '">' . _('View your report') . '</a>.'); - } else { - $out = $q->p(_('Thank you for reporting this empty property on ReportEmptyHomes.com. -At present the report cannot be sent through to the council for this area. We -are working with councils to link them into the system so that as many areas -as possible will be covered.')) . -$q->p('<a href="/report/' . $id . '">' . _('View your report') . '</a>.'); - } - } else { - my $report_url = Cobrand::url($cobrand, "/report/$id", $q); - $out = $q->p({class => 'confirmed'}, - _('You have successfully confirmed your problem') - . ($council ? _(' and <strong>we will now send it to the council</strong>') : '') - . sprintf(_('. You can <a href="%s">view the problem on this site</a>.'), $report_url) - ); - my $display_advert = Cobrand::allow_crosssell_adverts($cobrand); - if ($display_advert) { - $out .= CrossSell::display_advert($q, $email, $name); - } - my %vars = ( - url_report => $report_url, - url_home => Cobrand::url($cobrand, '/', $q), - ); - my $cobrand_page = Page::template_include('confirmed-problem', $q, Page::template_root($q), %vars); - $out = $cobrand_page if $cobrand_page; - } - - # Subscribe problem reporter to email updates - my $alert_id = FixMyStreet::Alert::create($email, 'new_updates', $cobrand, $cobrand_data, $id); - FixMyStreet::Alert::confirm($alert_id); - - return $out; -} - sub ask_questionnaire { my ($token, $q) = @_; my $cobrand = Page::get_cobrand($q); diff --git a/web/css/core.css b/web/css/core.css index b31e6bc0a..5b64d67b9 100644 --- a/web/css/core.css +++ b/web/css/core.css @@ -1,3 +1,4 @@ + #mysociety blockquote { border-left: solid 4px #666666; padding-left: 0.5em; @@ -349,6 +350,7 @@ } #mysociety #alert_photos h2 { font-size: 100%; + } #mysociety #alert_photos img { margin-bottom: 0.25em; diff --git a/web/fixmystreet_app_cgi.cgi b/web/fixmystreet_app_cgi.cgi new file mode 100755 index 000000000..7d60ce673 --- /dev/null +++ b/web/fixmystreet_app_cgi.cgi @@ -0,0 +1,35 @@ +#!/usr/bin/env perl + +BEGIN { # set all the paths to the perl code + use FindBin; + require "$FindBin::Bin/../setenv.pl"; +} + +use Catalyst::ScriptRunner; +Catalyst::ScriptRunner->run( 'FixMyStreet::App', 'CGI' ); + +1; + +=head1 NAME + +fixmystreet_app_cgi.pl - Catalyst CGI + +=head1 SYNOPSIS + +See L<Catalyst::Manual> + +=head1 DESCRIPTION + +Run a Catalyst application as a cgi script. + +=head1 AUTHORS + +Catalyst Contributors, see Catalyst.pm + +=head1 COPYRIGHT + +This library is free software. You can redistribute it and/or modify +it under the same terms as Perl itself. + +=cut + diff --git a/web/fixmystreet_app_fastcgi.cgi b/web/fixmystreet_app_fastcgi.cgi new file mode 100755 index 000000000..1059cbd34 --- /dev/null +++ b/web/fixmystreet_app_fastcgi.cgi @@ -0,0 +1,53 @@ +#!/usr/bin/env perl + +BEGIN { # set all the paths to the perl code + use FindBin; + require "$FindBin::Bin/../setenv.pl"; +} + +use Catalyst::ScriptRunner; +Catalyst::ScriptRunner->run( 'FixMyStreet::App', 'FastCGI' ); + +1; + +=head1 NAME + +fixmystreet_app_fastcgi.pl - Catalyst FastCGI + +=head1 SYNOPSIS + +fixmystreet_app_fastcgi.pl [options] + + Options: + -? -help display this help and exits + -l --listen Socket path to listen on + (defaults to standard input) + can be HOST:PORT, :PORT or a + filesystem path + -n --nproc specify number of processes to keep + to serve requests (defaults to 1, + requires -listen) + -p --pidfile specify filename for pid file + (requires -listen) + -d --daemon daemonize (requires -listen) + -M --manager specify alternate process manager + (FCGI::ProcManager sub-class) + or empty string to disable + -e --keeperr send error messages to STDOUT, not + to the webserver + --proc_title Set the process title (is possible) + +=head1 DESCRIPTION + +Run a Catalyst application as fastcgi. + +=head1 AUTHORS + +Catalyst Contributors, see Catalyst.pm + +=head1 COPYRIGHT + +This library is free software. You can redistribute it and/or modify +it under the same terms as Perl itself. + +=cut diff --git a/web/index.cgi b/web/index.cgi index 186393f96..14d4177ac 100755 --- a/web/index.cgi +++ b/web/index.cgi @@ -943,11 +943,18 @@ sub display_location { map { Utils::truncate_coordinate($_) } # ( $latitude, $longitude ); - my $url_skip = NewURL($q, -retain=>1, - x => undef, 'y' => undef, - latitude => $short_lat, longitude => $short_lon, - 'submit_map'=>1, skipped=>1 + my $url_skip = NewURL( + $q, + -url => '/report/new', + -retain => 1, + x => undef, + y => undef, + latitude => $short_lat, + longitude => $short_lon, + submit_map => 1, + skipped => 1 ); + my $pc_h = ent($q->param('pc') || ''); my $rss_url; diff --git a/web/xsl.xsl b/web/xsl.xsl index 1aa0eef4b..12a4a93d5 100644 --- a/web/xsl.xsl +++ b/web/xsl.xsl @@ -18,7 +18,7 @@ <h2 class="v">Navigation</h2> <ul id="navigation"> -<li><a href="/">Report a problem</a></li> +<li><a href="/report/new">Report a problem</a></li> <li><a href="/reports">All reports</a></li> <li><a href="/faq">Help</a></li> <li><a href="/contact">Contact</a></li> |