diff options
Diffstat (limited to 'web')
-rw-r--r-- | web/css/emptyhomes.css | 37 | ||||
-rw-r--r-- | web/css/main-scambs.css | 10 | ||||
-rwxr-xr-x | web/faq.cgi | 78 | ||||
-rwxr-xr-x | web/index.cgi | 49 | ||||
-rwxr-xr-x | web/reports.cgi | 22 |
5 files changed, 163 insertions, 33 deletions
diff --git a/web/css/emptyhomes.css b/web/css/emptyhomes.css index 813904b07..d4fa75e06 100644 --- a/web/css/emptyhomes.css +++ b/web/css/emptyhomes.css @@ -6,6 +6,7 @@ p#expl { float: none; } +/* Smaller map */ #map_box { width: 380px; } @@ -13,10 +14,22 @@ p#expl { width: 378px; height: 378px; } +#watermark { + background: url("/i/mojwatermark-378.png"); + height: 84px; + width: 171px; + position: absolute; + bottom: 0; + right: 0; +} #toptitle { margin-top: 0.5em; } + +#left { + width: auto; +} #middle { width: 600px; } @@ -51,6 +64,7 @@ p#fixed, p#unknown { margin: 0.5em 0 0.25em; } +/* So IE and Firefox match */ #left ol { padding: 0; } @@ -72,7 +86,6 @@ blockquote { _width: 500px; } - #front_stats div { padding: 0.5em 0; width: 6em; @@ -82,13 +95,21 @@ blockquote { clear: both; } -#watermark { - background: url("/i/mojwatermark-378.png"); - height: 84px; - width: 171px; - position: absolute; - bottom: 0; - right: 0; +/* Slightly narrower so it fits */ +#col_problems, #col_fixed { + width: 45%; } +/* Sub nav for the internal bits */ +#left ol ul { + font-size: 90%; +} +#left ol ul a { + padding: 4px 0 4px 20px; + background-color: #ffffff; +} +#left ol ul a:hover { + background-color: #B1BECF; + background-color: #DCDCED; +} diff --git a/web/css/main-scambs.css b/web/css/main-scambs.css index a8fb0a548..57f4a0b4b 100644 --- a/web/css/main-scambs.css +++ b/web/css/main-scambs.css @@ -17,6 +17,7 @@ blockquote { width: 7em; } +/* Smaller map */ #map_box { width: 380px; } @@ -24,4 +25,13 @@ blockquote { width: 378px; height: 378px; } +#watermark { + display: none; + background: url("/i/mojwatermark-378.png"); + height: 84px; + width: 171px; + position: absolute; + bottom: 0; + right: 0; +} diff --git a/web/faq.cgi b/web/faq.cgi index 928c49834..4e3ce614e 100755 --- a/web/faq.cgi +++ b/web/faq.cgi @@ -6,7 +6,7 @@ # Copyright (c) 2006 UK Citizens Online Democracy. All rights reserved. # Email: matthew@mysociety.org. WWW: http://www.mysociety.org # -# $Id: faq.cgi,v 1.30 2008-05-13 12:39:17 matthew Exp $ +# $Id: faq.cgi,v 1.31 2008-05-15 16:09:52 matthew Exp $ use strict; use Standard -db; @@ -15,7 +15,11 @@ use Standard -db; sub main { my $q = shift; print Page::header($q, title=>_('FAQ')); - print faq($q); + if ($q->{site} eq 'emptyhomes') { + print emptyhomes_faq($q); + } else { + print faq($q); + } print Page::footer($q); } Page::do_fastcgi(\&main); @@ -130,3 +134,73 @@ Let us know if we’ve missed anyone.')) return $out; } +sub emptyhomes_faq { + my $q = shift; + my $out = $q->h1('Frequently Asked Questions'); + $out .= $q->dl( + $q->dt('What is this site for?'), + $q->dd('This site is to help provide a public record of +empty properties in Great Britain. It expands upon our telephone hotline +for empty homes in the London area, and allows local authorities, related +organisations and the public to view reported empty homes and update +their status, and report new empty properties.'), + $q->dt(_('How do I use the site?')), + $q->dd(_('After entering a postcode or location, you are presented +with a map of that area. You can view problems already reported in that area, +or report ones of your own simply by clicking on the map at the location of +the problem.')), + $q->dt('Is it free?'), + $q->dd('The site is free to use, yes. The Empty Homes Agency is +a registered charity, though, so if you want to make a contribution, +please do.'), + $q->dt(_('Do you remove silly or illegal content?')), + $q->dd(_('We reserve the right to remove any reports or updates +which we consider to be inappropriate.')), + ); + $out .= $q->h2(_('Privacy Questions')); + $out .= $q->dl( + $q->dt('Who gets to see my email address?'), + $q->dd('If you submit an empty property, your details are obviously provided to us. +Your name is displayed upon the site if you let us, but not your email address; +similarly with updates. We will never give or sell your email address to +anyone else, unless we are obliged to by law.'), + $q->dt('Will you send nasty, brutish spam to my email address?'), + $q->dd('Never. We\'ll only ever send you emails in relation to your +problem. You can opt in to receive emails about updates to a particular +problem.') + ); + $out .= $q->h2(_('Organisation Questions')); + $out .= $q->dl( + $q->dt('Who built this site?'), + $q->dd('This site was built by <a href="http://www.mysociety.org/">mySociety</a>. +mySociety is the project of a registered charity which has grown out of the community of +volunteers who built sites like <a href="http://www.theyworkforyou.com/">TheyWorkForYou</a>. +mySociety’s primary mission is to build Internet projects which give people simple, tangible +benefits in the civic and community aspects of their lives. Our first project +was <a href="http://www.writetothem.com/">WriteToThem</a>, where you can write to any of your +elected representatives, for free. +<a href="https://secure.mysociety.org/donate/">Donate to mySociety</a>'), + $q->dt(_('Where’s the "source code" to this site?')), + $q->dd(_('The software behind this site is open source, and available +to you mainly under the GNU Affero GPL software license. You can <a +href="https://secure.mysociety.org/cvstrac/dir?d=mysociety">download the +source code</a> (look under ‘bci’) and help us develop it. +You’re welcome to use it in your own projects, although you must also +make available the source code to any such projects.')), + $q->dt(_('People build things, not organisations. Who <em>actually</em> built it?')), + $q->dd(_('This adaptation of FixMyStreet was written by Matthew Somerville. +Thanks go to +<a href="http://www.ordnancesurvey.co.uk">Ordnance Survey</a> (for the maps, +UK postcodes, and UK addresses – data © Crown copyright, all +rights reserved, Ministry of Justice 100037819 2008), +Yahoo! for their BSD-licensed JavaScript libraries, the entire free software +community (this particular project was brought to you by Perl, PostgreSQL, +and the number 161.290) and <a +href="http://www.easynet.net/publicsector/">Easynet</a> (who kindly host all +our servers). + +Let us know if we’ve missed anyone.')) + ); + return $out; +} + diff --git a/web/index.cgi b/web/index.cgi index bc72d8797..ceb65df57 100755 --- a/web/index.cgi +++ b/web/index.cgi @@ -6,7 +6,7 @@ # Copyright (c) 2006 UK Citizens Online Democracy. All rights reserved. # Email: matthew@mysociety.org. WWW: http://www.mysociety.org # -# $Id: index.cgi,v 1.196 2008-05-15 09:26:56 matthew Exp $ +# $Id: index.cgi,v 1.197 2008-05-15 16:09:52 matthew Exp $ use strict; use Standard; @@ -76,6 +76,7 @@ sub front_page { my $pc_h = ent($q->param('pc') || ''); my $out = '<p id="expl"><strong>' . _('Report, view, or discuss local problems') . '</strong>'; my $subhead = _('(like graffiti, fly tipping, broken paving slabs, or street lighting)'); + $subhead = '(like graffiti, fly tipping, or neighbourhood noise)' if $q->{site} eq 'scambs'; $out .= '<br><small>' . $subhead . '</small>' if $subhead ne ' '; $out .= '</p>'; $out .= '<p id="error">' . $error . '</p>' if ($error); @@ -116,18 +117,22 @@ EOF <div id="front_intro"> EOF $out .= $q->h2(_('How to report a problem')); + my $step4 = $q->li(_('We send it to the council on your behalf')); + $step4 = '' if $q->{site} eq 'emptyhomes'; + $step4 = $q->li('The council receives your report and acts upon it') + if $q->{site} eq 'scambs'; $out .= $q->ol( $q->li(_('Enter a nearby UK postcode, or street name and area')), $q->li(_('Locate the problem on a map of the area')), $q->li(_('Enter details of the problem')), - ($q->{site} ne 'emptyhomes' && $q->li(_('We send it to the council on your behalf'))) + $step4 ); $out .= $q->h2(_('FixMyStreet updates')); $out .= $q->div({-id => 'front_stats'}, - $q->div("<big>$new</big> reports $new_text"), + $q->div("<big>$new</big> report" . ($new!=1?'s':''), $new_text), ($q->{site} ne 'emptyhomes' && $q->div("<big>$fixed</big> fixed in past month")), - $q->div("<big>$updates</big> updates on reports"), + $q->div("<big>$updates</big> update" . ($updates!=1?'s':''), "on reports"), ); $out .= <<EOF; @@ -341,13 +346,13 @@ sub submit_problem { $id = dbh()->selectrow_array("select nextval('problem_id_seq');"); Page::workaround_pg_bytea("insert into problem (id, postcode, easting, northing, title, detail, name, - email, phone, photo, state, council, used_map, anonymous, category, areas) + email, phone, photo, state, council, used_map, anonymous, category, areas, send_questionnaire) values - (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 'unconfirmed', ?, ?, ?, ?, ?)", 10, + (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 'unconfirmed', ?, ?, ?, ?, ?, ?)", 10, $id, $input{pc}, $input{easting}, $input{northing}, $input{title}, $input{detail}, $input{name}, $input{email}, $input{phone}, $image, $input{council}, $used_map, $input{anonymous} ? 'f': 't', $input{category}, - $areas); + $areas, $q->{site} eq 'emptyhomes' ? 'f' : 't'); my %h = (); $h{title} = $input{title}; $h{detail} = $input{detail}; @@ -422,11 +427,9 @@ sub display_form { my $all_councils = mySociety::MaPit::get_voting_areas_by_location( { easting => $easting, northing => $northing }, 'polygon', $mySociety::VotingArea::council_parent_types); + if ($q->{site} eq 'scambs') { - #delete $all_councils->{2218}; - #@categories = ('Abandoned vehicles', 'Discarded hypodermic needles', - #'Dog fouling', 'Flytipping', 'Graffiti', 'Lighting (e.g. security lights)', - #'Litter', 'Neighbourhood noise'); + delete $all_councils->{2218}; } $all_councils = [ keys %$all_councils ]; return display_location($q, _('That spot does not appear to be covered by a council - if it is past the shoreline, for example, please specify the closest point on land.')) unless @$all_councils; @@ -445,6 +448,11 @@ sub display_form { next if $_->{category} eq _('Other'); push @categories, $_->{category}; } + if ($q->{site} eq 'scambs') { + @categories = ('Abandoned vehicles', 'Discarded hypodermic needles', + 'Dog fouling', 'Flytipping', 'Graffiti', 'Lighting (e.g. security lights)', + 'Litter', 'Neighbourhood noise'); + } if (@categories) { @categories = ('-- Pick a category --', @categories, _('Other')); $category = $q->div($q->label({'for'=>'form_category'}, _('Category:')), @@ -524,6 +532,11 @@ problems for $list and emailing it to us at <a href='mailto:$e'>$e</a>."; if ($input{skipped}) { $out .= $q->p(_('Please fill in the form below with details of the problem, and describe the location as precisely as possible in the details box.')); + } elsif ($q->{site} eq 'scambs') { + $out .= '<p>Please fill in details of the problem below. We won\'t be able +to help unless you leave as much detail as you can, so please describe the exact location of +the problem (e.g. on a wall), what it is, how long it has been there, a description (and a +photo of the problem if you have one), etc.'; } elsif ($details ne 'none') { $out .= '<p>Please fill in details of the problem below. The council won\'t be able to help unless you leave as much detail as you can, so please describe the exact location of @@ -593,7 +606,18 @@ EOF <input type="text" value="$input_h{phone}" name="phone" id="form_phone" size="15"> <small>(optional)</small></div> EOF - $out .= <<EOF unless $q->{site} eq 'emptyhomes'; # No notes + if ($q->{site} eq 'scambs') { + $out .= <<EOF; +<p>Please note:</p> +<ul> +<li>Please be polite, concise and to the point. +<li>Please do not be abusive. +<li>Writing your message entirely in block capitals makes it hard to read, +as does a lack of punctuation. +</ul> +EOF + } elsif ($q->{site} ne 'emptyhomes') { + $out .= <<EOF; <p>Please note:</p> <ul> <li>Please be polite, concise and to the point. @@ -606,6 +630,7 @@ submission via this site remember that you can contact your council directly using their own website. </ul> EOF + } $out .= <<EOF; <p align="right"><input type="submit" name="submit_problem" value="Submit"></p> </div> diff --git a/web/reports.cgi b/web/reports.cgi index 05cfd5b3f..4812fb49a 100755 --- a/web/reports.cgi +++ b/web/reports.cgi @@ -7,7 +7,7 @@ # Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved. # Email: matthew@mysociety.org. WWW: http://www.mysociety.org # -# $Id: reports.cgi,v 1.15 2008-05-06 10:01:31 matthew Exp $ +# $Id: reports.cgi,v 1.16 2008-05-15 16:09:52 matthew Exp $ use strict; use Standard; @@ -144,13 +144,13 @@ sub main { my $areas_info = mySociety::MaPit::get_voting_areas_info([keys %councils]); if (!$one_council) { - print Page::header($q, title=>'Summary reports'); + print Page::header($q, title=>_('Summary reports')); print $q->p(_('This is a summary of all reports on this site; select a particular council to see the reports sent there.')); my $c = 0; print '<table cellpadding="3" cellspacing="1" border="0">'; print '<tr><th>Name</th><th>' . _('New problems') . '</th><th>' . _('Older problems') . '</th>'; if ($q->{site} eq 'emptyhomes') { - print '<th>Recently in use</th><th>Old in use</th></tr>'; + print '<th>Recently returned to use</th><th>Older returned to use</th></tr>'; } else { print '<th>Old problems,<br>state unknown</th><th>Recently fixed</th><th>Old fixed</th></tr>'; } @@ -205,22 +205,22 @@ sub main { print "<h2>$name</h2>\n"; if ($open{$one_council}) { print '<div id="col_problems">'; - list_problems(_('New problems'), $open{$one_council}{new}, $all); + list_problems($q, _('New problems'), $open{$one_council}{new}, $all); if ($q->{site} eq 'emptyhomes') { my @old = (); push @old, @{$open{$one_council}{older}} if $open{$one_council}{older}; push @old, @{$open{$one_council}{unknown}} if $open{$one_council}{unknown}; - list_problems('Older empty properties', \@old, $all); + list_problems($q, 'Older empty properties', \@old, $all); } else { - list_problems('Older problems', $open{$one_council}{older}, $all); - list_problems('Old problems, state unknown', $open{$one_council}{unknown}, $all); + list_problems($q, _('Older problems'), $open{$one_council}{older}, $all); + list_problems($q, _('Old problems, state unknown'), $open{$one_council}{unknown}, $all); } print '</div>'; } if ($fixed{$one_council}) { print '<div id="col_fixed">'; - list_problems('Recently fixed', $fixed{$one_council}{new}, $all); - list_problems('Old fixed', $fixed{$one_council}{old}, $all); + list_problems($q, _('Recently fixed'), $fixed{$one_council}{new}, $all); + list_problems($q, _('Old fixed'), $fixed{$one_council}{old}, $all); print '</div>'; } } @@ -251,7 +251,7 @@ sub summary_cell { } sub list_problems { - my ($title, $problems, $all) = @_; + my ($q, $title, $problems, $all) = @_; return unless $problems; print "<h3>$title</h3>\n<ul>"; foreach (@$problems) { @@ -259,7 +259,7 @@ sub list_problems { print ent($_->[1]); print '</a>'; print ' <small>(sent to both)</small>' if $_->[3]>1; - print ' <small>(not sent to council)</small>' if $_->[3]==0; + print ' <small>(not sent to council)</small>' if $_->[3]==0 && $q->{site} ne 'emptyhomes'; print '<br><small>' . ent($_->[2]) . '</small>' if $all; print '</li>'; } |