diff options
author | Struan Donald <struan@exo.org.uk> | 2011-08-03 09:50:05 +0100 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2011-08-03 09:50:05 +0100 |
commit | dbaf8d84b9cd52380a031b801370bb6a0f8e4c22 (patch) | |
tree | d1841a90f8536ca17df49e2b667b4d3a096de31e | |
parent | 9415569a17bf3044c7f3253c923f556436d48942 (diff) | |
parent | 76f39991e1caf89e12e8bb8f49ba0a99df56f3dc (diff) |
Merge branch 'master' of ssh://git.mysociety.org/data/git/public/fixmystreet into open311-consumer
25 files changed, 856 insertions, 63 deletions
diff --git a/bin/export-norwegian-contacts b/bin/export-norwegian-contacts new file mode 100644 index 000000000..8a7d438e5 --- /dev/null +++ b/bin/export-norwegian-contacts @@ -0,0 +1,97 @@ +#!/usr/bin/perl + +# export-norwegian-contacts: +# Export initial contact list from fiksgatami in a format usable by +# load-norwegian-contact. +# +# The format is +# ID;Name;email-address;Category1,Category2,... +# +# Based on script load-contacts copyright (c) 2006 UK Citizens Online +# Democracy and script load-norwegian-contacts copyright (c) 2011 +# Petter Reinholdtsen. +# Copyright 2011 Petter Reinholdtsen. +# +# $Id: load-norwegian-contacts,v 1.0 2007-08-02 11:44:59 matthew Exp $ + +use strict; +use warnings; +require 5.8.0; +use open OUT => ':utf8'; + +# Horrible boilerplate to set up appropriate library paths. +use FindBin; +use lib "$FindBin::Bin/../perllib"; +use lib "$FindBin::Bin/../commonlib/perllib"; + +use mySociety::Config; +use mySociety::DBHandle qw(dbh select_all); +use mySociety::MaPit; + +BEGIN { + mySociety::Config::set_file("$FindBin::Bin/../conf/general"); + mySociety::DBHandle::configure( + Name => mySociety::Config::get('BCI_DB_NAME'), + User => mySociety::Config::get('BCI_DB_USER'), + Password => mySociety::Config::get('BCI_DB_PASS'), + Host => mySociety::Config::get('BCI_DB_HOST', undef), + Port => mySociety::Config::get('BCI_DB_PORT', undef) + ); +} + +my $datafile = shift; + +open(my $fh, '>', $datafile) or die "Unable to write to $datafile"; + +# Categories used by more than half the areas is used as the default +# list. +my $sql = + "SELECT category FROM (SELECT category, COUNT(*) from contacts ". + " WHERE confirmed = 'true' AND deleted = 'false' ". + " GROUP BY category) as c ". + " WHERE count > (SELECT COUNT(*)/2 FROM contacts ". + " WHERE category = 'Annet') ". + " ORDER BY category"; +my $defcategoriesref = dbh()->selectcol_arrayref($sql); +print $fh "0000;default;;", join(',', @{$defcategoriesref}), "\n"; + +my %categorygroup; +$sql = "SELECT area_id, email, category FROM contacts ORDER BY category"; +my $contactref = dbh()->selectall_arrayref($sql, { Slice => {} }); +my @area_ids; +for my $row (@{$contactref}) { + my $key = $row->{area_id} .':'. $row->{email}; + push(@area_ids, $row->{area_id}); + if (exists $categorygroup{$key}) { + push(@{$categorygroup{$key}}, $row->{category}); + } else { + $categorygroup{$key} = [ $row->{category} ]; + } +} + +my $areas_info = mySociety::MaPit::call('areas', \@area_ids); + +my @list; +for my $key (keys %categorygroup) { + my ($area_id, $email) = split(/:/, $key); + my $categoriesref = $categorygroup{$key}; + my $areaname = $areas_info->{$area_id}->{name}; + my $areadigits = ($area_id < 100) ? 2 : 4; + if (identical_lists($defcategoriesref, $categoriesref)) { + push(@list,sprintf("%0${areadigits}d;%s;%s\n", + $area_id, $areaname, $email)); + } else { + push(@list, sprintf("%0${areadigits}d;%s;%s;%s\n", + $area_id, $areaname, $email, + join(',', @{$categoriesref}))); + } +} + +print $fh sort @list; + +sub identical_lists { + my ($a, $b) = @_; + return !(join(',', @{$a}) cmp join(',', @{$b})); +} + +exit 0; diff --git a/bin/showcouncilrates b/bin/showcouncilrates new file mode 100755 index 000000000..9ae5c3e7b --- /dev/null +++ b/bin/showcouncilrates @@ -0,0 +1,73 @@ +#!/usr/bin/perl + +use warnings; +use strict; + +use FindBin; +use lib "$FindBin::Bin/../perllib"; +use lib "$FindBin::Bin/../commonlib/perllib"; + +use POSIX qw(strcoll); +use mySociety::DBHandle qw(dbh); + +use mySociety::MaPit; +use FixMyStreet::Geocode::OSM; + +BEGIN { + mySociety::Config::set_file("$FindBin::Bin/../conf/general"); + mySociety::DBHandle::configure( + Name => mySociety::Config::get('BCI_DB_NAME'), + User => mySociety::Config::get('BCI_DB_USER'), + Password => mySociety::Config::get('BCI_DB_PASS'), + Host => mySociety::Config::get('BCI_DB_HOST', undef), + Port => mySociety::Config::get('BCI_DB_PORT', undef) + ); +} + +my $query = "SELECT council, COUNT(*) AS total, SUM(fixed) AS fixed + FROM (SELECT council, + CASE WHEN state = 'fixed' THEN 1 ELSE 0 END AS fixed + FROM problem WHERE confirmed IS NOT NULL AND + state IN ('fixed', 'confirmed') AND + whensent < NOW() - INTERVAL '4 weeks') AS a + GROUP BY council"; + +my $stats = dbh()->selectall_arrayref($query, { Slice => {} }); + +my @councils; +foreach my $row (@$stats) { + if ($row->{council}) { + $row->{council} =~ s/\|.*//g; + my @council_ids = split(/,/, $row->{council}); + push(@councils, @council_ids); + $row->{council} = \@council_ids; + } +} +my $areas_info = mySociety::MaPit::call('areas', \@councils); +my %adminsum; +my %adminfixed; +foreach my $row (@$stats){ + if ($row->{council}) { + for my $councilid (@{$row->{council}}) { + $adminsum{$councilid} += $row->{total}; + $adminfixed{$councilid} += $row->{fixed}; + } + } +} + +foreach my $councilid (sort sort_councils keys %adminsum) { + my $council = $areas_info->{$councilid}->{name}; + my $total = $adminsum{$councilid}; + my $fixed = $adminfixed{$councilid}; + printf("%5.1f %4d %s (%d)\n", 100 * $fixed / $total, $total, + $council, $councilid); +} + +sub sort_councils { + my $retval = ($adminfixed{$b} / $adminsum{$b}) <=> + ($adminfixed{$a} / $adminsum{$a}); + $retval = $adminsum{$b} <=> $adminsum{$a} unless $retval; + $retval = strcoll($areas_info->{$a}->{name}, + $areas_info->{$b}->{name}) unless $retval; + return $retval; +} diff --git a/commonlib b/commonlib -Subproject b332298ef86c673b48e6f55a73bdb0b8cf640ae +Subproject f2532c104a1268b536f79b13c52bdc0d7fb4d7a diff --git a/data/norway/contact-addresses.csv b/data/norway/contact-addresses.csv index 42fccc33c..05cd2df78 100644 --- a/data/norway/contact-addresses.csv +++ b/data/norway/contact-addresses.csv @@ -1,4 +1,4 @@ -# # i +# # 2010 engelsk kategori Forslag til oversettelse # --------------------------------------------------------------------- # 18k potholes Hull i vei @@ -65,7 +65,7 @@ # ------------------------------------- # Annet # -0000;default;;Hull i vei,Gater/Veier,Gatelys,Fortau/gangstier,Dumpet skrot,Forsøpling,Parkering,Graffiti/tagging,Trafikkskilter,Forlatte kjøretøy,Trær,Veinavn-skilter,Trafikklys,Park/landskap,Ulovlige oppslag,Buss- og togstopp,Offentlige toaletter,Vannforsyning,Snøbrøyting,Sykkelveier,Tette avløpsrister,Oljesøl,Annet +0000;default;;Annet,Buss- og togstopp,Dumpet skrot,Forlatte kjøretøy,Forsøpling,Fortau/gangstier,Gatefeiing,Gatelys,Gater/Veier,Graffiti/tagging,Hull i vei,Offentlige toaletter,Oljesøl,Parkering,Park/landskap,Snøbrøyting,Sykkelveier,Tette avløpsrister,Trafikklys,Trafikkskilter,Trær,Ulovlige oppslag,Universell utforming,Vannforsyning,Veinavn-skilter 0101;Halden;postmottak@halden.kommune.no 0104;Moss;post@moss.kommune.no 0105;Sarpsborg;postmottak@sarpsborg.com @@ -75,13 +75,13 @@ 0119;Marker;post@marker.kommune.no 0121;Rømskog;postmottak@romskog.kommune.no 0122;Trøgstad;postmottak@trogstad.kommune.no -0123;Spydeberg;post@spydeberg.kommune.no +0123;Spydeberg;servicetorget@spydeberg.kommune.no 0124;Askim;postmottak@askim.kommune.no 0125;Eidsberg;postmottak@eidsberg.kommune.no 0127;Skiptvet;postmottak@skiptvet.kommune.no 0128;Rakkestad;postmottak@rakkestad.kommune.no 0135;Råde;post@rade.kommune.no -0136;Rygge;postmottak@rygge.kommune.no +0136;Rygge;servicetorget@rygge.kommune.no 0137;Våler;postmottak@valer-of.kommune.no 0138;Hobøl;post@hobol.kommune.no 01;Østfold;sentralpost@ostfoldfk.no;Annet @@ -91,7 +91,7 @@ 0215;Frogn;postmottak@frogn.kommune.no 0216;Nesodden;postmottak@nesodden.kommune.no 0217;Oppegård;postmottak@oppegard.kommune.no -0219;Bærum;post@baerum.kommune.no +0219;Bærum;veiledningstorget@baerum.kommune.no;Annet,Buss- og togstopp,Dumpet skrot,Forlatte kjøretøy,Forsøpling,Fortau/gangstier,Gatefeiing,Gatelys,Gater/Veier,Graffiti/tagging,Hull i vei,Offentlige toaletter,Oljesøl,Parkering,Park/landskap,Snøbrøyting,Sykkelveier,Tette avløpsrister,Trafikklys,Trafikkskilter,Trær,Turveier,Ulovlige oppslag,Universell utforming,Vannforsyning,Veinavn-skilter 0220;Asker;post@asker.kommune.no 0221;Aurskog-Høland;postmottak@ahk.no 0226;Sørum;postmottak@sorum.kommune.no @@ -99,7 +99,7 @@ 0228;Rælingen;postmottak@ralingen.kommune.no 0229;Enebakk;postmottak@enebakk.kommune.no 0230;Lørenskog;postmottak@lorenskog.kommune.no -0231;Skedsmo;postmottak@skedsmo.kommune.no +0231;Skedsmo;ekspedts@skedsmo.kommune.no 0233;Nittedal;postmottak@nittedal.kommune.no 0234;Gjerdrum;postmottak@gjerdrum.kommune.no 0235;Ullensaker;postmottak@ullensaker.kommune.no @@ -109,7 +109,7 @@ 0239;Hurdal;postmottak@hurdal.kommune.no 02;Akershus;postmottak@akershus-fk.no;Annet 03;Oslo;postmottak@oslo.kommune.no -0402;Kongsvinger;postmottak@kongsvinger.kommune.no +0402;Kongsvinger;fiksgata@kongsvinger.kommune.no 0403;Hamar;postmottak@hamar.kommune.no 0412;Ringsaker;postmottak@ringsaker.kommune.no 0415;Løten;post@loten.kommune.no @@ -132,7 +132,7 @@ 0439;Folldal;postmottak@folldal.kommune.no 0441;Os;postmottak@os.kommune.no 04;Hedmark;postmottak@hedmark.org;Annet -0501;Lillehammer;postmottak@lillehammer.kommune.no +0501;Lillehammer;servicetorget@lillehammer.kommune.no 0502;Gjøvik;postmottak@gjovik.kommune.no 0511;Dovre;postmottak@dovre.kommune.no 0512;Lesja;postmottak@lesja.kommune.no @@ -162,7 +162,7 @@ 0602;Drammen;kommunepost@drammen.kommune.no 0604;Kongsberg;postmottak@kongsberg.kommune.no 0605;Ringerike;postmottak@ringerike.kommune.no -0612;Hole;postmottak@hole.kommune.no +0612;Hole;publikumskontoret@hole.kommune.no 0615;Flå;postmottak@flaa.kommune.no 0616;Nes;postmottak@nes-bu.kommune.no 0617;Gol;postmottak@gol.kommune.no @@ -237,7 +237,7 @@ 1004;Flekkefjord;post@flekkefjord.kommune.no 1014;Vennesla;post@vennesla.kommune.no 1017;Songdalen;postmottak@songdalen.kommune.no -1018;Søgne;postmottak@sogne.kommune.no +1018;Søgne;fiksgatami@sogne.kommune.no 1021;Marnardal;service@Marnardal.kommune.no 1026;Åseral;info@aseral.kommune.no 1027;Audnedal;info@audnedal.kommune.no @@ -247,6 +247,11 @@ 1037;Kvinesdal;post@kvinesdal.kommune.no 1046;Sirdal;post@sirdal.kommune.no 10;Vest-Agder;postmottak@vaf.no;Annet +11001;Statens vegvesen region øst;firmapost-ost@vegvesen.no;Fortau/gangstier,Gatefeiing,Gatelys,Gater/Veier,Hull i vei,Snøbrøyting,Sykkelveier,Trafikklys,Trafikkskilter,Veinavn-skilter +11002;Statens vegvesen region sør;firmapost-sor@vegvesen.no;Fortau/gangstier,Gatefeiing,Gatelys,Gater/Veier,Hull i vei,Snøbrøyting,Sykkelveier,Trafikklys,Trafikkskilter,Veinavn-skilter +11003;Statens vegvesen region vest;firmapost-vest@vegvesen.no;Fortau/gangstier,Gatefeiing,Gatelys,Gater/Veier,Hull i vei,Snøbrøyting,Sykkelveier,Trafikklys,Trafikkskilter,Veinavn-skilter +11004;Statens vegvesen region midt;firmapost-midt@vegvesen.no;Fortau/gangstier,Gatefeiing,Gatelys,Gater/Veier,Hull i vei,Snøbrøyting,Sykkelveier,Trafikklys,Trafikkskilter,Veinavn-skilter +11005;Statens vegvesen region nord;firmapost-nord@vegvesen.no;Fortau/gangstier,Gatefeiing,Gatelys,Gater/Veier,Hull i vei,Snøbrøyting,Sykkelveier,Trafikklys,Trafikkskilter,Veinavn-skilter 1101;Eigersund;post@eigersund.kommune.no 1102;Sandnes;postmottak@sandnes.kommune.no 1103;Stavanger;postmottak@stavanger.kommune.no @@ -274,20 +279,21 @@ 1151;Utsira;post@utsira.kommune.no 1160;Vindafjord;postmottak@vindafjord.kommune.no 11;Rogaland;firmapost@rogfk.no;Annet -1201;Bergen;postmottak@bergen.kommune.no +1201;Bergen;vaktsentral@bergen.kommune.no 1211;Etne;firmapost@etne.kommune.no 1216;Sveio;postmottak@sveio.kommune.no 1219;Bømlo;postmottak@bomlo.kommune.no -1221;Stord;post@stord.kommune.no +1221;Stord;kundetorget@stord.kommune.no;Annet,Buss- og togstopp,Dumpet skrot,Forlatte kjøretøy,Forsøpling,Fortau/gangstier,Gatefeiing,Gater/Veier,Graffiti/tagging,Hull i vei,Offentlige toaletter,Oljesøl,Parkering,Park/landskap,Snøbrøyting,Sykkelveier,Tette avløpsrister,Trafikklys,Trafikkskilter,Trær,Ulovlige oppslag,Universell utforming,Vannforsyning,Veinavn-skilter +1221;Stord;post@skl.as;Gatelys 1222;Fitjar;fitjar@fitjar.kommune.no 1223;Tysnes;post@tysnes.kommune.no 1224;Kvinnherad;post@kvinnherad.kommune.no 1227;Jondal;post@jondal.kommune.no -1228;Odda;epost@odda.kommune.no -1231;Ullensvang;postmottak@ullensvang.herad.no +1228;Odda;Tenestetorg@odda.kommune.no +1231;Ullensvang herad;postmottak@ullensvang.herad.no 1232;Eidfjord;postmottak@eidfjord.kommune.no -1233;Ulvik;postmottak@ulvik.kommune.no -1234;Granvin;postmottak@granvin.kommune.no +1233;Ulvik herad;postmottak@ulvik.kommune.no +1234;Granvin herad;postmottak@granvin.kommune.no 1235;Voss;postmottak@voss.kommune.no 1238;Kvam herad;postmottak@kvam.kommune.no 1241;Fusa;postkasse@fusa.kommune.no @@ -296,7 +302,7 @@ 1244;Austevoll;postmottak@austevoll.kommune.no 1245;Sund;postmottak@sund.kommune.no 1246;Fjell;postmottak@fjell.kommune.no -1247;Askøy;postmottak@askoy.kommune.no +1247;Askøy;kundetorg@askoy.kommune.no 1251;Vaksdal;post@vaksdal.kommune.no 1252;Modalen;postmottak@modalen.kommune.no 1253;Osterøy;post@osteroy.kommune.no @@ -308,7 +314,7 @@ 1265;Fedje;postmottak@fedje.kommune.no 1266;Masfjorden;post@masfjorden.kommune.no 12;Hordaland;hfk@post.hfk.no;Annet -1401;Flora;postmottak@flora.kommune.no +1401;Flora;tenestetorgetekspedisjon@flora.kommune.no 1411;Gulen;postmottak@gulen.kommune.no 1412;Solund;post@solund.kommune.no 1413;Hyllestad;postmottak@hyllestad.kommune.no @@ -325,7 +331,7 @@ 1429;Fjaler;post@fjaler.kommune.no 1430;Gaular;postmottak@gaular.kommune.no 1431;Jølster;postmottak@jolster.kommune.no -1432;Førde;postmottak@forde.kommune.no +1432;Førde;servicetorget@forde.kommune.no 1433;Naustdal;postmottak@naustdal.kommune.no 1438;Bremanger;post@bremanger.kommune.no 1439;Vågsøy;post@vagsoy.kommune.no @@ -336,7 +342,7 @@ 1449;Stryn;postmottak@stryn.kommune.no 14;Sogn og Fjordane;postmottak.sentraladm@sfj.no;Annet 1502;Molde;postmottak@molde.kommune.no -1504;Ålesund;postmottak@alesund.kommune.no +1504;Ålesund;servicetorget@alesund.kommune.no 1505;Kristiansund;postmottak@kristiansund.kommune.no 1511;Vanylven;postmottak@vanylven.kommune.no 1514;Sande;sande.kommune@sande-mr.kommune.no @@ -372,7 +378,7 @@ 1573;Smøla;postmottak@smola.kommune.no 1576;Aure;postmottak@aure.kommune.no 15;Møre og Romsdal;post@mrfylke.no;Annet -1601;Trondheim;postmottak@trondheim.kommune.no +1601;Trondheim;bydrift.vegdrift@trondheim.kommune.no 1612;Hemne;postmottak@hemne.kommune.no 1613;Snillfjord;postmottak@snillfjord.kommune.no 1617;Hitra;postmottak@hitra.kommune.no diff --git a/perllib/FixMyStreet/App.pm b/perllib/FixMyStreet/App.pm index 29d224268..68bfc728b 100644 --- a/perllib/FixMyStreet/App.pm +++ b/perllib/FixMyStreet/App.pm @@ -180,7 +180,7 @@ sub setup_request { Memcached::set_namespace( FixMyStreet->config('BCI_DB_NAME') . ":" ); - my $map = $host =~ /^osm\./ ? 'OSM' : $c->req->param('map'); + my $map = $host =~ /^osm\./ ? 'OSM' : $c->req->param('map_override'); #if ($c->sessionid) { # $map = $c->session->{map}; # $map = undef unless $map eq 'OSM'; diff --git a/perllib/FixMyStreet/App/Controller/Admin.pm b/perllib/FixMyStreet/App/Controller/Admin.pm index fbd50a973..a0d3e8643 100644 --- a/perllib/FixMyStreet/App/Controller/Admin.pm +++ b/perllib/FixMyStreet/App/Controller/Admin.pm @@ -121,6 +121,7 @@ sub timeline : Path( 'timeline' ) : Args(0) { my %time; $c->model('DB')->schema->storage->sql_maker->quote_char( '"' ); + $c->model('DB')->schema->storage->sql_maker->name_sep( '.' ); my $probs = $c->cobrand->problems->timeline; @@ -427,6 +428,7 @@ sub search_reports : Path('search_reports') { # makes PostgreSQL unhappy elsewhere so we only want to do # it for this query and then switch it off afterwards. $c->model('DB')->schema->storage->sql_maker->quote_char( '"' ); + $c->model('DB')->schema->storage->sql_maker->name_sep( '.' ); my $problems = $c->cobrand->problems->search( { @@ -744,6 +746,10 @@ sub update_edit : Path('update_edit') : Args(1) { $update->user($user); } + if ( $new_state eq 'confirmed' and $old_state eq 'unconfirmed' ) { + $update->confirmed( \'ms_current_timestamp()' ); + } + $update->update; $status_message = '<p><em>' . _('Updated!') . '</em></p>'; diff --git a/perllib/FixMyStreet/App/Controller/Report/New.pm b/perllib/FixMyStreet/App/Controller/Report/New.pm index 5cf634e14..2311b4aff 100644 --- a/perllib/FixMyStreet/App/Controller/Report/New.pm +++ b/perllib/FixMyStreet/App/Controller/Report/New.pm @@ -493,7 +493,7 @@ sub setup_categories_and_councils : Private { next # TODO - move this to the cobrand if $c->cobrand->moniker eq 'southampton' - && $contact->category eq 'Street lighting'; + && $contact->category =~ /Street lighting|Traffic lights/; next if $contact->category eq _('Other'); @@ -617,6 +617,7 @@ sub process_report : Private { map { $_ => scalar $c->req->param($_) } # ( 'title', 'detail', 'pc', # + 'detail_size', 'detail_depth', 'may_show_name', # 'category', # 'partial', # @@ -635,8 +636,14 @@ sub process_report : Private { # clean up text before setting $report->title( Utils::cleanup_text( $params{title} ) ); - $report->detail( - Utils::cleanup_text( $params{detail}, { allow_multiline => 1 } ) ); + + my $detail = Utils::cleanup_text( $params{detail}, { allow_multiline => 1 } ); + for my $w ('depth', 'size') { + next unless $params{"detail_$w"}; + next if $params{"detail_$w"} eq '-- Please select --'; + $detail .= "\n\n\u$w: " . $params{"detail_$w"}; + } + $report->detail( $detail ); # set these straight from the params $report->category( _ $params{category} ); diff --git a/perllib/FixMyStreet/App/Controller/Reports.pm b/perllib/FixMyStreet/App/Controller/Reports.pm index 61d7d5cb1..feafc4b77 100644 --- a/perllib/FixMyStreet/App/Controller/Reports.pm +++ b/perllib/FixMyStreet/App/Controller/Reports.pm @@ -124,7 +124,9 @@ sub ward : Path : Args(2) { # List of wards unless ($c->stash->{ward}) { - my $children = mySociety::MaPit::call('area/children', $c->stash->{council}->{id} ); + my $children = mySociety::MaPit::call('area/children', $c->stash->{council}->{id}, + type => $mySociety::VotingArea::council_child_types, + ); foreach (values %$children) { $_->{url} = $c->uri_for( $c->stash->{council_url} . '/' . $c->cobrand->short_name( $_ ) @@ -269,9 +271,9 @@ sub ward_check : Private { type => $mySociety::VotingArea::council_child_types, min_generation => $c->cobrand->area_min_generation ); - foreach my $id (sort keys %$qw) { - if ($qw->{$id}->{parent_area} == $council->{id}) { - $c->stash->{ward} = $qw->{$id}; + foreach my $area (sort { $a->{name} cmp $b->{name} } values %$qw) { + if ($area->{parent_area} == $council->{id}) { + $c->stash->{ward} = $area; return; } } diff --git a/perllib/FixMyStreet/Cobrand/LichfieldDC.pm b/perllib/FixMyStreet/Cobrand/LichfieldDC.pm new file mode 100644 index 000000000..12882faee --- /dev/null +++ b/perllib/FixMyStreet/Cobrand/LichfieldDC.pm @@ -0,0 +1,81 @@ +package FixMyStreet::Cobrand::LichfieldDC; +use base 'FixMyStreet::Cobrand::Default'; + +use strict; +use warnings; + +use Carp; +use URI::Escape; +use mySociety::VotingArea; + +sub site_restriction { + return ( "and council like '%2434%'", 'lichfield', { council => '2434' } ); +} + +sub problems_clause { + return { council => { like => '%2434%' } }; +} + +sub problems { + my $self = shift; + return $self->{c}->model('DB::Problem')->search( $self->problems_clause ); +} + +sub base_url { + my $base_url = mySociety::Config::get('BASE_URL'); + if ( $base_url !~ /lichfielddc/ ) { + $base_url =~ s{http://(?!www\.)}{http://lichfielddc.}g; + $base_url =~ s{http://www\.}{http://lichfielddc.}g; + } + return $base_url; +} + +sub site_title { + my ($self) = @_; + return 'Lichfield District Council FixMyStreet'; +} + +sub enter_postcode_text { + my ($self) = @_; + return 'Enter a Lichfield district postcode, or street name and area'; +} + +sub council_check { + my ( $self, $params, $context ) = @_; + + my $councils = $params->{all_councils}; + my $council_match = defined $councils->{2434}; + if ($council_match) { + return 1; + } + my $url = 'http://www.fixmystreet.com/'; + $url .= 'alert' if $context eq 'alert'; + $url .= '?pc=' . URI::Escape::uri_escape( $self->{c}->req->param('pc') ) + if $self->{c}->req->param('pc'); + my $error_msg = "That location is not covered by Lichfield District Council. +Please visit <a href=\"$url\">the main FixMyStreet site</a>."; + return ( 0, $error_msg ); +} + +# All reports page only has the one council. +sub all_councils_report { + return 0; +} + +# FIXME - need to double check this is all correct +sub disambiguate_location { + return { + centre => '52.688198,-1.804966', + span => '0.1196,0.218675', + bounds => [ '52.807793,-1.586291', '52.584891,-1.963232' ], + }; +} + +sub recent_photos { + my ( $self, $num, $lat, $lon, $dist ) = @_; + $num = 2 if $num == 3; + return $self->problems->recent_photos( $num, $lat, $lon, $dist ); +} + +1; + diff --git a/perllib/FixMyStreet/Geocode.pm b/perllib/FixMyStreet/Geocode.pm index 4ae3df368..d7c416fb5 100644 --- a/perllib/FixMyStreet/Geocode.pm +++ b/perllib/FixMyStreet/Geocode.pm @@ -43,6 +43,7 @@ sub string { if FixMyStreet->config('BING_MAPS_API_KEY'); return FixMyStreet::Geocode::Google::string($s, $c, $params) if FixMyStreet->config('GOOGLE_MAPS_API_KEY'); + die "No geocoding provider configured"; } 1; diff --git a/t/app/controller/admin.t b/t/app/controller/admin.t index 7f8590747..9f698c629 100644 --- a/t/app/controller/admin.t +++ b/t/app/controller/admin.t @@ -602,7 +602,7 @@ for my $test ( }, changes => { text => 'this is a twice changed update', - state => 'hidden', + state => 'confirmed', }, log_count => 7, log_entries => [qw/edit state_change state_change edit edit edit edit/], @@ -629,6 +629,9 @@ for my $test ( $update->discard_changes; is $update->$_, $test->{changes}->{$_} for grep { $_ ne 'email' } keys %{ $test->{changes} }; + if ( $test->{changes}{state} && $test->{changes}{state} eq 'confirmed' ) { + isnt $update->confirmed, undef; + } if ( $test->{user} ) { is $update->user->id, $test->{user}->id, 'update user'; diff --git a/templates/web/default/around/display_location.html b/templates/web/default/around/display_location.html index ebea99895..395054645 100755 --- a/templates/web/default/around/display_location.html +++ b/templates/web/default/around/display_location.html @@ -36,7 +36,9 @@ %] <form action="[% c.uri_for('/report/new') %]" method="post" name="mapForm" id="mapForm"> -<input type="hidden" name="map" value="[% c.req.params.map | html %]"> +[% IF c.req.params.map_override %] +<input type="hidden" name="map_override" value="[% c.req.params.map_override | html %]"> +[% END %] <input type="hidden" name="pc" value="[% pc | html %]"> [% c.cobrand.form_elements('mapForm') %] diff --git a/templates/web/default/faq/faq-en-gb.html b/templates/web/default/faq/faq-en-gb.html index 930a4c045..355369009 100755 --- a/templates/web/default/faq/faq-en-gb.html +++ b/templates/web/default/faq/faq-en-gb.html @@ -17,17 +17,19 @@ or clearing</strong>, such as: <li>Flyposting or graffiti <li>Flytipping or litter <li>Streetcleaning, such as broken glass in a cycle lane + [% IF c.cobrand.moniker != 'southampton' %] <li>Unlit lamposts + [% END %] <li>Potholes </ul> </dd> <dt>What isn’t FixMyStreet for?</dt> - <dd>FixMyStreet is not a way of getting in touch with your council for all + <dd>FixMyStreet is not a way of getting in touch with [% c.cobrand.moniker == 'southampton' ? 'the' : 'your' %] council for all issues – please use FixMyStreet only for problems such as the above. We often route problem reports via cleansing services or highways and so using FixMyStreet for other matters may result in a delay in your report getting - to the right department. <strong>You will need to contact your council + to the right department. <strong>You will need to contact [% c.cobrand.moniker == 'southampton' ? 'the' : 'your' %] council directly for problems such as</strong>: <ul><li>Anti-social behaviour @@ -49,10 +51,10 @@ 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.</dd> <dt>How are the problems solved?</dt> - <dd>They are reported to the relevant council by email. The + <dd>They are reported to the [% IF c.cobrand.moniker != 'southampton' %]relevant[% END %] council by email. The council can then resolve the problem the way they normally would. -Alternatively, you can discuss the problem on the website with others, and -then together lobby the council to fix it, or fix it directly yourselves.</dd> +Alternatively, you can discuss the problem on the website with others[% IF c.cobrand.moniker != 'southampton' %], and +then together lobby the council to fix it, or fix it directly yourselves[% END %].</dd> <dt>Is it free?</dt> <dd>The site is free to use, yes. FixMyStreet is run by a registered charity, though, so if you want to make a contribution, <a diff --git a/templates/web/default/report/new/fill_in_details.html b/templates/web/default/report/new/fill_in_details.html index 36b263864..6c40697eb 100644 --- a/templates/web/default/report/new/fill_in_details.html +++ b/templates/web/default/report/new/fill_in_details.html @@ -5,7 +5,9 @@ [% IF report.used_map %] <form action="[% c.uri_for('/report/new') %]" method="post" name="mapForm" id="mapForm"[% IF c.cobrand.allow_photo_upload %] enctype="multipart/form-data"[% END %]> -<input type="hidden" name="map" value="[% c.req.params.map | html %]"> +[% IF c.req.params.map_override %] +<input type="hidden" name="map_override" value="[% c.req.params.map_override | html %]"> +[% END %] <input type="hidden" name="pc" value="[% pc | html %]"> [% c.cobrand.form_elements('mapForm') %] [% ELSE %] diff --git a/templates/web/default/reports/council.html b/templates/web/default/reports/council.html index 2b004cf50..0739e84e8 100755 --- a/templates/web/default/reports/council.html +++ b/templates/web/default/reports/council.html @@ -23,7 +23,7 @@ <p>[% loc('Follow a ward link to view only reports within that ward.') %]</p> <ul> [% FOR child IN children.values.sort('name') %] -<li><a href="[% child.url %]">[% child.name %]</a></p> +<li><a href="[% child.url %]">[% child.name %]</a></li> [% END %] </ul> [% END %] diff --git a/templates/web/lichfielddc/footer.html b/templates/web/lichfielddc/footer.html new file mode 100644 index 000000000..58099193b --- /dev/null +++ b/templates/web/lichfielddc/footer.html @@ -0,0 +1,84 @@ + + </div><!-- End content --> + + <br class="clear" /> + </div> + + </div> + <br class="clear" /> + <br class="clear" /> +</div><!-- end of page_wrap --> + <ul class="contactbox"> + <li class="taxonomy"> + <h2>Browse council information on…</h2> + <ul> + <li><a href="http://www.lichfielddc.gov.uk/site/scripts/documents.php?categoryID=100001">Advice and benefits</a></li> + <li><a href="http://www.lichfielddc.gov.uk/site/scripts/documents.php?categoryID=100002">Business</a></li> + <li><a href="http://www.lichfielddc.gov.uk/site/scripts/documents.php?categoryID=100003">Community and living</a></li> + <li><a href="http://www.lichfielddc.gov.uk/site/scripts/documents.php?categoryID=100004">Council and democracy</a></li> + <li><a href="http://www.lichfielddc.gov.uk/site/scripts/documents.php?categoryID=100005">Education and learning</a></li> + <li><a href="http://www.lichfielddc.gov.uk/site/scripts/documents.php?categoryID=100006">Environment and planning</a></li> + <li><a href="http://www.lichfielddc.gov.uk/site/scripts/documents.php?categoryID=100007">Housing</a></li> + <li><a href="http://www.lichfielddc.gov.uk/site/scripts/documents.php?categoryID=100008">Jobs and careers</a></li> + <li><a href="http://www.lichfielddc.gov.uk/site/scripts/documents.php?categoryID=100009">Leisure and culture</a></li> + <li><a href="http://www.lichfielddc.gov.uk/site/scripts/documents.php?categoryID=100010">Health and social care</a></li> + <li><a href="http://www.lichfielddc.gov.uk/site/scripts/documents.php?categoryID=100011">Transport and streets</a></li> + </ul> + </li> + <li class="contact card"> + <a href="http://www.lichfielddc.gov.uk/site/scripts/location.php"><img src="http://www.lichfielddc.gov.uk/site/images/map.gif" alt="" /></a> + <h2>Get in touch or visit…</h2> + <ul> + <li><a href="http://www.lichfielddc.gov.uk/site/custom_scripts/feedback2.php">Your feedback or comments</a></li> + <li><a href="http://www.lichfielddc.gov.uk/site/scripts/faqs_ask.php">Ask a question about our services</a></li> + <li><a href="http://www.lichfielddc.gov.uk/site/scripts/location.php">Our location and travel details</a></li> + </ul> + <p class="fn councilName">Lichfield District Council</p> + <p class="phone tel">Phone our call centre: <span>01543 308 000</span></p> + <p class="add">District Council House, Frog Lane, Lichfield, Staffs, WS13 6YY</p> + </li> + <li class="focus"> + <h2>Our focus and priorities…</h2> + <ul> + <li><h3><a href="http://www.lichfielddc.gov.uk/people">Centred on people</a></h3> + <a href="http://www.lichfielddc.gov.uk/people"><img src="http://www.lichfielddc.gov.uk/site/images/people.gif" alt="" /></a> + </li> + <li><h3><a href="http://www.lichfielddc.gov.uk/place">Focused on place</a></h3> + <a href="http://www.lichfielddc.gov.uk/place"><img src="http://www.lichfielddc.gov.uk/site/images/place.gif" alt="" /></a> + </li> + <li><h3><a href="http://www.lichfielddc.gov.uk/improvement">Delivering through improvement</a></h3> + <a href="http://www.lichfielddc.gov.uk/improvement"><img src="http://www.lichfielddc.gov.uk/site/images/improvement.gif" alt="" /></a> + </li> + </ul> + </li> + </ul><!-- end contact box --> + <div id="footer"> + <img src="http://www.lichfielddc.gov.uk/images/3star.png" id="bcstar" alt="We received 3 stars in the Society of IT Managers' annual Better Connected report" /> + <img src="http://www.lichfielddc.gov.uk/site/images/footer-logo.gif" alt="Lichfield District Council" /> + <p class="addNav"><a href="http://www.lichfielddc.gov.uk/site/custom_scripts/mysociety/footer.php?#mast">Jump to the top</a></p> + <p class="addNav"><a href="http://www.lichfielddc.gov.uk/site/scripts/terms.php">Terms and Disclaimer</a> - <a href="http://www.lichfielddc.gov.uk/site/scripts/accessibility.php">Accessibility Statement</a> - <a href="http://www.lichfielddc.gov.uk/site/scripts/website_statistics.php">Websites statistics</a> - <a accesskey="3" href="http://www.lichfielddc.gov.uk/site/scripts/site_map.php">Site map</a> - Lichfield District Council © 2011</p> + + <p class="addNav">Made with <a href="http://validator.w3.org/">XHTML</a> and <a href="http://jigsaw.w3.org/css-validator/">CSS</a> to <a href="http://www.w3.org/WAI/WCAG1AA-Conformance">WAI-AA</a>. <a href="http://www.icra.org">ICRA</a> rated. Powered by Jadu <a href="http://www.jadu.co.uk" >Content Management</a>.</p> + + <p class="addNav"><a href="http://www.direct.gov.uk">www.direct.gov.uk</a> - A Beacon Authority</p> + +<p class="hidden"> + <a accesskey="1" href="http://www.lichfielddc.gov.uk">Homepage</a> / + <a accesskey="2" href="http://www.lichfielddc.gov.uk/site/scripts/whats_new_index.php">Whats new </a> / + <a accesskey="3" href="http://www.lichfielddc.gov.uk/site/scripts/site_map.php">Site map</a> / + <a accesskey="4" href="http://www.lichfielddc.gov.uk/site/scripts/search_index.php">Search facility </a> / + <a accesskey="5" href="http://www.lichfielddc.gov.uk/site/scripts/faqs_index.php">Frequently asked questions</a> / + <a accesskey="7" href="http://www.lichfielddc.gov.uk/site/scripts/contact.php">Complaints procedure (Contacting the Council page)</a> / + <a accesskey="8" href="http://www.lichfielddc.gov.uk/site/scripts/terms.php">Terms and Privacy</a> / + <a accesskey="9" href="http://www.lichfielddc.gov.uk/site/scripts/feedback.php">Feedback</a> / + <a accesskey="0" href="http://www.lichfielddc.gov.uk/site/scripts/accessibility.php">Access key details</a> / + <a accesskey="/" href="#mast">Top of the page</a> +</p> + + +</div> +</div> +<!-- #################################### --> +<script src="http://www.google-analytics.com/urchin.js" type="text/javascript"></script><script type="text/javascript"> _uacct = "UA-511839-1"; urchinTracker(); </script> +</body> +</html> diff --git a/templates/web/lichfielddc/header.html b/templates/web/lichfielddc/header.html new file mode 100644 index 000000000..f162ecc97 --- /dev/null +++ b/templates/web/lichfielddc/header.html @@ -0,0 +1,212 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="[% lang_code %]"> +<head> + +<style type="text/css"> + @import url(/css/core.css); + @import url(/cobrands/lichfielddc/css/layout.css); +</style> + + <link rel="stylesheet" type="text/css" href="http://www.lichfielddc.gov.uk/site/styles/standard_1_.css" media="screen" /> +<link rel="stylesheet" type="text/css" href="http://www.lichfielddc.gov.uk/site/styles/generic/style.php" media="screen" /> + +<!--[if lte IE 6]> + <link rel="stylesheet" type="text/css" href="http://www.lichfielddc.gov.uk/site/styles/generic/ie_special.css" media="screen" /> + <link rel="stylesheet" type="text/css" href="http://www.lichfielddc.gov.uk/site/styles/generic/ie_special_print.css" media="print" /> +<![endif]--> +<!--[if IE 7]> + <link rel="stylesheet" type="text/css" href="http://www.lichfielddc.gov.uk/site/styles/generic/ie-seven.css" media="screen" /> +<![endif]--> + +<link rel="stylesheet" type="text/css" href="http://www.lichfielddc.gov.uk/site/styles/generic/print.css" media="print" /> +<link rel="stylesheet" type="text/css" href="http://www.lichfielddc.gov.uk/site/styles/generic/handheld.css" media="handheld" /> + +<link rel="Shortcut Icon" type="image/x-icon" href="http://www.lichfielddc.gov.uk/site/favicon.ico" /> +<link rel="ToC" href="http://www.lichfielddc.gov.uk/site/scripts/site_map.php" /> + + <link rel="search" type="application/opensearchdescription+xml" href="http://www.lichfielddc.gov.uk/openSearch.php" title="Lichfield District Council" /> + + <!-- general metadata --> + <meta http-equiv="content-type" content="text/html; charset=utf-8" /> + <meta http-equiv="content-language" content="en" /> + <meta name="generator" content="http://www.jadu.co.uk" /> + <meta name="robots" content="index,follow" /> + <meta name="revisit-after" content="2 days" /> + <meta name="Author-Template" content="Jadu CSS design" /> + <meta name="Author" content="Lichfield District Council" /> + <meta name="Publisher" content="Lichfield District Council, District Council House, Frog Lane, Lichfield, Staffordshire. WS13 6YY" /> + <meta name="Publisher-Email" content="webmaster@lichfielddc.gov.uk" /> + <meta name="Coverage" content="Worldwide" /> + + <!-- ICRA PICS label --> + <link rel="meta" href="http://www.lichfielddc.gov.uk/labels.rdf" type="application/rdf+xml" title="ICRA labels" /> + <!-- Dublin Core Metadata --> + <meta name="DC.creator" lang="en" content="Lichfield District Council" /> + <meta name="DC.date.created" lang="en" content="PARAM_DATE" /> + <meta name="DC.format" lang="en" content="text/html" /> + <meta name="DC.language" content="en" /> + <meta name="DC.publisher" lang="en" content="Lichfield District Council, District Council House, Frog Lane, Lichfield, Staffordshire. WS13 6YY" /> + <meta name="DC.rights.copyright" lang="en" content="Copyright 2010 Lichfield District Council" /> + <meta name="DC.coverage" lang="en" content="Worldwide" /> + <meta name="DC.identifier" content="[% c.request.base %]" /> + + <!-- eGMS Metadata --> + <meta name="eGMS.status" lang="en" content="V1.0 Public Consumption" /> + <meta name="eGMS.accessibility" scheme="WCAG" content="Double-A" /> + + <!-- javascript --> + <script type="text/javascript" src="http://www.lichfielddc.gov.uk/site/javascript/prototype.js"></script> + <script type="text/javascript" src="http://www.lichfielddc.gov.uk/site/javascript/scriptaculous.js"></script> + <script type="text/javascript" src="http://www.lichfielddc.gov.uk/site/custom_scripts/lightbox/js/lightbox.js"></script> + <script type="text/javascript" src="http://www.lichfielddc.gov.uk/site/javascript/global.js"></script> + + + <meta name="Keywords" content="home, homepage, index, root, Lichfield, UK, England, local authority, council, local government, services, citizen, councillor, community, leisure, tourist, tourism, social services, education, environment, fire, emergency planning, road safety, transport, motorways, library, libraries, archive, public record, record office, parish councils, county councillors" /> + <meta name="Description" content="Lichfield District Council: FixMyStreet" /> + + <meta name="DC.title" lang="en" content="Lichfield District Council: FixMyStreet" /> + <meta name="DC.description" lang="en" content="Lichfield District Council: FixMyStreet" /> + + <meta name="DC.subject" lang="en" scheme="eGMS.IPSV" content="Local government;Government, politics and public administration" /> + <meta name="DC.subject" lang="en" content="Council, government and democracy" /> + +[% INCLUDE 'common_header_tags.html' %] +</head> +<body> +<!-- ########## MAIN STRUCTURE ######### --> +<div id="container"> +<div id="mobile_name">Lichfield District Council</div> +<div id="mast"> + <p class="skip"> + <a accesskey="s" title="Skip to page content, access key S" href="[% c.req.url %]#main" rel="nofollow">Jump to content</a> - + <a accesskey="n" title="Skip to main navigation, access key N" href="[% c.req.url %]#main-nav" rel="nofollow">Jump to navigation</a> - + + <a class="access" title="Change font size, colour and contrast of this site" href="http://www.lichfielddc.gov.uk/site/scripts/user_settings.php">Accessibility Settings</a> + </p> + <!--<form action="http://www.lichfielddc.gov.uk/site/scripts/search_results.php" method="get" id="search"> + <fieldset><a title="Create a specific detailed search" href="http://www.lichfielddc.gov.uk/site/scripts/search_index.php">Need help finding something?</a> + <label for="SearchSite">Search this site</label> + <input type="text" size="18" maxlength="40" class="field" name="searchQuery" id="SearchSite" value="" /> + <input type="submit" value="Search" class="button" /></fieldset> + </form>--> + <form action="http://www.lichfielddc.gov.uk/site/scripts/google_results.php" method="get" name="search" id="search"> + <fieldset><a title="Create a specific detailed search" href="http://www.lichfielddc.gov.uk/site/scripts/search_index.php">Need help finding something?</a> + <label for="SearchSite">Search this site</label> + <input type="text" name="q" size="18" maxlength="40" class="field" id="SearchSite" value="What are you looking for?" style="colour:#666;"/> + <input type="hidden" name="output" value="xml"/> + <input type="hidden" name="as_sitesearch" value="lichfielddc.gov.uk"/> + <input type="submit" value="Search" class="button" /></fieldset> + </form> + <div class="pseudoH1"> + <a href="http://www.lichfielddc.gov.uk/site/index.php"><span>Lichfield District Council</span></a> + </div> + + <p class="about"> + Making it easy to <a href="http://www.lichfielddc.gov.uk/site/scripts/az_home.php" class="tt">access council services</a>, <a href="http://www.lichfielddc.gov.uk/reportit" class="tt">report problems</a> in your area, view <a href="http://www.lichfielddc.gov.uk/planning" class="tt">planning applications</a>, find out <a href="http://www.lichfielddc.gov.uk/whatsgoingon" class="tt">what's going on locally</a>, <a href="http://www.lichfielddc.gov.uk/voiceit" class="tt">have your say</a> on local issues, and much more. + </p> + + <a name="main-nav"></a> + <h2>Navigation</h2> + <ul> + <li><a href="http://www.lichfielddc.gov.uk" title="View the home page">Home</a></li> + <li><a href="http://www.lichfielddc.gov.uk/site/scripts/az_home.php">A-Z of services</a></li> + <li><a href="http://www.lichfielddc.gov.uk/site/scripts/documents_index.php">Council services</a></li> + <li><a href="http://www.lichfielddc.gov.uk/site/custom_scripts/newsblogindex.php">News</a></li> + <li><a href="http://www.lichfielddc.gov.uk/site/scripts/contact.php">Contacts</a></li> + <li><a href="http://www.lichfielddc.gov.uk/site/scripts/location.php">Opening hours and location</a></li> + <li><a href="http://www.lichfielddc.gov.uk/site/custom_scripts/myareasearch.php" id="myarea">My area</a> + </li> + <li><a href="http://www.lichfielddc.gov.uk/site/custom_scripts/map.php" >Online map</a></li> + <!-- <li class="sign-in"><a href="http://www.lichfielddc.gov.uk/site/index.php?sign_in=true">Sign-in</a> or <a href="http://www.lichfielddc.gov.uk/site/scripts/register.php">Register</a></li> --> + <li class="sign-in"> + + <a href="http://www.lichfielddc.gov.uk/site/index.php?sign_in=true">Sign in</a> or + + + <a href="http://www.lichfielddc.gov.uk/site/scripts/register.php">Register</a> + </li> + + </ul><!-- end navigation --> + <!-- + <span id="postcode box" style="display: none;"> +<form action="http://www.lichfielddc.gov.uk/site/custom_scripts/myarea.php" method="get" id="pcodeform"> +<label for="postcode">Your Postcode: </label><input name="postcode" id="postcode" class="text" /> <input value="Go!" name="submit" class="button" type="submit" /> +</form> +</span> --> + + + <div class="clear"></div> +</div> + +<div id="suggest"></div> +<script type="text/javascript" src="http://www.lichfielddc.gov.uk/site/javascript/effects.js"></script> +<script type="text/javascript"> + new Ajax.Autocompleter('SearchSite', 'suggest', 'http://www.lichfielddc.gov.uk/site/custom_scripts/autocomplete.php', { + paramName: 'search', + minChars: 1, + afterUpdateElement : goTo + }); + + function goTo(text, li) { + var url = li.title; + window.location = url; + } + +$('SearchSite').onfocus = function() { + if (this._cleared) return + this.clear() + this.style.color = '#000' + this._cleared = true + } + + +/* document.observe("dom:loaded", function() { + Event.observe($('my area'), 'click', function(event) { + $('postcodebox').appear(); + event.stop(event); + }); + }); */ + </script> <div id="page_wrap"> + <div id="mainContent"> + <div id="content"> + <a name="main"></a> + + [% IF c.user_exists %] + <ul class="user"> + <li>[% tprintf(loc('Signed in as %s'), c.user.name || c.user.email) %] - <a href="/auth/sign_out">[% loc('Sign out') %]</a></li> + </ul> + [% END %] + <!-- BREAD CRUMB NAVIGATION --> + + <!-- Breadcrumb --><!-- googleoff:all --> + <ul id="breadcrumb"> + <li><a href="http://www.lichfielddc.gov.uk/site/">Home</a></li><li><a href="[% c.req.base %]">FixMyStreet</a></li> + <li class="bc_end"> + [% SWITCH c.req.uri.path %]Report a problem + [% CASE '/' %]Report a problem + [% CASE '/reports/Lichfield' %]All reports + [% CASE '/my' %]Your reports + [% CASE '/alert' %]Local alerts + [% CASE '/faq' %]Help + [% CASE '/contact' %]Contact + [% CASE '/around' %]Viewing a location + [% CASE '/report/new' %]Reporting a problem + [% CASE '/auth' %]Sign in + [% CASE '/auth/sign_out' %]Signed out + [% CASE DEFAULT %] [% IF c.req.uri.path.substr(0, 8 ) == '/report/' %][% problem.title %] - Viewing a problem[% END %] + [% END %] + </li></ul> + + <!-- END Breadcrumb --><!-- googleon:all --> + <!-- END BREAD CRUMB --> + +<ul id="nav"> + <li class="section"><a href="/">Report a problem</a></li> + <li class="section"><a href="/reports/Lichfield">All reports</a></li> + <li class="section"><a href="/my">Your reports</a></li> + <li class="section"><a href="/alert">Local alerts</a></li> + <li class="section"><a href="/faq">Help</a></li> + <li class="section"><a href="/contact">Contact</a></li> +</ul> + <div id="mysociety"> + diff --git a/templates/web/southampton/header.html b/templates/web/southampton/header.html index a15054fb6..5d94d5bdf 100644 --- a/templates/web/southampton/header.html +++ b/templates/web/southampton/header.html @@ -2,6 +2,7 @@ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> [% INCLUDE 'common_header_tags.html' %] + <script type="text/javascript" src="/js/southampton.js"></script> <link rel="stylesheet" type="text/css" href="/css/core.css" /> <link rel="stylesheet" type="text/css" href="/cobrands/southampton/style.css" /> @@ -27,7 +28,7 @@ <form id="frmSearch" method="get" action="http://websearch.southampton.gov.uk/search"> <fieldset> <label for="searchbox">Search the site<br /></label> - <input class="text" type="text" value="Enter keywords" id="searchbox" name="q"/> + <input class="text" type="text" value="" placeholder="Enter keywords" id="searchbox" name="q"/> <input type="hidden" id="site" name="site" value="SouthamptonOnline"/> <input type="hidden" id="client" name="client" value="SouthamptonOnline"/> <input type="hidden" id="proxystylesheet" name="proxystylesheet" value="SouthamptonOnline"/> @@ -40,7 +41,7 @@ <label for="PostCode">Where I live <img class="moreInfo" src="/cobrands/southampton/information.gif" alt="Find information about where you live" title="Find information about where you live" /><br /> </label> - <input id="PostCode" name="Postcode" class="text2" type="text" value="Enter street/postcode" /> + <input id="PostCode" name="Postcode" class="text2" type="text" value="" placeholder="Enter street/postcode" /> <input class="button" type="submit" value="go" /> </fieldset> </form> diff --git a/web/cobrands/lichfielddc/css/layout.css b/web/cobrands/lichfielddc/css/layout.css new file mode 100644 index 000000000..e671ef61c --- /dev/null +++ b/web/cobrands/lichfielddc/css/layout.css @@ -0,0 +1,165 @@ +#mysociety { + clear: both; +} + +#mysociety #postcodeForm { + padding: 0.8em; + background-color: #F3F4F4; +} + +#mysociety #postcodeForm label { + float: none; + margin-bottom: 5px; + width: auto !important; +} + +#mysociety p { + margin: 1em 0px; + padding: 0px; +} + +#mysociety #update_form { + clear: both; +} + +#mysociety #form_sign_in { + padding-top: 2em; +} + +#mysociety form label { + width: 6em; + display: inline; + margin-right: 0px; +} + +#mysociety div.checkbox { + padding-left: 6.5em; +} + +#mysociety textarea, +#mysociety input { + background-color: #f9f9f1; + margin: 4px; +} + +#mysociety #fileupload_normalUI input { + background-color: white; +} + +#mysociety input[type='submit']{ + border: 0px; + color: white; + padding: 3px; + vertical-align: top; + font:150%/1.4em "Trebuchet MS", Helvetica, Arial, Sans-serif; + background:url(http://www.lichfielddc.gov.uk/site/styles/css_img/nav-bg.png) top repeat-x; +} + +#mysociety #expl small { + position: relative; + top: 6px !important; + } + +#mysociety h2 { + background: transparent url(http://www.lichfielddc.gov.uk/site/styles/css_img/lilac-dotted-border.png) bottom repeat-x; + padding:0 0 7px 0 !important; + margin: 22px 0 14px 0 !important; + font-size:1.4em; + } + +#mysociety #front_stats div { + background-color: #f5f5f5; + padding: 5px; + } + +#mysociety #front_stats { + padding: 0 65px; + } + +#mysociety #front_stats div big { + margin-bottom: 4px; + } + +#nav { + font-size: 1em; + margin: 0 0 30px 0 !important; + background: transparent url(/cobrands/lichfielddc/i/bg_header.gif) left repeat-x !important; + clear: both; + width: 100%; + float: left; + border: 1px solid #ccc; + padding: 0; + } + +#nav li { + float: left !important; + list-style-type: none !important; + list-style-image: none !important; + border-right: 1px solid #ccc; + padding: 0; + } + +#nav li a { + border: none !important; + color: #111; + font-weight: bold; + padding: 8px 12px !important; + display: block; + } + +#nav li a:hover { + border-bottom: 1px solid #111; + background: transparent url(/cobrands/lichfielddc/i/bg_header2.gif) left repeat-x !important; + } + +#mysociety #fixed { + padding: 5px !important; + margin: 70px 0 10px 0 !important; + width: 405px; + position: relative; + top: 7px + } + +#mysociety p[style] { + border: none !important; + } + +#mysociety #updates div { + border-bottom: 1px dotted #ccc; + padding: 0 0 17px 0; + margin: 17px 0 0 0; +} + +#mysociety #updates { + margin-bottom: 40px; + } + +#mysociety #updates p { + margin-bottom: 15px; + } + +#map_box ul li p { + margin: 0; + padding: 0; +} + +#mysociety input[type='text'], #mysociety input[type='password'], #mysociety input[type='email'] { + background: #F9F9F1; + border: 1px solid #666 !important; + padding: 5px; + } + +#mysociety input[type='text']:focus, #mysociety input[type='password']:focus, #mysociety input[type='email']:focus { + border:1px solid #000000; + outline:2px solid #98339B; + } + +div#suggest { + border: none !important; + } + +ul.user { + list-style-type: none; + font-size: 80%; + float: right; +} diff --git a/web/cobrands/lichfielddc/i/bg_header.gif b/web/cobrands/lichfielddc/i/bg_header.gif Binary files differnew file mode 100644 index 000000000..e126e5798 --- /dev/null +++ b/web/cobrands/lichfielddc/i/bg_header.gif diff --git a/web/cobrands/lichfielddc/i/bg_header2.gif b/web/cobrands/lichfielddc/i/bg_header2.gif Binary files differnew file mode 100644 index 000000000..f11508a7f --- /dev/null +++ b/web/cobrands/lichfielddc/i/bg_header2.gif diff --git a/web/cobrands/southampton/css.css b/web/cobrands/southampton/css.css index 85f66dcc3..fa0e07548 100644 --- a/web/cobrands/southampton/css.css +++ b/web/cobrands/southampton/css.css @@ -1,22 +1,17 @@ #mysociety #map_box { - width: 380px; + width: 422px; } #mysociety #map, #mysociety #drag { - width: 378px; - height: 378px; -} -#mysociety #watermark { - background: url("/i/mojwatermark-378.png"); - height: 84px; - width: 171px; - position: absolute; - bottom: 0; - right: 0; + width: 420px; + height: 420px; } #mysociety p#fixed, #mysociety p#unknown { - margin-right: 400px; + margin-right: 442px; width: auto; } +#mysociety #problem_form { + clear: both; +} #mysociety h1 { margin: 0; font-size: 175%; diff --git a/web/cobrands/southampton/css.scss b/web/cobrands/southampton/css.scss index 57cb95a8f..0760c982c 100644 --- a/web/cobrands/southampton/css.scss +++ b/web/cobrands/southampton/css.scss @@ -1,4 +1,4 @@ -$map_width: 378px; +$map_width: 420px; $background: #E9EEF7; $darker: #768EB5; @@ -13,20 +13,16 @@ $darker: #768EB5; width: $map_width; height: $map_width; } - #watermark { - background: url("/i/mojwatermark-378.png"); - height: 84px; - width: 171px; - position: absolute; - bottom: 0; - right: 0; - } p#fixed, p#unknown { margin-right: $map_width + 22px; width: auto; } + #problem_form { + clear: both; + } + // Generics h1 { diff --git a/web/js/map-OpenLayers.js b/web/js/map-OpenLayers.js index 6b4a03d7e..d00079517 100644 --- a/web/js/map-OpenLayers.js +++ b/web/js/map-OpenLayers.js @@ -41,6 +41,15 @@ $(function(){ return false; }); + // Vector layers must be added onload as IE sucks + if ($.browser.msie) { + $(window).load(fixmystreet_onload); + } else { + fixmystreet_onload(); + } +}); + +function fixmystreet_onload() { if ( fixmystreet.area ) { var area = new OpenLayers.Layer.Vector("KML", { strategies: [ new OpenLayers.Strategy.Fixed() ], @@ -96,8 +105,7 @@ $(function(){ var bounds = fixmystreet.markers.getDataExtent(); if (bounds) { fixmystreet.map.zoomToExtent( bounds ); } } - -}); +} function fms_markers_list(pins, transform) { var cols = { 'red':'R', 'green':'G', 'blue':'B', 'purple':'P' }; diff --git a/web/js/southampton.js b/web/js/southampton.js new file mode 100644 index 000000000..1f3e16105 --- /dev/null +++ b/web/js/southampton.js @@ -0,0 +1,50 @@ +/* + * southampton.js + * FixMyStreet JavaScript for Southampton + */ + + +$(function(){ + + $('[placeholder]').focus(function(){ + var input = $(this); + if (input.val() == input.attr('placeholder')) { + input.val(''); + input.removeClass('placeholder'); + input.css({ 'color': '#000000' }); + } + }).blur(function(){ + var input = $(this); + if (input.val() == '' || input.val() == input.attr('placeholder')) { + input.css({ 'color': '#999999' }); + input.val(input.attr('placeholder')); + } + }).blur(); + + $('#form_category').change(function(){ + var category = $(this).val(); + if ('Potholes' == category) { + if (!$('#potholes_extra').length) { + var qns = '<div id="potholes_extra" style="margin:0; display:none;">' + + '<div class="form-field"><label for="form_size">Size:</label>' + + '<select name="detail_size"><option>-- Please select --<option>Unknown' + + '<option>Small: No larger than a dinner plate (up to 30cm/12inches)' + + '<option>Medium: No larger than a dustbin lid (up to 60cm/24inches)' + + '<option>Large: Larger than a dustbin lid (over 60cm/24inches)' + + '</select></div>' + + '<div class="form-field"><label for="form_depth">Depth:</label>' + + '<select name="detail_depth"><option>-- Please select --<option>Unknown' + + '<option>No deeper than a golf ball (up to 4cm/1.5inches)' + + '<option>No deeper than a tennis ball (up to 6.5cm/2.5inches)' + + '<option>Deeper than a tennis ball' + + '</select></div></div>'; + $('#form_title').closest('div.form-field').after(qns); + } + $('#potholes_extra').show('fast'); + } else { + $('#potholes_extra').hide('fast'); + } + }).change(); + +}); + |