diff options
author | Matthew Somerville <matthew@mysociety.org> | 2014-03-11 17:34:38 +0000 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2014-03-11 17:34:38 +0000 |
commit | 4df8d9979a4325bf2b47f401b4095654dd43d3a9 (patch) | |
tree | 64984c71916683830a1b1eef4deee8a04307cd80 | |
parent | eee9a69a1959f060fdbe7d346d594a76a3b39909 (diff) | |
parent | de47a7fad977156c67748deed6b3f154fc849035 (diff) |
Merge remote branch 'origin/sweden-rebase'
Conflicts:
bin/update-schema
locale/sv_SE.UTF-8/LC_MESSAGES/FixMyStreet.po
perllib/FixMyStreet/DB/Result/Body.pm
62 files changed, 2362 insertions, 32 deletions
diff --git a/bin/open311-update-reports b/bin/open311-update-reports new file mode 100644 index 000000000..e7ff34273 --- /dev/null +++ b/bin/open311-update-reports @@ -0,0 +1,21 @@ +#!/usr/bin/perl + +use strict; +use warnings; +use Open311::GetUpdates; +use FixMyStreet::App; + +# FIXME - make this configurable and/or better +my $system_user = FixMyStreet::App->model('DB::User')->find_or_create( + { + email => FixMyStreet::App->config->{'CONTACT_EMAIL'}, + name => 'System User', + } +); + +my $council_list = FixMyStreet::App->model('DB::Body'); + +my $update = Open311::GetUpdates->new( + council_list => $council_list, + system_user => $system_user +)->get_updates; diff --git a/bin/update-schema b/bin/update-schema index ef33b82a7..be5bc50e7 100755 --- a/bin/update-schema +++ b/bin/update-schema @@ -85,6 +85,7 @@ print "Nothing to do\n" if $nothing; # By querying the database schema, we can see where we're currently at # (assuming schema change files are never half-applied, which should be the case) sub get_db_version { + return '0031' if column_exists('body', 'external_url'); return '0030' if ! constraint_exists('admin_log_action_check'); return '0029' if column_exists('body', 'deleted'); return '0028' if table_exists('body'); diff --git a/db/schema.sql b/db/schema.sql index 125e680c6..6ddb7bae6 100644 --- a/db/schema.sql +++ b/db/schema.sql @@ -55,6 +55,7 @@ create table users ( create table body ( id serial primary key, name text not null, + external_url text, parent integer references body(id), endpoint text, jurisdiction text, diff --git a/db/schema_0031-add_url_to_body.sql b/db/schema_0031-add_url_to_body.sql new file mode 100644 index 000000000..7aaa78c64 --- /dev/null +++ b/db/schema_0031-add_url_to_body.sql @@ -0,0 +1,9 @@ +BEGIN; + +-- `external_url' includes an URL for reporting problems to the body directly. +-- It can be displayed in the new report form when no contacts are set; see +-- templates/web/fixamingata/report/new/councils_text_none.html for an example. + +ALTER TABLE body ADD external_url TEXT; + +COMMIT; diff --git a/locale/sv_SE.UTF-8/LC_MESSAGES/FixMyStreet.po b/locale/sv_SE.UTF-8/LC_MESSAGES/FixMyStreet.po index 303debd80..abcfb3860 100644 --- a/locale/sv_SE.UTF-8/LC_MESSAGES/FixMyStreet.po +++ b/locale/sv_SE.UTF-8/LC_MESSAGES/FixMyStreet.po @@ -498,7 +498,7 @@ msgstr "" #: templates/web/default/js/translation_strings.html:32 #: templates/web/oxfordshire/js/translation_strings.html:26 msgid "Back" -msgstr "" +msgstr "Tillbaka" #: templates/web/default/admin/report_blocks.html:11 msgid "Ban email address" @@ -770,7 +770,7 @@ msgstr "Kan inte hitta användaren" #: templates/web/default/js/translation_strings.html:37 #: templates/web/oxfordshire/js/translation_strings.html:31 msgid "Could not look up location" -msgstr "" +msgstr "Kunde inte lokalisera dig automatiskt" #: templates/web/default/admin/list_updates.html:9 msgid "Council" @@ -1384,7 +1384,7 @@ msgstr "Historik" #: templates/web/default/js/translation_strings.html:31 #: templates/web/oxfordshire/js/translation_strings.html:25 msgid "Home" -msgstr "" +msgstr "Home" #: templates/web/default/index-steps.html:1 msgid "How to report a problem" @@ -1393,7 +1393,7 @@ msgstr "Hur man rapporterar ett problem" #: templates/web/default/js/translation_strings.html:33 #: templates/web/oxfordshire/js/translation_strings.html:27 msgid "How to send successful reports" -msgstr "" +msgstr "Hur man lyckas bäst med att rapportera fel" #: perllib/FixMyStreet/App/Controller/Admin.pm:733 msgid "I am afraid you cannot confirm unconfirmed reports." @@ -1948,7 +1948,7 @@ msgstr "Inga problem har rapporteras än." #: templates/web/default/js/translation_strings.html:38 #: templates/web/oxfordshire/js/translation_strings.html:32 msgid "No result returned" -msgstr "" +msgstr "Inget resultat returnerades" #: templates/web/default/admin/body-form.html:60 #: templates/web/default/admin/body-form.html:61 @@ -2233,7 +2233,7 @@ msgstr "Foton från närliggande rapporter" #: templates/web/default/js/translation_strings.html:30 #: templates/web/oxfordshire/js/translation_strings.html:24 msgid "Place pin on map" -msgstr "" +msgstr "Klicka på kartan" #: templates/web/default/admin/report_edit.html:35 #: templates/web/default/admin/report_edit.html:38 @@ -2469,7 +2469,7 @@ msgstr "Fyll i information om problemet nedan. Kommunen kommer inte att kunna hj #: templates/web/seesomething/report/new/fill_in_details_form.html:20 #: templates/web/zurich/report/new/fill_in_details_form.html:46 msgid "Please fill in details of the problem." -msgstr "Fyll i information om problemet nedan." +msgstr "Fyll i information om problemet nedan. Ange gärna en adress då detta gör det lättare för kommunen att hitta till platsen." #: templates/web/bromley/report/new/fill_in_details_form.html:28 #: templates/web/default/report/new/fill_in_details_form.html:27 @@ -3502,7 +3502,7 @@ msgstr "Bekräftelsebrevet <strong>kan</strong> ta ett par minuter att komma fra #: templates/web/fixmystreet/report/new/fill_in_details_text.html:1 #: templates/web/fixmystreet/report/new/fill_in_details_text.html:3 msgid "The council won’t be able to help unless you leave as much detail as you can. 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." -msgstr "" +msgstr "Det är lättare för kommunen att hjälpa till om du lämnar så mycket detaljer som möjligt. Beskriv den exakta positionen (ex.v. på väggen), vad problemet är, hur länge det har funnits där, en beskrivning och foto (om du har), etc." #: templates/web/fixmystreet/questionnaire/index.html:43 msgid "The details of your problem are available from the other tab above." @@ -3601,7 +3601,7 @@ msgstr "Vår enklaste bevakning är för rapporter inom ett geografiskt område: #: templates/web/default/report/new/fill_in_details_form.html:17 #: templates/web/fixmystreet/report/new/fill_in_details_form.html:12 msgid "The subject and details of the problem will be public, plus your name if you give us permission." -msgstr "Ärendet och informationen om problemet kommer att vara publikt. Ditt namn kommer också att vara publikt om du ger oss tillstånd att visa det." +msgstr "Informationen du anger här kommer att bli en offentlig handling när rapporten skickats till kommunen och kommer samtidigt att visas publikt på Fixa Min Gata. Ditt namn kommer dock att visas endast om du medger att vi visar det." #: perllib/FixMyStreet/DB/ResultSet/Problem.pm:291 msgid "The user could not locate the problem on a map, but to see the area around the location they entered" @@ -3839,7 +3839,7 @@ msgstr "Okänd feltyp" #: templates/web/default/js/translation_strings.html:39 #: templates/web/oxfordshire/js/translation_strings.html:33 msgid "Unknown error" -msgstr "" +msgstr "Okänt fel" #: perllib/FixMyStreet/App/Controller/Report.pm:106 msgid "Unknown problem ID" @@ -4180,7 +4180,7 @@ msgstr "" #: templates/web/default/js/translation_strings.html:36 #: templates/web/oxfordshire/js/translation_strings.html:30 msgid "You declined; please fill in the box above" -msgstr "" +msgstr "Du tackade nej; var vänlig använd textrutan ovan" #: perllib/FixMyStreet/App/Controller/Questionnaire.pm:38 msgid "You have already answered this questionnaire. If you have a question, please <a href='%s'>get in touch</a>, or <a href='%s'>view your problem</a>.\n" @@ -4460,7 +4460,7 @@ msgstr "" #: templates/web/default/report/updates.html:49 msgid "marked as closed" -msgstr "" +msgstr "markerad som stängd" #: templates/web/default/report/updates.html:28 #: templates/web/default/report/updates.html:51 @@ -4469,11 +4469,11 @@ msgstr "markerad som löst" #: templates/web/default/report/updates.html:45 msgid "marked as in progress" -msgstr "" +msgstr "markerad som att arbete pågår" #: templates/web/default/report/updates.html:41 msgid "marked as investigating" -msgstr "" +msgstr "markerad som att arbete pågår" #: templates/web/default/report/updates.html:55 msgid "marked as not the council's responsibility" @@ -4481,7 +4481,7 @@ msgstr "" #: templates/web/default/report/updates.html:43 msgid "marked as planned" -msgstr "" +msgstr "markerad som att arbete planerat" #: templates/web/default/report/updates.html:53 msgid "marked as unable to fix" @@ -4502,7 +4502,7 @@ msgstr "eller" #: templates/web/default/js/translation_strings.html:27 #: templates/web/oxfordshire/js/translation_strings.html:21 msgid "or locate me automatically" -msgstr "" +msgstr "Klicka här för att försöka <strong>hitta min position automatiskt</strong>." #: templates/web/default/admin/report_edit.html:24 #: templates/web/default/admin/report_edit.html:26 diff --git a/perllib/FixMyStreet/App/Controller/Report/New.pm b/perllib/FixMyStreet/App/Controller/Report/New.pm index fcab4e49a..a419e9cc1 100644 --- a/perllib/FixMyStreet/App/Controller/Report/New.pm +++ b/perllib/FixMyStreet/App/Controller/Report/New.pm @@ -678,6 +678,7 @@ sub setup_categories_and_bodies : Private { # put results onto stash for display $c->stash->{bodies} = \%bodies; $c->stash->{all_body_names} = [ map { $_->name } values %bodies ]; + $c->stash->{all_body_urls} = [ map { $_->external_url } values %bodies ]; $c->stash->{bodies_to_list} = [ keys %bodies_to_list ]; $c->stash->{category_options} = \@category_options; $c->stash->{category_extras} = \%category_extras; diff --git a/perllib/FixMyStreet/App/Controller/Static.pm b/perllib/FixMyStreet/App/Controller/Static.pm index 6cc22aede..40e2431ea 100755 --- a/perllib/FixMyStreet/App/Controller/Static.pm +++ b/perllib/FixMyStreet/App/Controller/Static.pm @@ -57,6 +57,10 @@ sub iphone : Global : Args(0) { my ( $self, $c ) = @_; } +sub council : Global : Args(0) { + my ( $self, $c ) = @_; +} + __PACKAGE__->meta->make_immutable; 1; diff --git a/perllib/FixMyStreet/Cobrand/FixaMinGata.pm b/perllib/FixMyStreet/Cobrand/FixaMinGata.pm new file mode 100644 index 000000000..f17f7716f --- /dev/null +++ b/perllib/FixMyStreet/Cobrand/FixaMinGata.pm @@ -0,0 +1,272 @@ +package FixMyStreet::Cobrand::FixaMinGata; +use base 'FixMyStreet::Cobrand::Default'; + +use strict; +use warnings; + +use Carp; +use mySociety::MaPit; +use FixMyStreet::Geocode::FixaMinGata; +use DateTime; + + +DateTime->DefaultLocale('sv_SE'); + +sub site_title { + my ($self) = @_; + return 'Fixa Min Gata'; +} + +sub path_to_web_templates { + my $self = shift; + return [ + FixMyStreet->path_to( 'templates/web', $self->moniker )->stringify, + FixMyStreet->path_to( 'templates/web/fixmystreet' )->stringify + ]; +} + +sub country { + return 'SE'; +} + +sub languages { [ 'en-gb,English,en_GB', 'sv,Swedish,sv_SE' ] } +sub language_override { 'sv' } + +sub enter_postcode_text { + my ( $self ) = @_; + return _('Enter a nearby postcode, or street name and area'); +} + +# Is also adding language parameter +sub disambiguate_location { + return { + lang => 'sv', + country => 'se', # Is this the right format? /Rikard + }; +} + +sub area_types { + [ 'KOM' ]; +} + +sub admin_base_url { + return 'http://www.fixamingata.se/admin/'; +} + +# If lat/lon are present in the URL, OpenLayers will use that to centre the map. +# Need to specify a zoom to stop it defaulting to null/0. +sub uri { + my ( $self, $uri ) = @_; + + $uri->query_param( zoom => 3 ) + if $uri->query_param('lat') && !$uri->query_param('zoom'); + + return $uri; +} + +sub geocode_postcode { + my ( $self, $s ) = @_; + # Most people write Swedish postcodes like this: + #+ XXX XX, so let's remove the space + # Is this the right place to do this? //Rikard + # This is the right place! // Jonas + $s =~ s/\ //g; # Rikard, remove space in postcode + if ($s =~ /^\d{5}$/) { + my $location = mySociety::MaPit::call('postcode', $s); + if ($location->{error}) { + return { + error => $location->{code} =~ /^4/ + ? _('That postcode was not recognised, sorry.') + : $location->{error} + }; + } + return { + latitude => $location->{wgs84_lat}, + longitude => $location->{wgs84_lon}, + }; + } + return {}; +} + +# Vad gör den här funktionen? Är "Sverige" rätt här? +sub geocoded_string_check { + my ( $self, $s ) = @_; + return 1 if $s =~ /, Sverige/; + return 0; +} + +sub find_closest { + my ( $self, $latitude, $longitude ) = @_; + return FixMyStreet::Geocode::OSM::closest_road_text( $self, $latitude, $longitude ); +} + +# Used by send-reports, calling find_closest, calling OSM geocoding +sub guess_road_operator { + my ( $self, $inforef ) = @_; + + my $highway = $inforef->{highway} || "unknown"; + my $refs = $inforef->{ref} || "unknown"; + return "Trafikverket" + if $highway eq "trunk" || $highway eq "primary"; + + for my $ref (split(/;/, $refs)) { + return "Trafikverket" + if $ref =~ m/E ?\d+/ || $ref =~ m/Fv\d+/i; + } + return ''; +} + +sub remove_redundant_councils { + my $self = shift; + my $all_councils = shift; + + # Oslo is both a kommune and a fylke, we only want to show it once + # Jag tror inte detta är applicerbart på Sverige ;-) //Rikard + #delete $all_councils->{301} # + # if $all_councils->{3}; +} + +sub filter_all_council_ids_list { + my $self = shift; + my @all_councils_ids = @_; + + # as above we only want to show Oslo once + # Rikard kommenterar ut detta. + # return grep { $_ != 301 } @all_councils_ids; + # Rikard: + return @all_councils_ids; # Är detta rätt? //Rikard +} + +sub short_name { + my $self = shift; + my ($area, $info) = @_; + + # Rikard kommenterar ut följande tills vidare... + #if ($area->{name} =~ /^(Os|Nes|V\xe5ler|Sande|B\xf8|Her\xf8y)$/) { + # my $parent = $info->{$area->{parent_area}}->{name}; + # return URI::Escape::uri_escape_utf8("$area->{name}, $parent"); + #} + + my $name = $area->{name}; + $name =~ s/ & / and /; + $name = URI::Escape::uri_escape_utf8($name); + $name =~ s/%20/+/g; + return $name; +} + +# Vad ska vi göra för svenska förhållanden här??? //Rikard +sub council_rss_alert_options { + my $self = shift; + my $all_councils = shift; + my $c = shift; + + my ( @options, @reported_to_options, $fylke, $kommune ); + + foreach ( values %$all_councils ) { + if ( $_->{type} eq 'NKO' ) { + $kommune = $_; + } + else { + $fylke = $_; + } + } + + if ( $fylke->{id} == 3 ) { # Oslo + my $short_name = $self->short_name($fylke, $all_councils); + ( my $id_name = $short_name ) =~ tr/+/_/; + + push @options, + { + type => 'council', + id => sprintf( 'council:%s:%s', $fylke->{id}, $id_name ), + rss_text => + sprintf( _('RSS feed of problems within %s'), $fylke->{name} ), + text => sprintf( _('Problems within %s'), $fylke->{name} ), + uri => $c->uri_for( '/rss/reports', $short_name ), + }; + } + else { + my $short_kommune_name = $self->short_name($kommune, $all_councils); + ( my $id_kommune_name = $short_kommune_name ) =~ tr/+/_/; + + my $short_fylke_name = $self->short_name($fylke, $all_councils); + ( my $id_fylke_name = $short_fylke_name ) =~ tr/+/_/; + + push @options, + { + type => 'area', + id => sprintf( 'area:%s:%s', $kommune->{id}, $id_kommune_name ), + rss_text => + sprintf( _('RSS feed of %s'), $kommune->{name} ), + text => $kommune->{name}, + uri => $c->uri_for( '/rss/area', $short_kommune_name ), + }, + { + type => 'area', + id => sprintf( 'area:%s:%s', $fylke->{id}, $id_fylke_name ), + rss_text => + sprintf( _('RSS feed of %s'), $fylke->{name} ), + text => $fylke->{name}, + uri => $c->uri_for( '/rss/area', $short_fylke_name ), + }; + + push @reported_to_options, + { + type => 'council', + id => sprintf( 'council:%s:%s', $kommune->{id}, $id_kommune_name ), + rss_text => + sprintf( _('RSS feed of %s'), $kommune->{name} ), + text => $kommune->{name}, + uri => $c->uri_for( '/rss/reports', $short_kommune_name ), + }, + { + type => 'council', + id => sprintf( 'council:%s:%s', $fylke->{id}, $id_fylke_name ), + rss_text => + sprintf( _('RSS feed of %s'), $fylke->{name} ), + text => $fylke->{name}, + uri => $c->uri_for( '/rss/reports/', $short_fylke_name ), + }; + } + + return ( + \@options, @reported_to_options + ? \@reported_to_options + : undef + ); + +} + +# Vad ska vi göra för svenska förhållanden här??? //Rikard +sub reports_council_check { + my ( $self, $c, $council ) = @_; + + if ($council eq 'Oslo') { + + # There are two Oslos (kommune and fylke), we only want one of them. + $c->stash->{council} = mySociety::MaPit::call('area', 3); + return 1; + + } elsif ($council =~ /,/) { + + # Some kommunes have the same name, use the fylke name to work out which. + my ($kommune, $fylke) = split /\s*,\s*/, $council; + my $area_types = $c->cobrand->area_types; + my $areas_k = mySociety::MaPit::call('areas', $kommune, type => $area_types); + my $areas_f = mySociety::MaPit::call('areas', $fylke, type => $area_types); + if (keys %$areas_f == 1) { + ($fylke) = values %$areas_f; + foreach (values %$areas_k) { + if ($_->{name} eq $kommune && $_->{parent_area} == $fylke->{id}) { + $c->stash->{council} = $_; + return 1; + } + } + } + # If we're here, we've been given a bad name. + $c->detach( 'redirect_index' ); + + } +} + +1; diff --git a/perllib/FixMyStreet/DB/Result/Body.pm b/perllib/FixMyStreet/DB/Result/Body.pm index c2b0555fb..be4adeca9 100644 --- a/perllib/FixMyStreet/DB/Result/Body.pm +++ b/perllib/FixMyStreet/DB/Result/Body.pm @@ -42,6 +42,8 @@ __PACKAGE__->add_columns( { data_type => "boolean", default_value => \"false", is_nullable => 0 }, "deleted", { data_type => "boolean", default_value => \"false", is_nullable => 0 }, + "external_url", + { data_type => "text", is_nullable => 0 }, ); __PACKAGE__->set_primary_key("id"); __PACKAGE__->has_many( diff --git a/perllib/FixMyStreet/Geocode/FixaMinGata.pm b/perllib/FixMyStreet/Geocode/FixaMinGata.pm new file mode 100644 index 000000000..2db25f504 --- /dev/null +++ b/perllib/FixMyStreet/Geocode/FixaMinGata.pm @@ -0,0 +1,204 @@ +#!/usr/bin/perl +# +# FixMyStreet:Geocode::FixaMinGata +# OpenStreetmap forward and reverse geocoding for FixMyStreet. +# +# Copyright (c) 2011 Petter Reinholdtsen. Some rights reserved. +# Email: pere@hungry.com + +# This module is a slightly derived version of OSM.pm. + +# As of January 2014, the FixaMinGata developers are considering to make further +# changes related to OSM, so it's probably best to keep this module separate +# from the OSM module for now. + +package FixMyStreet::Geocode::FixaMinGata; + +use warnings; +use strict; +use Data::Dumper; + +use Digest::MD5 qw(md5_hex); +use Encode; +use File::Slurp; +use File::Path (); +use LWP::Simple qw($ua); +use Memcached; +use XML::Simple; +use mySociety::Locale; + +my $osmapibase = "http://www.openstreetmap.org/api/"; +my $nominatimbase = "http://nominatim.openstreetmap.org/"; + +# string STRING CONTEXT +# Looks up on Nominatim, and caches, a user-inputted location. +# Returns array of (LAT, LON, ERROR), where ERROR is either undef, a string, or +# an array of matches if there are more than one. The information in the query +# may be used to disambiguate the location in cobranded versions of the site. +sub string { + my ( $s, $c ) = @_; + + my $params = $c->cobrand->disambiguate_location($s); + + $s = FixMyStreet::Geocode::escape($s); + # $s .= '+' . $params->{town} if $params->{town} and $s !~ /$params->{town}/i; + + my $url = "${nominatimbase}search?"; + my %query_params = ( + q => $s, + format => 'json', + addressdetails => 1, + limit => 20, + #'accept-language' => '', + email => 'info' . chr(64) . 'morus.se', + ); + # $query_params{viewbox} = $params->{bounds}[1] . ',' . $params->{bounds}[2] . ',' . $params->{bounds}[3] . ',' . $params->{bounds}[0] + # if $params->{bounds}; + $query_params{countrycodes} = $params->{country} + if $params->{country}; + $url .= join('&', map { "$_=$query_params{$_}" } keys %query_params); + + my $cache_dir = FixMyStreet->config('GEO_CACHE') . 'osm/'; + my $cache_file = $cache_dir . md5_hex($url); + my $js; + if (-s $cache_file) { + $js = File::Slurp::read_file($cache_file); + } else { + $ua->timeout(15); + $js = LWP::Simple::get($url); + $js = encode_utf8($js) if utf8::is_utf8($js); + File::Path::mkpath($cache_dir); + File::Slurp::write_file($cache_file, $js) if $js; + } + + if (!$js) { + return { error => _('Sorry, we could not find that location.') }; + } + + $js = JSON->new->utf8->allow_nonref->decode($js); + + my ( %locations, $error, @valid_locations, $latitude, $longitude ); + foreach (@$js) { + # These co-ordinates are output as query parameters in a URL, make sure they have a "." + next if $_->{class} eq "boundary"; + + my @s = split(/,/, $_->{display_name}); + + my $address = join(",", @s[0,1,2]); + + $locations{$address} = [$_->{lat}, $_->{lon}]; + } + + my ($key) = keys %locations; + + return { latitude => $locations{$key}[0], longitude => $locations{$key}[1] } if scalar keys %locations == 1; + return { error => _('Sorry, we could not find that location.') } if scalar keys %locations == 0; + + foreach $key (keys %locations) { + ( $latitude, $longitude ) = ($locations{$key}[0], $locations{$key}[1]); + mySociety::Locale::in_gb_locale { + push (@$error, { + address => $key, + latitude => sprintf('%0.6f', $latitude), + longitude => sprintf('%0.6f', $longitude) + }); + }; + } + + return { error => $error }; +} + +sub reverse_geocode { + my ($latitude, $longitude, $zoom) = @_; + my $url = + "${nominatimbase}reverse?format=xml&zoom=$zoom&lat=$latitude&lon=$longitude"; + my $key = "OSM:reverse_geocode:$url"; + my $result = Memcached::get($key); + unless ($result) { + my $j = LWP::Simple::get($url); + if ($j) { + Memcached::set($key, $j, 3600); + my $ref = XMLin($j); + return $ref; + } else { + print STDERR "No reply from $url\n"; + } + return undef; + } + return XMLin($result); +} + +sub _osmxml_to_hash { + my ($xml, $type) = @_; + my $ref = XMLin($xml); + my %tags; + if ('ARRAY' eq ref $ref->{$type}->{tag}) { + map { $tags{$_->{'k'}} = $_->{'v'} } @{$ref->{$type}->{tag}}; + return \%tags; + } else { + return undef; + } +} + +sub get_object_tags { + my ($type, $id) = @_; + my $url = "${osmapibase}0.6/$type/$id"; + my $key = "OSM:get_object_tags:$url"; + my $result = Memcached::get($key); + unless ($result) { + my $j = LWP::Simple::get($url); + if ($j) { + Memcached::set($key, $j, 3600); + return _osmxml_to_hash($j, $type); + } else { + print STDERR "No reply from $url\n"; + } + return undef; + } + return _osmxml_to_hash($result, $type); +} + +# A better alternative might be +# http://www.geonames.org/maps/osm-reverse-geocoder.html#findNearbyStreetsOSM +sub get_nearest_road_tags { + my ( $cobrand, $latitude, $longitude ) = @_; + my $inforef = reverse_geocode($latitude, $longitude, 16); + if (exists $inforef->{result}->{osm_type} + && 'way' eq $inforef->{result}->{osm_type}) { + my $osmtags = get_object_tags('way', + $inforef->{result}->{osm_id}); + unless ( exists $osmtags->{operator} ) { + $osmtags->{operatorguess} = $cobrand->guess_road_operator( $osmtags ); + } + return $osmtags; + } + return undef; +} + +sub closest_road_text { + my ( $cobrand, $latitude, $longitude ) = @_; + my $str = ''; + my $osmtags = get_nearest_road_tags( $cobrand, $latitude, $longitude ); + if ($osmtags) { + my ($name, $ref) = ('',''); + $name = $osmtags->{name} if exists $osmtags->{name}; + $ref = " ($osmtags->{ref})" if exists $osmtags->{ref}; + if ($name || $ref) { + $str .= _('The following information about the nearest road might be inaccurate or irrelevant, if the problem is close to several roads or close to a road without a name registered in OpenStreetMap.') . "\n\n"; + $str .= sprintf(_("Nearest named road to the pin placed on the map (automatically generated using OpenStreetMap): %s%s"), + $name, $ref) . "\n\n"; + + if (my $operator = $osmtags->{operator}) { + $str .= sprintf(_("Road operator for this named road (from OpenStreetMap): %s"), + $operator) . "\n\n"; + } elsif ($operator = $osmtags->{operatorguess}) { + $str .= sprintf(_("Road operator for this named road (derived from road reference number and type): %s"), + $operator) . "\n\n"; + } + } + } + return $str; +} + +1; + diff --git a/perllib/FixMyStreet/Map/OSM/MapQuest.pm b/perllib/FixMyStreet/Map/OSM/MapQuest.pm index ff314a4da..a7f1b334e 100644 --- a/perllib/FixMyStreet/Map/OSM/MapQuest.pm +++ b/perllib/FixMyStreet/Map/OSM/MapQuest.pm @@ -15,6 +15,10 @@ sub map_type { return 'OpenLayers.Layer.OSM.MapQuestOpen'; } +sub map_template { + return 'mapquest-attribution'; +} + sub map_tiles { my ( $self, %params ) = @_; my ( $x, $y, $z ) = ( $params{x_tile}, $params{y_tile}, $params{zoom_act} ); diff --git a/perllib/Open311.pm b/perllib/Open311.pm index 25119b867..c8289a442 100644 --- a/perllib/Open311.pm +++ b/perllib/Open311.pm @@ -172,19 +172,18 @@ sub _generate_service_request_description { my $problem = shift; my $extra = shift; - my $description = <<EOT; -detail: @{[$problem->detail()]} - -url: $extra->{url} - -Submitted via FixMyStreet -EOT -; - if ($self->extended_description ne 'oxfordshire') { - $description = <<EOT . $description; -title: @{[$problem->title()]} - -EOT + my $description = ""; + if ($problem->cobrand eq 'fixmystreet') { + $description .= "detail: " . $problem->detail . "\n\n"; + $description .= "url: " . $extra->{url} . "\n\n"; + $description .= "Submitted via FixMyStreet\n"; + if ($self->extended_description ne 'oxfordshire') { + $description = "title: " . $problem->title . "\n\n$description"; + } + } else { + $description .= $problem->title . "\n\n"; + $description .= $problem->detail . "\n\n"; + $description .= $extra->{url} . "\n"; } return $description; diff --git a/perllib/Open311/GetUpdates.pm b/perllib/Open311/GetUpdates.pm new file mode 100644 index 000000000..db5d8ef35 --- /dev/null +++ b/perllib/Open311/GetUpdates.pm @@ -0,0 +1,84 @@ +package Open311::GetUpdates; + +use Moose; +use Open311; +use FixMyStreet::App; + +has council_list => ( is => 'ro' ); +has system_user => ( is => 'ro' ); + +sub get_updates { + my $self = shift; + + while ( my $council = $self->council_list->next ) { + my $open311 = Open311->new( + endpoint => $council->endpoint, + jurisdiction => $council->jurisdiction, + api_key => $council->api_key + ); + + my $area_id = $council->area_id; + + my $council_details = mySociety::MaPit::call( 'area', $area_id ); + + my $reports = FixMyStreet::App->model('DB::Problem')->search( + { + council => { like => "\%$area_id\%" }, + state => { 'IN', [qw/confirmed fixed/] }, + -and => [ + external_id => { '!=', undef }, + external_id => { '!=', '' }, + ], + } + ); + + my @report_ids = (); + while ( my $report = $reports->next ) { + push @report_ids, $report->external_id; + } + + next unless @report_ids; + + $self->update_reports( \@report_ids, $open311, $council_details ); + } +} + +sub update_reports { + my ( $self, $report_ids, $open311, $council_details ) = @_; + + my $service_requests = $open311->get_service_requests( $report_ids ); + + my $requests; + + # XML::Simple is a bit inconsistent in how it structures + # things depending on the number of children an element has :( + if ( ref $service_requests->{request} eq 'ARRAY' ) { + $requests = $service_requests->{request}; + } + else { + $requests = [ $service_requests->{request} ]; + } + + for my $request (@$requests) { + # if it's a ref that means it's an empty element + # however, if there's no updated date then we can't + # tell if it's newer that what we have so we should skip it + next if ref $request->{updated_datetime} || ! exists $request->{updated_datetime}; + + my $request_id = $request->{service_request_id}; + + my $problem = + FixMyStreet::App->model('DB::Problem') + ->search( { external_id => $request_id, } ); + + if (my $p = $problem->first) { + my $cobrand = FixMyStreet::Cobrand->get_class_for_moniker($p->cobrand)->new(); + $cobrand->set_lang_and_domain($p->lang, 1); + $p->update_from_open311_service_request( $request, $council_details, $self->system_user ); + } + } + + return 1; +} + +1; diff --git a/t/open311.t b/t/open311.t index b7dab2bea..a029c7502 100644 --- a/t/open311.t +++ b/t/open311.t @@ -39,6 +39,7 @@ my $p = FixMyStreet::App->model('DB::Problem')->new( { user => $u, id => 1, name => 'A User', + cobrand => 'fixmystreet', } ); my $expected_error = qr{Failed to submit problem 1 over Open311}ism; @@ -63,6 +64,7 @@ my $problem = FixMyStreet::App->model('DB::Problem')->new( { longitude => 2, user => $user, name => 'Test User', + cobrand => 'fixmystreet', } ); subtest 'posting service request' => sub { diff --git a/t/open311/getupdates.t b/t/open311/getupdates.t new file mode 100644 index 000000000..500ac97d2 --- /dev/null +++ b/t/open311/getupdates.t @@ -0,0 +1,198 @@ +#!/usr/bin/env perl + +use strict; +use warnings; +use Test::More; + +use FindBin; +use lib "$FindBin::Bin/../perllib"; +use lib "$FindBin::Bin/../commonlib/perllib"; + +use_ok( 'Open311::GetUpdates' ); +use_ok( 'Open311' ); + +my $user = FixMyStreet::App->model('DB::User')->find_or_create( + { + email => 'system_user@example.com' + } +); + + +my $updates = Open311::GetUpdates->new( system_user => $user ); +ok $updates, 'created object'; + +my $requests_xml = qq{<?xml version="1.0" encoding="utf-8"?> +<service_requests> +<request> +<service_request_id>638344</service_request_id> +<status>open</status> +<status_notes>This is a note.</status_notes> +<service_name>Sidewalk and Curb Issues</service_name> +<service_code>006</service_code> +<description></description> +<agency_responsible></agency_responsible> +<service_notice></service_notice> +<requested_datetime>2010-04-14T06:37:38-08:00</requested_datetime> +UPDATED_DATETIME +<expected_datetime>2010-04-15T06:37:38-08:00</expected_datetime> +<lat>37.762221815</lat> +<long>-122.4651145</long> +</request> +</service_requests> +}; + +my $problem_rs = FixMyStreet::App->model('DB::Problem'); +my $problem = $problem_rs->new( + { + postcode => 'EH99 1SP', + latitude => 1, + longitude => 1, + areas => 1, + title => '', + detail => '', + used_map => 1, + user_id => 1, + name => '', + state => 'confirmed', + service => '', + cobrand => 'default', + cobrand_data => '', + user => $user, + created => DateTime->now()->subtract( days => 1 ), + lastupdate => DateTime->now()->subtract( days => 1 ), + anonymous => 1, + external_id => 638344, + } +); + +$problem->insert; + +for my $test ( + { + desc => 'element missing', + updated_datetime => '', + comment_count => 0, + }, + { + desc => 'empty element', + updated_datetime => '<updated_datetime />', + comment_count => 0, + }, + { + desc => 'element with no content', + updated_datetime => '<updated_datetime></updated_datetime>', + comment_count => 0, + }, + { + desc => 'element with old content', + updated_datetime => sprintf( '<updated_datetime>%s</updated_datetime>', DateTime->now->subtract( days => 3 ) ), + comment_count => 0, + }, + { + desc => 'element with new content', + updated_datetime => sprintf( '<updated_datetime>%s</updated_datetime>', DateTime->now ), + comment_count => 1, + }, +) { + subtest $test->{desc} => sub { + $problem->comments->delete; + $problem->lastupdate(DateTime->now()->subtract( days => 1 ) ), + $problem->update; + + my $local_requests_xml = $requests_xml; + $local_requests_xml =~ s/UPDATED_DATETIME/$test->{updated_datetime}/; + + my $o = Open311->new( jurisdiction => 'mysociety', endpoint => 'http://example.com', test_mode => 1, test_get_returns => { 'requests.xml' => $local_requests_xml } ); + + ok $updates->update_reports( [ 638344 ], $o, { name => 'Test Council' } ); + is $o->test_uri_used, 'http://example.com/requests.xml?jurisdiction_id=mysociety&service_request_id=638344', 'get url'; + + is $problem->comments->count, $test->{comment_count}, 'added a comment'; + }; +} + +$requests_xml = qq{<?xml version="1.0" encoding="utf-8"?> +<service_requests> +<request> +<service_request_id>638344</service_request_id> +<status>open</status> +<status_notes>This is a note.</status_notes> +<service_name>Sidewalk and Curb Issues</service_name> +<service_code>006</service_code> +<description></description> +<agency_responsible></agency_responsible> +<service_notice></service_notice> +<requested_datetime>2010-04-14T06:37:38-08:00</requested_datetime> +<updated_datetime>UPDATED_DATETIME</updated_datetime> +<expected_datetime>2010-04-15T06:37:38-08:00</expected_datetime> +<lat>37.762221815</lat> +<long>-122.4651145</long> +</request> +<request> +<service_request_id>638345</service_request_id> +<status>open</status> +<status_notes>This is a for a different issue.</status_notes> +<service_name>Sidewalk and Curb Issues</service_name> +<service_code>006</service_code> +<description></description> +<agency_responsible></agency_responsible> +<service_notice></service_notice> +<requested_datetime>2010-04-14T06:37:38-08:00</requested_datetime> +<updated_datetime>UPDATED_DATETIME2</updated_datetime> +<expected_datetime>2010-04-15T06:37:38-08:00</expected_datetime> +<lat>37.762221815</lat> +<long>-122.4651145</long> +</request> +</service_requests> +}; + +my $problem2 = $problem_rs->create( + { + postcode => 'EH99 1SP', + latitude => 1, + longitude => 1, + areas => 1, + title => '', + detail => '', + used_map => 1, + user_id => 1, + name => '', + state => 'confirmed', + service => '', + cobrand => 'default', + cobrand_data => '', + user => $user, + created => DateTime->now()->subtract( days => 1 ), + lastupdate => DateTime->now()->subtract( days => 1 ), + anonymous => 1, + external_id => 638345, + } +); + +$problem->comments->delete; +subtest 'update with two requests' => sub { + $problem->comments->delete; + $problem->lastupdate(DateTime->now()->subtract( days => 1 ) ), + + my $date1 = DateTime::Format::W3CDTF->new->format_datetime( DateTime->now() ); + my $date2 = DateTime::Format::W3CDTF->new->format_datetime( DateTime->now->subtract( hours => 1) ); + my $local_requests_xml = $requests_xml; + $local_requests_xml =~ s/UPDATED_DATETIME2/$date2/; + $local_requests_xml =~ s/UPDATED_DATETIME/$date1/; + + my $o = Open311->new( jurisdiction => 'mysociety', endpoint => 'http://example.com', test_mode => 1, test_get_returns => { 'requests.xml' => $local_requests_xml } ); + + ok $updates->update_reports( [ 638344,638345 ], $o, { name => 'Test Council' } ); + is $o->test_uri_used, 'http://example.com/requests.xml?jurisdiction_id=mysociety&service_request_id=638344%2C638345', 'get url'; + + is $problem->comments->count, 1, 'added a comment to first problem'; + is $problem2->comments->count, 1, 'added a comment to second problem'; +}; + +$problem->comments->delete; +$problem->delete; +$user->comments->delete; +$user->problems->delete; +$user->delete; + +done_testing(); diff --git a/templates/email/fixamingata/alert-confirm.txt b/templates/email/fixamingata/alert-confirm.txt new file mode 100644 index 000000000..c2a32b051 --- /dev/null +++ b/templates/email/fixamingata/alert-confirm.txt @@ -0,0 +1,13 @@ +Subject: Bekräfta din bevakning på [% INCLUDE 'site-name.txt' | trim %] + +Hej, + +vänligen klicka på länken nedan för att bekräfta den bevakning du +just valde att prenumerera till på [% INCLUDE 'site-name.txt' | trim %]: + + [% token_url %] + +Om du inte kan klicka på länken kan du kopiera den och klistra in den +i adressfältet på din webbläsare. + +[% INCLUDE 'signature.txt' %] diff --git a/templates/email/fixamingata/alert-problem-area.txt b/templates/email/fixamingata/alert-problem-area.txt new file mode 100644 index 000000000..ae3973e2c --- /dev/null +++ b/templates/email/fixamingata/alert-problem-area.txt @@ -0,0 +1,10 @@ +Subject: Nya rapporter i <?=$values['area_name']?> på Fixa Min Gata + +Följande nya rapporter har lagts till inom <?=$values['area_name']?>: + +<?=$values['data']?> + +<?=$values['signature']?> + +Om du vill avsluta din prenumeration på nya rapporter i <?=$values['area_name']?> +kan du klickan på följande länk: <?=$values['unsubscribe_url']?> diff --git a/templates/email/fixamingata/alert-problem-council.txt b/templates/email/fixamingata/alert-problem-council.txt new file mode 100644 index 000000000..ae3973e2c --- /dev/null +++ b/templates/email/fixamingata/alert-problem-council.txt @@ -0,0 +1,10 @@ +Subject: Nya rapporter i <?=$values['area_name']?> på Fixa Min Gata + +Följande nya rapporter har lagts till inom <?=$values['area_name']?>: + +<?=$values['data']?> + +<?=$values['signature']?> + +Om du vill avsluta din prenumeration på nya rapporter i <?=$values['area_name']?> +kan du klickan på följande länk: <?=$values['unsubscribe_url']?> diff --git a/templates/email/fixamingata/alert-problem-nearby.txt b/templates/email/fixamingata/alert-problem-nearby.txt new file mode 100644 index 000000000..70dd1cd48 --- /dev/null +++ b/templates/email/fixamingata/alert-problem-nearby.txt @@ -0,0 +1,10 @@ +Subject: Nya rapporter på FixMyStreet + +Följande rapporter har nyligen lagts till på: + +<?=$values['data']?> + +<?=$values['signature']?> + +Om du vill avsluta din prenumeration på nya rapporter +kan du klickan på följande länk: <?=$values['unsubscribe_url']?> diff --git a/templates/email/fixamingata/alert-problem-ward.txt b/templates/email/fixamingata/alert-problem-ward.txt new file mode 100644 index 000000000..ae3973e2c --- /dev/null +++ b/templates/email/fixamingata/alert-problem-ward.txt @@ -0,0 +1,10 @@ +Subject: Nya rapporter i <?=$values['area_name']?> på Fixa Min Gata + +Följande nya rapporter har lagts till inom <?=$values['area_name']?>: + +<?=$values['data']?> + +<?=$values['signature']?> + +Om du vill avsluta din prenumeration på nya rapporter i <?=$values['area_name']?> +kan du klickan på följande länk: <?=$values['unsubscribe_url']?> diff --git a/templates/email/fixamingata/alert-problem.txt b/templates/email/fixamingata/alert-problem.txt new file mode 100644 index 000000000..70dd1cd48 --- /dev/null +++ b/templates/email/fixamingata/alert-problem.txt @@ -0,0 +1,10 @@ +Subject: Nya rapporter på FixMyStreet + +Följande rapporter har nyligen lagts till på: + +<?=$values['data']?> + +<?=$values['signature']?> + +Om du vill avsluta din prenumeration på nya rapporter +kan du klickan på följande länk: <?=$values['unsubscribe_url']?> diff --git a/templates/email/fixamingata/alert-update.txt b/templates/email/fixamingata/alert-update.txt new file mode 100644 index 000000000..9cc42a2f2 --- /dev/null +++ b/templates/email/fixamingata/alert-update.txt @@ -0,0 +1,18 @@ +Subject: Ny uppdatering - '<?=$values['title']?>' + +Följande uppdatering har lämnats för rapporten +<?=$values['title']?>: + +<?=$values['data']?> + +<?=$values['state_message']?> + +För att se eller svara på dessa uppdateringar, klicka på följande länk: + <?=$values['problem_url']?> + +Du kan inte kontakta någon genom att svara på detta brev. + +<?=$values['signature']?> + +För att avsluta din prenumeration på nya uppdateringar kring denna +rapport, klicka på följande länk: <?=$values['unsubscribe_url']?> diff --git a/templates/email/fixamingata/contact.txt b/templates/email/fixamingata/contact.txt new file mode 100644 index 000000000..44638fccc --- /dev/null +++ b/templates/email/fixamingata/contact.txt @@ -0,0 +1,3 @@ +Subject: [% subject %] (via Fixa Min Gata) + +[% message %] diff --git a/templates/email/fixamingata/login.txt b/templates/email/fixamingata/login.txt new file mode 100644 index 000000000..dc5e93f45 --- /dev/null +++ b/templates/email/fixamingata/login.txt @@ -0,0 +1,13 @@ +Subject: [% loc('Your FixMyStreet.com account details') %] + +Välkommen till Fixa Min Gata! + +För att bekräfta din epostadress måste du nu klicka på länken nedan. +Du kommer sedan att kunna se dina rapporter och hantera dem via +webbsidan. + + +[% c.uri_for_action( 'auth/token', token ) %] + +[% INCLUDE 'signature.txt' %] + diff --git a/templates/email/fixamingata/partial.txt b/templates/email/fixamingata/partial.txt new file mode 100644 index 000000000..bb35883ab --- /dev/null +++ b/templates/email/fixamingata/partial.txt @@ -0,0 +1,12 @@ +Subject: Bekräfta din rapport på Fixa Min gata + +Hej [% report.name || report.email %], + +För att bekräfta den rapport som du nyligen lade in i Fixa Min Gata +via [% report.service %] måste du klicka på: + +[% token_url %] + +Tack! + +[% INCLUDE 'signature.txt' %] diff --git a/templates/email/fixamingata/problem-confirm.txt b/templates/email/fixamingata/problem-confirm.txt new file mode 100644 index 000000000..e8fc61a9f --- /dev/null +++ b/templates/email/fixamingata/problem-confirm.txt @@ -0,0 +1,20 @@ +Subject: Bekräfta din rapport på [% INCLUDE 'site-name.txt' | trim %] + +Hej [% report.name %], + +För att bekräfta den rapport som du nyligen lade in på Fixa Min Gata +måste du klicka på nedanstående länk: + +[% token_url %] + +Om det inte går att klicka på länken kan du kopiera den och klistra in +i adressfältet på din webläsare. + +Din rapport har titeln: [% report.title %] + +Du har angivit följande information om problemet: + +[% report.detail %] + + +[% INCLUDE 'signature.txt' %] diff --git a/templates/email/fixamingata/questionnaire.txt b/templates/email/fixamingata/questionnaire.txt new file mode 100644 index 000000000..47368bc5b --- /dev/null +++ b/templates/email/fixamingata/questionnaire.txt @@ -0,0 +1,22 @@ +Subject: Frågeformulär om '<?=$values['title']?>' + +Hej <?=$values['name']?>, + +<?=$values['created']?> sedan lämnade du en rapport på Fixa Min Gata. +För att hålla alla rapporter uppdaterade skulle vi uppskatta om du kunde +klicka på länken nedan och svara på ett par korta frågor om det problem +du rapporterade: + + <?=$values['url']?> + +Var snäll och svara inte på det här brevet. Använd istället +kommentarsfältet i frågeformuläret. + +<?=$values['signature']?> + +Ditt rapporterade problem var enligt nedan: + +<?=$values['title']?> + +<?=$values['detail']?> + diff --git a/templates/email/fixamingata/reply-autoresponse b/templates/email/fixamingata/reply-autoresponse new file mode 100644 index 000000000..b6ddb5146 --- /dev/null +++ b/templates/email/fixamingata/reply-autoresponse @@ -0,0 +1,22 @@ +Subject: Automatiskt svar på ditt brev till Fixa Min Gata + +Hej, + +det här ett ett automatiskt svar på ditt brev. Ditt brev har inte +lästs eller levererats till någon. + +Om du svarar på ett brev om en uppdatering måste du klicka på +länken som var i det brevet för att lämna en uppdatering. Du kan +inte skicka en uppdatering via epost. + +Om du försöker bekräfta en rapport måste du klicka på länken i +det brev som skickades till dig. + +Om du vill avbryta en prenumeration finns det en länk sist i +varje brev som du kan klicka på för att avbryta en prenumeration. + +Om du har frågor eller kommenterar på tjänsten kan du lämna dina +kommenterar på http://fixamingata.se/contact + +Vänligen, +Fixa Min Gata diff --git a/templates/email/fixamingata/signature.txt b/templates/email/fixamingata/signature.txt new file mode 100644 index 000000000..c2dffee4c --- /dev/null +++ b/templates/email/fixamingata/signature.txt @@ -0,0 +1,3 @@ +Vänligen, + +Fixa Min Gata diff --git a/templates/email/fixamingata/site-name.txt b/templates/email/fixamingata/site-name.txt new file mode 100644 index 000000000..8c9aa3aea --- /dev/null +++ b/templates/email/fixamingata/site-name.txt @@ -0,0 +1 @@ +Fixa Min Gata diff --git a/templates/email/fixamingata/submit-brent.txt b/templates/email/fixamingata/submit-brent.txt new file mode 100644 index 000000000..c94e6e1e4 --- /dev/null +++ b/templates/email/fixamingata/submit-brent.txt @@ -0,0 +1,43 @@ +Subject: FMS Problem Report: <?=$values['title']?> + +Dear <?=$values['councils_name']?>, + +<?=$values['missing']?><?=$values['multiple']?>A user of +FixMyStreet has submitted the following report +of a local problem that they believe might require your attention. + +<?=$values['fuzzy']?>, or to provide an update on the problem, +please visit the following link: + + <?=$values['url']?> + +<?=$values['has_photo']?>---------- + +Name: <?=$values['name']?> + +Email: <?=$values['email']?> + +<?=$values['phone_line']?><?=$values['category_line']?>Subject: <?=$values['title']?> + +Details: <?=$values['detail']?> + +<?=$values['easting_northing']?>Latitude: <?=$values['latitude']?> + +Longitude: <?=$values['longitude']?> + +<?=$values['closest_address']?>---------- + +Replies to this email will go to the user who submitted the problem. + +<?=$values['signature']?> + +This message was sent via FixMyStreet, a project of UKCOD, registered charity +number 1076346. If there is a more appropriate email address for messages about +<?=$values['category_footer']?>, please let us know by visiting <http://www.fixmystreet.com/contact>. +This will help improve the service for local people. We +also welcome any other feedback you may have. + +FixMyStreet is now available for full integration into council +websites, making life easier for both you and your residents. +Read more here: http://www.mysociety.org/for-councils/fixmystreet/ + diff --git a/templates/email/fixamingata/submit-example.txt b/templates/email/fixamingata/submit-example.txt new file mode 100644 index 000000000..4956a7a93 --- /dev/null +++ b/templates/email/fixamingata/submit-example.txt @@ -0,0 +1,61 @@ +Subject: Problem Report: Dangerous pothole + +Dear Birmingham City Council, + +A user of FixMyStreet has submitted the following report of a +local problem that they believe might require your attention. + +To view a map of the precise location of this issue, or to provide +an update on the problem, please visit the following link: + + http://www.fixmystreet.com/report/39092 + +---------- + +Name: Matthew Somerville + +Email: [...] + +Phone: [...] + +Category: Potholes + +Subject: Dangerous pothole + +Details: There is a large pothole almost on the give way line as +you approach the junction along Bournville Lane from the east, +which leads to vehicles rolling back as they fall in and out of it +whilst waiting at the junction. + +Easting: 404517 + +Northing: 280922 + +Latitude: 52.4262642791826 + +Longitude: -1.93500217285966 + +Nearest road to the pin placed on the map (automatically +generated by Bing Maps): Bournville Lane, Birmingham B30 1 + +Nearest postcode to the pin placed on the map (automatically +generated): B30 1LA (83m away) + +---------- + +Replies to this email will go to the user who submitted the problem. + +Yours, +The FixMyStreet team + +This message was sent via FixMyStreet, a project of UKCOD, +registered charity number 1076346. If there is a more appropriate +email address for messages about 'Potholes', please let us know by +visiting <http://www.fixmystreet.com/contact>. This will help +improve the service for local people. We also welcome any other +feedback you may have. + +FixMyStreet is now available for full integration into council +websites, making life easier for both you and your residents. +Read more here: http://www.mysociety.org/for-councils/fixmystreet/ + diff --git a/templates/email/fixamingata/submit.txt b/templates/email/fixamingata/submit.txt new file mode 100644 index 000000000..1fd9b8d25 --- /dev/null +++ b/templates/email/fixamingata/submit.txt @@ -0,0 +1,61 @@ +Subject: Ny rapport: <?=$values['title']?> + +Till <?=$values['councils_name']?>, + +Det här meddelandet rör en rapport om ett problem i gatumiljön som en +medborgare lämnat via tjänsten Fixa Min Gata. + +<?=$values['missing']?><?=$values['multiple']?>Följande rapport +tror medborgaren behöver er uppmärksamhet. + +<?=$values['fuzzy']?> eller uppdatera problemet, klicka på följande länk: + + <?=$values['url']?> + +<?=$values['has_photo']?> + +** Uppgiftslämnare + +Namn: <?=$values['name']?> + +Epost: <?=$values['email']?> + +<?=$values['phone_line']?> + +** Information om ärendet + +<?=$values['category_line']?>Ärende: <?=$values['title']?> + +<?=$values['detail']?> + +** Geografisk position + +<?=$values['easting_northing']?>Latitude: <?=$values['latitude']?> + +Longitude: <?=$values['longitude']?> + +<?=$values['closest_address']?>---------- + +Svar på det här brevet kommer att skickas till den person som lämnade +rapporten. + +Om det finns en lämpligare adress dit rapporter kan skickas kan ni +kontakta oss för att ändra detta. + +Föreningen Sambruk som driver tjänsten ansvarar för en användargrupp +som det går bra att gå med i för att få tillgång till ytterligare +FixaMinGata-relaterade tjänster och support. Bland annat kan varje +kategori ha sin egen e-postadress, och FixaMinGata kan även kopplas +mot system som Open311. + +Om ni vill läsa mer om Fixa Min Gata och vad det innebär för er som kommun +kan ni hitta ytterligare information på vår informationssida för kommuner: + + <http://fixamingata.se/kommun> + +Kontakta Föreningen Sambruk via: + + <http://fixamingata.se/contact> + +<?=$values['signature']?> + diff --git a/templates/email/fixamingata/test.txt b/templates/email/fixamingata/test.txt new file mode 100644 index 000000000..bfa2c1dd3 --- /dev/null +++ b/templates/email/fixamingata/test.txt @@ -0,0 +1,15 @@ +Subject: test email ☺ +From: bad-sender@duff.com + +Hello, + +This is a test email where foo: [% foo %]. + +utf8: 我们应该能够无缝处理UTF8编码 + + indented_text + +long line: Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. + +Yours, +FixMyStreet. diff --git a/templates/email/fixamingata/update-confirm.txt b/templates/email/fixamingata/update-confirm.txt new file mode 100644 index 000000000..6ef35f83d --- /dev/null +++ b/templates/email/fixamingata/update-confirm.txt @@ -0,0 +1,17 @@ +Subject: Bekräfta din uppdatering på [% INCLUDE 'site-name.txt' | trim %] + +Hej [% update.name %], + +vänligen klicka på länken nedan för att bekräfta den uppdatering du +just lämnade: + +[% token_url %] + +Om det inte går att klicka på länken kan du kopiera och klistra in +länken i adressfältet på din webbläsare. + +Din uppdatering var: + +[% update.text %] + +[% INCLUDE 'signature.txt' %] diff --git a/templates/web/default/maps/mapquest-attribution.html b/templates/web/default/maps/mapquest-attribution.html new file mode 100644 index 000000000..8ca4ea650 --- /dev/null +++ b/templates/web/default/maps/mapquest-attribution.html @@ -0,0 +1,14 @@ +[% map_js = BLOCK %] +<script type="text/javascript" src="[% version('/js/OpenLayers.fixmystreet.js') %]"></script> +<script type="text/javascript" src="[% version('/js/map-OpenLayers.js') %]"></script> +<script type="text/javascript" src="[% version('/js/map-OpenStreetMap.js') %]"></script> +<script type="text/javascript" src="[% version('/js/jquery.ba-hashchange.min.js') %]"></script> +<!--[if lte IE 6]> + <link rel="stylesheet" href="/jslib/OpenLayers-2.10/theme/default/ie6-style.css" type="text/css" /> +<![endif]--> +[% END %] + +[% map_html = BLOCK %] +[% INCLUDE maps/openlayers.html %] +<div class="olControlAttribution" style="position: absolute; z-index: 1005;">Data, imagery and map information provided by <a href="http://www.mapquest.com/">MapQuest</a> <img src="http://developer.mapquest.com/content/osm/mq_logo.png" />, <a href="http://openstreetmap.org/">Open Street Map</a> and contributors, <a href="http://opendatacommons.org/licenses/odbl/">ODbL</a></div> +[% END %] diff --git a/templates/web/default/report/new/councils_text_none.html b/templates/web/default/report/new/councils_text_none.html index 3c445b085..9293c03a7 100644 --- a/templates/web/default/report/new/councils_text_none.html +++ b/templates/web/default/report/new/councils_text_none.html @@ -8,6 +8,13 @@ [% loc("If you submit a problem here the subject and details of the problem will be public, but the problem will <strong>not</strong> be reported to the council."); %] +[% IF c.cobrand.moniker == 'fixamingata' AND all_body_names.size == 1 %] +[% + tprintf( + "Du kan istället kontakta %s via <a href='%s'>deras webbsida</a>.", + all_body_names.first, all_body_urls.first); +%] +[% ELSE %] [% tprintf( loc("You can help us by finding a contact email address for local problems for %s and emailing it to us at <a href='mailto:%s'>%s</a>."), @@ -16,4 +23,6 @@ c.cobrand.contact_email ); -%]</p> +%] +[% END %] +</p> diff --git a/templates/web/fixamingata/contact/address.html b/templates/web/fixamingata/contact/address.html new file mode 100644 index 000000000..7ee7f51af --- /dev/null +++ b/templates/web/fixamingata/contact/address.html @@ -0,0 +1,9 @@ +<div class="contact-details"> +<p>FixaMinGata är en tjänst som tillhandahålls av Föreningen Sambruk, en +förening med ca 100 medlemskommuner, med gemensamt intresse av e-tjänster. +Du kan kontakta Föreningen Sambruk via post:</p> + +<p>Föreningen Sambruk<br> +c/o Sandvikens kommun<br> +811 80 Sandviken</p> +</div> diff --git a/templates/web/fixamingata/contact/blurb.html b/templates/web/fixamingata/contact/blurb.html new file mode 100644 index 000000000..2e5054bcf --- /dev/null +++ b/templates/web/fixamingata/contact/blurb.html @@ -0,0 +1,7 @@ +<p> +Rapportera <strong>inte</strong> problem i din närmiljö genom det här formuläret. Breven går till Fixa Min Gata i stället för din kommun. Vill du rapportera ett problem i din närmiljö måste du <a href="/">gå till framsidan</a> och följa instruktionerna där. +</p> + +<p> +Vi vill gärna höra vad du tycker om FixaMinGata. Fyll i formuläret nedan och skicka in. +</p> diff --git a/templates/web/fixamingata/faq/faq-sv.html b/templates/web/fixamingata/faq/faq-sv.html new file mode 100755 index 000000000..897a6f4e5 --- /dev/null +++ b/templates/web/fixamingata/faq/faq-sv.html @@ -0,0 +1,120 @@ +[% INCLUDE 'header.html', title => loc('Frequently Asked Questions'), bodyclass => 'twothirdswidthpage' %] + +<div class="sticky-sidebar"> + <aside> + <ul class="plain-list"> + <li><a href="#faq">Vanliga frågor</a></li> + <li><a href="#practical">Praktiska frågor</a></li> + <li><a href="#organisation">Organisation</a></li> + <li><a href="#pul">Personuppgiftsombud</a></li> + <li><a href="/privacy">Offentlighet och kakor</a></li> + </ul> + </aside> +</div> + +<h1><a name="faq"></a>Vanliga frågor</h1> + <dl> + <dt>Vad är FixaMinGata?</dt> + <dd>FixaMinGata är en e-tjänst som hjälper människor se, diskutera och +till kommunen rapportera problem i deras närmiljö på ett enkelt sätt genom att +markera problemen på en karta. Tjänsten bygger på en förlaga från Storbritannien +där tjänsten lanserades i Februari 2007. I Norge lanserades den 2011 och i +Sverige 2013. +</dd> + <dt>Hur kommer jag i kontakt med FixaMinGata?</dt> + <dd>Använd vårt <a href="/contact">kontaktformulär</a>.</dd> + <dt>Vilken typ av problem ska jag rapportera i FixaMinGata?</dt> + <dd>FixaMinGata är främst anpassad för att rapportera fysiska +problem i din närmiljö, exempelvis sådant som är <strong>trasigt eller +smutsigt, sådant som behöver underhållas, lagas, städas eller rensas</strong>, +till exempel: + + <ul><li>Övergivna bilar och cyklar + <li>Graffiti + <li>Netskräpning + <li>Gatustädning, exempelvis trasigt glas på en cykelbana + <li>Trasiga gatulysen + <li>Hål i vägar och gångbanor + </ul> + </dd> + + <dt>Vad är inte FixaMinGata till för?</dt> + <dd>FixaMinGata är inte lämpligt för andra typer av problem än de som + anges ovan. Du måste kontakta din kommun eller fastighetsägare direkt för problem i stil + med: + + <ul> + <li>Brådskande och akuta problem + <li>Oljud i din närmiljö + <li>Brand och rök + <li>Förslag på nya vägar, farthinder, etc. + <li>Klaga på dina grannar + <li>Klaga på din kommun + <li>Droger, djurplågeri, stöld, eller andra kriminella aktiviteter. + </ul> + </dd> + + <dt>Hur använder jag e-tjänsten?</dt> + <dd>Efter att du angivit postnummer eller adress ser du en karta +över närområdet. Du kan se de problem som redan har rapporterats, eller +rapportera nya genom att klicka på kartan där problemet finns. +</dd> + <dt>Hur löses problem?</dt> + <dd>Problem som rapporteras skickas till berörd kommun via epost +eller direkt till deras datorsystem. Kommunen hanterar sedan problemet på +det sättet de vanligen arbetar med problem, exempelvis genom att delegera +det till rätt enhet inom kommunen som får i uppdrag att lösa problemet. +</dd> + <dt>Är det gratis?</dt> + <dd>Den här e-tjänsten är gratis att använda. Tjänsten tillhandahålls +av <a href="http://sambruk.se/">Föreningen Sambruk</a>, en förening för +kommunal samverkan kring e-tjänster. Totalt ingår runt 100 kommuner och +landsting i Sambruk.</dd> + + <dt>Kan jag använda FixaMinGata på min mobil?</dt> + <dd> + <p>FixaMinGata ska fungera direkt på din mobiltelefon och anpassar +storleken på skärmen automatiskt.</p> + </dd> + + </dl> + + <h2><a name="practical"></a>Praktiska frågor</h2> + <dl> + <dt>Jag arbetar på en kommun och är intresserad av att veta var ni skickar rapporter.</dt> + <dd>Du får gärna <a href="/contact">kontakta oss</a> så kan vi ge +information om var rapporter går idag. Du kan också kontakta oss för att +uppdatera de adresser vi använder.</dd> + + <dt>Jag arbetar på en kommun och vill få in rapporter från FixaMinGata i vårt verksamhetssystem.</dt> + <dd>FixaMinGata kan skicka rapporter till ert verksamhetssystem +via epost eller via ett automatiskt gränssnitt som kallas Open 311. De +flesta verksamhetssystem kan anpassas till detta för en mindre kostnad. +Du får gärna <a href="/contact">kontakta oss</a> så kan vi ge mer information +och hjälpa dig i kommunikationen med berörda parter.</dd> + </dl> + + <h2><a name="organisation"></a>Organisation</h2> + <dl> + <dt>Vem tillhandahåller FixaMinGata?</dt> + + <dd>Den här e-tjänsten tillhandahålls +av <a href="http://sambruk.se/">Föreningen Sambruk</a>, en förening för +kommunal samverkan kring e-tjänster. Totalt ingår runt 100 kommuner och +landsting i Sambruk. Tjänsten togs fram i samarbete med <a href="http://kivos.se/">KIVOS</a> och <a href="http://ffkp.se/">Föreningen fri kultur och programvara</a>.</dd> + + <dt>Finns källkoden tillgänglig?</dt> + <dd> +Programvaran bakom den här tjänsten är öppen programvara och tillgänglig +under Affero GPL (AGPL). Du kan <a href="http://github.com/MorusAB/fixmystreet">ladda ner</a> källkoden och hjälpa oss utveckla den. Du är också välkommen att använda den i dina egna projekt! +</dd> + </dl> + <h2><a name="pul"></a>Personuppgiftsombud</h2> + <dl> + <dt>Vem är personuppgiftsombud för FixaMinGata?</dt> + + <dd>Personuppgiftsombud är Claes-Olof Olsson som du kan kontakta via vårt <a href="/contact">kontaktformulär.</a></dd> + </dl> + + +[% INCLUDE 'footer.html' pagefooter = 'yes' %] diff --git a/templates/web/fixamingata/footer.html b/templates/web/fixamingata/footer.html new file mode 100644 index 000000000..d196d1c6d --- /dev/null +++ b/templates/web/fixamingata/footer.html @@ -0,0 +1,76 @@ + [% IF pagefooter %] + <footer role="content-info"> + <div class="tablewrapper bordered"> + <div id="footer-mobileapps"> + </div> + <div id="footer-help"> + + <ul> + <li> + <h4>Sekretess och kakor</h4> + <p>Vill du veta mer om det juridiska? Läs vår information <a href="/privacy">om sekretess och kakor</a></p> + </li> + <li> + <h4>[% loc('Are you a developer?') %]</h4> + <p>[% loc('Would you like to contribute to FixMyStreet? Our code is open source and <a href="http://github.com/mysociety/fixmystreet">available on GitHub</a>.') %]</p> + </li> + <li> + <h4>[% loc('Are you from a council?') %]</h4> + <p>Vill du veta mer om Fixa Min Gata eller hur det kan fungera för er kommun? <a href="/kommun">Läs mer om Fixa Min Gata för kommuner</a>.</p> + </li> + </ul> + </div> + </div> + </footer> + [% END %] + </div><!-- .content role=main --> + </div><!-- .container --> + </div><!-- .table-cell --> + + <div class="nav-wrapper"> + <div class="nav-wrapper-2"> + <div id="main-nav" role="navigation"> + <ul id="main-menu"> + <li><[% IF c.req.uri.path == '/' %]span[% ELSE %]a href="/"[% END %] class="report-a-problem-btn" + >[% loc("Report a problem") %]</[% c.req.uri.path == '/' ? 'span' : 'a' %]></li>[% + %]<li><[% IF c.req.uri.path == '/my' %]span[% ELSE %]a href="/my"[% END + %]>[% loc("Your reports") %]</[% c.req.uri.path == '/my' ? 'span' : 'a' %]></li>[% + %]<li><[% IF c.req.uri.path == '/reports' %]span[% ELSE %]a href="/reports"[% END + %]>[% loc("All reports") %]</[% c.req.uri.path == '/reports' ? 'span' : 'a' %]></li>[% + %]<li><[% IF c.req.uri.path == '/alert' %]span[% ELSE %]a href="/alert[% pc ? '/list?pc=' : '' %][% pc | uri %]"[% END + %]>[% loc("Local alerts") %]</[% c.req.uri.path == '/alert' ? 'span' : 'a' %]></li>[% + %]<li><[% IF c.req.uri.path == '/faq' %]span[% ELSE %]a href="/faq"[% END + %]>[% loc("Help") %]</[% c.req.uri.path == '/faq' ? 'span' : 'a' %]></li> + <li><a href="javascript:UserVoice.showPopupWidget();">Lämna förslag</a></li> + </ul> + </div> + </div> + </div> + +<!-- [% INCLUDE 'debug_footer.html' %] --> + </div> <!-- .wrapper --> +<script type="text/javascript"> + var uvOptions = {}; + (function() { + var uv = document.createElement('script'); uv.type = 'text/javascript'; uv.async = true; + uv.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'widget.uservoice.com/vflswzMnwvfytYBz1rNw.js'; + var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(uv, s); + })(); +</script> +</body> + +<!-- Piwik --> +<script type="text/javascript"> +var pkBaseURL = (("https:" == document.location.protocol) ? "https://piwik.ffkp.se/" : "http://piwik.ffkp.se/"); +document.write(unescape("%3Cscript src='" + pkBaseURL + "piwik.js' type='text/javascript'%3E%3C/script%3E")); +</script><script type="text/javascript"> +try { +var piwikTracker = Piwik.getTracker(pkBaseURL + "piwik.php", 12); +piwikTracker.trackPageView(); +piwikTracker.enableLinkTracking(); +} catch( err ) {} +</script><noscript><p><img src="http://piwik.ffkp.se/piwik.php?idsite=12" style="border:0" alt="" /></p></noscript> +<!-- End Piwik Tracking Code --> +<!-- Note, Piwik really should be changed so that we have one for beta and one for www --> + +</html> diff --git a/templates/web/fixamingata/header_extra.html b/templates/web/fixamingata/header_extra.html new file mode 100644 index 000000000..b3dec58a2 --- /dev/null +++ b/templates/web/fixamingata/header_extra.html @@ -0,0 +1 @@ +<link rel="Shortcut Icon" type="image/x-icon" href="/cobrands/fixamingata/favicon.ico"> diff --git a/templates/web/fixamingata/open311/index.html b/templates/web/fixamingata/open311/index.html new file mode 100644 index 000000000..995069ed2 --- /dev/null +++ b/templates/web/fixamingata/open311/index.html @@ -0,0 +1,146 @@ +[% INCLUDE 'header.html', title => 'Open311' %] + +<h1>[% loc('Open311 API for the mySociety FixMyStreet server') %]</h1> + +[% IF error %] +<p>[% tprintf( loc('Note: <strong>%s</strong>'), error ) %]</p> +[% END %] + +<p>[% loc('At the moment only searching for and looking at reports work.') %]</p> +<p>[% loc('This API implementation is work in progress and not yet stabilized. It will change without warnings in the future.') %]</p> + +<ul> +<li><a rel="nofollow" href="http://www.open311.org/">[% loc('Open311 initiative web page') %]</a></li> +<li><a rel="nofollow" href="http://wiki.open311.org/GeoReport_v2">[% loc('Open311 specification') %]</a></li> +</ul> + +<p>[% tprintf( loc('At most %d requests are returned in each query. The returned requests are ordered by requested_datetime, so to get all requests, do several searches with rolling start_date and end_date.'), c.config.RSS_LIMIT ) %]</p> + +<p>[% loc('The following Open311 v2 attributes are returned for each request: service_request_id, description, lat, long, media_url, status, requested_datetime, updated_datetime, service_code and service_name.') %]</p> + +<p>[% loc('In addition, the following attributes that are not part of the Open311 v2 specification are returned: agency_sent_datetime, title (also returned as part of description), interface_used, comment_count, requestor_name (only present if requestor allowed the name to be shown on this site).') %]</p> + +<p>[% loc('The Open311 v2 attribute agency_responsible is used to list the administrations that received the problem report, which is not quite the way the attribute is defined in the Open311 v2 specification.') %]</p> + +<p>[% tprintf( loc('With request searches, it is also possible to search for agency_responsible to limit the requests to those sent to a single administration. The search term is the administration ID provided by <a href="%s">MaPit</a>.'), c.config.MAPIT_URL ) %]</p> + +<p>[% loc('Examples:') %]</p> + +<ul> + +[% jurisdiction_id = 'fixamingata.se' %] +[% examples = [ + { + url = c.cobrand.base_url _ "/open311/v2/discovery.xml?jurisdiction_id=$jurisdiction_id", + info = 'discovery-information', + }, + { + url = c.cobrand.base_url _ "/open311/v2/services.xml?jurisdiction_id=$jurisdiction_id", + info = 'Lista alla feltyper, t ex Trasig lampa, hål i gatan osv', + }, + { + url = c.cobrand.base_url _ "/open311/v2/services.xml?jurisdiction_id=$jurisdiction_id&lat=59&long=18", + info = 'Lista feltyper för WGS84 koordinater latityd 59 longityd 18', + }, + { + url = c.cobrand.base_url _ "/open311/v2/requests/1.xml?jurisdiction_id=$jurisdiction_id", + info = 'Felrapport nummer 1', + }, + { + url = c.cobrand.base_url _ "/open311/v2/requests.xml?jurisdiction_id=$jurisdiction_id&status=open&agency_responsible=37&end_date=2013-04-10", + info = 'Alla öppna felrapporter innan 2013-04-10 för Stockholm (kommun-id 37)', + }, + { + url = c.cobrand.base_url _ "/open311/v2/requests.xml?jurisdiction_id=$jurisdiction_id&status=open&agency_responsible=37|38", + info = 'Alla öppna felrapporter för Stockholm (id 37) och Järfälla (id 38)', + }, + { + url = c.cobrand.base_url _ "/open311/v2/requests.xml?jurisdiction_id=$jurisdiction_id&service_code=Hål i gatan", + info = "Alla felrapporter av typen 'Hål i gatan'", + }, + { + url = c.cobrand.base_url _ "/open311/v2/requests.xml?jurisdiction_id=$jurisdiction_id&status=closed", + info = 'Alla stängda felrapporter', + }, +] %] +[% FOREACH examples %] + <li><a href="[% url %]">[% info %]</a> + [% IF url.match('/requests.xml') %] + [ <a href="http://maps.google.com/?q=[% url.replace('.xml', '.rss') | uri %]">[% loc('GeoRSS on Google Maps') %]</a> ] + [% END %] + <br>[% url | html %]</li> +[% END %] + +</ul> + +<h2>Searching</h2> + +<p>The following search parameters can be used:</p> + +<dl> + +<dt>service_request_id</dt> +<dd>Search for numeric ID of specific request. + Using this is identical to asking for a individual request using + the /requests/number.format URL.</dd> +<dt>service_code</dt> +<dd>Search for the given category / service type string.</dd> + +<dt>status</dt> +<dd>Search for open or closed (fixed) requests.</dd> + +<dt>start_date<dt> +<dd>Only return requests with requested_datetime set after or at the + date and time specified. The format is YYYY-MM-DDTHH:MM:SS+TZ:TZ.</dd> + +<dt>end_date<dt> +<dd>Only return requests with requested_datetime set before the date + and time specified. Same format as start_date.</dd> + +<dt>agency_responsible</dt> +<dd>ID of government body receiving the request. Several IDs can be + specified with | as a separator.</dd> + +<dt>interface_used<dt> +<dd>Name / identifier of interface used.</dd> + +<dt>has_photo<dt> +<dd>Search for entries with or without photos. Use value 'true' to +only get requests created with images, and 'false' to get those +created without images.</dd> + +<dt>max_requests</dt> +<dd>Max number of requests to return from the search. If it is larger +than the site specific max_requests value specified in the discovery +call, the value provided is ignored.</dd> + +<dl> + +<p>The search result might look like this:</p> + +<pre>[% " + <requests> + <request> + <agency_responsible> + <recipient>Stockholm</recipient> + </agency_responsible> + <agency_sent_datetime>2012-11-16T10:35:12,534712Z</agency_sent_datetime> + <description>Test: Test</description> + <detail>Test</detail> + <interface_used>Web interface</interface_used> + <lat>59.336044310435</lat> + <long>18.05058735521</long> + <requested_datetime>2012-11-16T10:31:30,702990Z</requested_datetime> + <requestor_name>Jonas Öberg</requestor_name> + <service_code>Trasig gatubelysning</service_code> + <service_name>Trasig gatubelysning</service_name> + <service_request_id>10</service_request_id> + <status>open</status> + <title>Test</title> + <updated_datetime>2012-11-16T10:35:12,534712Z</updated_datetime> + </request> + </requests> +" | html %]</pre> + +[% INCLUDE 'footer.html' %] + diff --git a/templates/web/fixamingata/report/new/fill_in_details_form.html b/templates/web/fixamingata/report/new/fill_in_details_form.html new file mode 100644 index 000000000..eea1da8d2 --- /dev/null +++ b/templates/web/fixamingata/report/new/fill_in_details_form.html @@ -0,0 +1,218 @@ +<div id="report-a-problem-main"> + <h1>[% loc('Reporting a problem') %]</h1> + + [% IF js %] + <p id="councils_text"> + [% + tprintf( + loc('All the information you provide here will be sent to <strong>%s</strong>.'), + loc('the local council') + ); + %] + [% loc('The subject and details of the problem will be public, plus your name if you give us permission.') %] + </p> + [% ELSE %] + [% PROCESS 'report/new/councils_text.html' %] + [% END %] + + [% IF c.cobrand.moniker != 'fixmybarangay' || ( c.user && c.user.from_council ) %] + <div id="report-a-problem-sidebar"> + <!-- + The text for this section needs checking, but I can't work out which bit comes from where + --> + <div class="sidebar-tips"> + [% IF report.used_map %] + [% IF partial_token %] + <p id="unknown">[% loc('Please note your report has <strong>not yet been sent</strong>. Choose a category and add further information below, then submit.') %]</p> + [% END %] + <p>[% loc('You have located the problem at the point marked with a green pin on the map. If this is not the correct location, simply click on the map again. ') %]</p> + [% END %] + + <p> + [% IF report.used_map %] + [% INCLUDE 'report/new/fill_in_details_text.html' %] + [% ELSE %] + [% loc('Please fill in the form below with details of the problem, and describe the location as precisely as possible in the details box.') %] + [% END %] + </p> + </div> + + <div class="sidebar-notes"> + [% INCLUDE 'report/new/notes.html' %] + </div> + + </div> + [% END %] + + [% INCLUDE 'errors.html' %] + <fieldset> + <div id="problem_form"> + + [% INCLUDE 'report/new/form_heading.html' %] + + + [% IF field_errors.council %] + <p class='form-error'>[% field_errors.council %]</p> + [% END %] + + + + <label for="form_title">[% loc('Subject') %]</label> + [% IF field_errors.title %] + <p class='form-error'>[% field_errors.title %]</p> + [% END %] + <input type="text" value="[% report.title | html %]" name="title" id="form_title" placeholder="[% loc('Provide a title') %]" required> + + <label for="form_detail">[% loc('Details') %]</label> + [% IF field_errors.detail %] + <p class='form-error'>[% field_errors.detail %]</p> + [% END %] + <textarea rows="7" cols="26" name="detail" id="form_detail" placeholder="[% loc('Please fill in details of the problem.') %]" required>[% report.detail | html %]</textarea> + + [% IF js %] + <div id="form_category_row"> + <label for="form_category">[% loc('Category') %]</label> + <select name="category" id="form_category" required><option>[% loc('Loading...') %]</option></select> + </div> + [% ELSE %] + [% IF category_options.size %] + [% IF field_errors.category %] + <p class='form-error'>[% field_errors.category %]</p> + [% END %] + + [% PROCESS "report/new/category.html" %] + [% END %] + [% END %] + + [%- IF category_extras %] + [% PROCESS "report/new/category_extras.html" %] + [%- END %] + + [% IF c.cobrand.allow_photo_upload %] + [% IF field_errors.photo %] + <p class='form-error'>[% field_errors.photo %]</p> + [% END %] + + + [% IF upload_fileid || report.photo %] + [% IF upload_fileid %] + <img align="right" src="/photo/[% upload_fileid %].temp.jpeg" alt=""> + <input type="hidden" name="upload_fileid" value="[% upload_fileid %]"> + [% END %] + + <p>[% loc('You have already attached a photo to this report, attaching another one will replace it.') %]</p> + + [% IF report.photo %] + <img align="right" src="/photo/[% report.id %].jpeg"> + [% END %] + [% END %] + + <label for="form_photo">[% loc('Photo') %]</label> + <input type="file" name="photo" id="form_photo"> + [% END %] + + [% IF c.user_exists %] + <div class="form-box"> + + [% INCLUDE 'report/new/extra_name.html' %] + + <label for="form_name">[% loc('Name') %]</label> + [% IF field_errors.name %] + <p class='form-error'>[% field_errors.name %]</p> + [% END %] + <input type="text" class="validName" value="[% report.name | html %]" name="name" id="form_name" placeholder="[% loc('Your name') %]"> + + [%# if there is nothing in the name field then set check box as default on form %] + <div class="checkbox-group"> + <input type="checkbox" name="may_show_name" id="form_may_show_name" value="1"[% ' checked' IF !report.anonymous %]> + <label class="inline" for="form_may_show_name">[% loc('Show my name publicly') %]</label> + </div> + + [% IF c.cobrand.moniker != 'fixmybarangay' || ( c.user && c.user.from_council ) %] + <div class="general-sidebar-notes"> + <p>[% loc('We never show your email address or phone number.') %]</p> + </div> + [% END %] + + <label for="form_phone">[% loc('Phone number (optional)') %]</label> + <input class="" type="text" value="[% report.user.phone | html %]" name="phone" id="form_phone" placeholder="[% loc('Your phone number') %]"> + + <div class="form-txt-submit-box"> + <input class="green-btn" type="submit" id="submit_register" name="submit_register" value="[% loc('Submit') %]"> + </div> + </div> + [% ELSE %] + + <label for="form_email">[% loc('Your email') %]</label> + [% IF field_errors.email %] + <p class='form-error'>[% field_errors.email %]</p> + [% END %] + <input type="email" value="[% report.user.email | html %]" name="email" id="form_email" placeholder="[% loc('Please enter your email address') %]" required> + + <div id="form_sign_in"> + <h3>[% loc("Now to submit your report…") %]</h3> + + <div id="form_sign_in_no" class="form-box"> + <h5>Om du inte har ett lösenord fyller du i ditt namn och eventuellt telefonnummer och nytt lösenord (valfria) här. När du skickar din rapport får du epost med en länk som du måste klicka på för att bekräfta rapporten. Om du redan har ett lösenord fyller du i detta längre ner på sidan och behöver då inte bekräfta rapporten.</h5> + + [% INCLUDE 'report/new/extra_name.html' %] + + <label for="form_name">[% loc('Name') %]</label> + [% IF field_errors.name %] + <p class='form-error'>[% field_errors.name %]</p> + [% END %] + + <input type="text" class="form-focus-trigger validName" value="[% report.name | html %]" name="name" id="form_name" placeholder="[% loc('Your name') %]"> + + [%# if there is nothing in the name field then set check box as default on form %] + <div class="checkbox-group"> + <input type="checkbox" name="may_show_name" id="form_may_show_name" value="1"[% ' checked' IF !report.anonymous %]> + <label class="inline" for="form_may_show_name">[% loc('Show my name publicly') %]</label> + </div> + + <div class="general-sidebar-notes form-focus-hidden"> + <p class="dark">[% loc('We never show your email address or phone number.') %]</p> + <p>[% loc('Providing a password is optional, but doing so will allow you to more easily report problems, leave updates and manage your reports.') %]</p> + </div> + + <label for="form_phone">[% loc('Phone number (optional)') %]</label> + <input type="text" value="[% report.user.phone | html %]" name="phone" id="form_phone" placeholder="[% loc('Your phone number') %]"> + + <label for="password_register">[% loc('Password (optional)') %]</label> + + <div class="form-txt-submit-box"> + <input type="password" name="password_register" id="password_register" value="" placeholder="[% loc('Enter a password') %]"> + <input class="green-btn" type="submit" id="submit_register" name="submit_register" value="[% loc('Submit') %]"> + </div> + </div> + <div id="form_sign_in_yes" class="form-box"> + + <h5>Jag har ett lösenord sedan tidigare:</h5> + + <label class="hidden-js n" for="password_sign_in">[% loc('Yes I have a password') %]</label> + <div class="form-txt-submit-box"> + [% IF field_errors.password %] + <p class='form-error'>[% field_errors.password %]</p> + [% END %] + <input type="password" name="password_sign_in" id="password_sign_in" placeholder="[% loc('Your password') %]" value=""> + <input class="green-btn" type="submit" id="submit_sign_in" name="submit_sign_in" value="[% loc('Submit') %]"> + </div> + + <div class="checkbox-group"> + <input type="checkbox" id="remember_me" name="remember_me" value='1'[% ' checked' IF remember_me %]> + <label class="n inline" for="remember_me">[% loc('Keep me signed in on this computer') %]</label> + </div> + </div> + + </div> + + [% END %] + </div> + </fieldset> + + [% IF partial_token %] + <input type="hidden" name="partial" value="[% partial_token.token %]"> + [% END %] + + <input type="hidden" name="submit_problem" value="1"> +</div> diff --git a/templates/web/fixamingata/report/new/notes.html b/templates/web/fixamingata/report/new/notes.html new file mode 100644 index 000000000..8f081f637 --- /dev/null +++ b/templates/web/fixamingata/report/new/notes.html @@ -0,0 +1,14 @@ +<p>[% loc("Please note:") %]</p> + +<ul class="plain-list"> + <li>[% loc("We will only use your personal information in accordance with our <a href=\"/privacy\">privacy policy.</a>") %]</li> + <li>[% loc("Please be polite, concise and to the point.") %]</li> + <li>[% loc("Please do not be abusive — abusing your council devalues the service for all users.") %]</li> + <li>[% loc("Writing your message entirely in block capitals makes it hard to read, as does a lack of punctuation.") %]</li> +[% IF all_councils.items.first > 0 %] + <li>[% id = all_councils.items.first; + tprintf("Kom ihåg att FixaMinGata primärt är avsett för att rapportera fysiska problem som kan åtgärdas. Om ditt problem inte lämpar sig för att rapportera via den här webbsidan kan du kontakta din kommun direkt via <a href='%s'>deras webbsida</a>.", all_body_urls.$id); %]</li> +[% ELSE %] + <li>[% loc("Remember that FixMyStreet is primarily for reporting physical problems that can be fixed. If your problem is not appropriate for submission via this site remember that you can contact your council directly using their own website.") %]</li> +[% END %] +</ul> diff --git a/templates/web/fixamingata/static/council.html b/templates/web/fixamingata/static/council.html new file mode 100755 index 000000000..6417a8fb5 --- /dev/null +++ b/templates/web/fixamingata/static/council.html @@ -0,0 +1,214 @@ +[% INCLUDE 'header.html', title => loc('För kommuner'), bodyclass => 'twothirdswidthpage' %] + +<div class="sticky-sidebar"> + <aside> + <ul class="plain-list"> + <li><a href="#kommuner">Deltagande kommuner</a></li> + <li><a href="#nykommun">Checklista för nya kommuner</a></li> + <li><a href="#process">Förklaring av rapporteringsprocessen</a></li> + <li><a href="#kategorier">Kategorier av fel</a></li> + <li><a href="#integration">Integration med verksamhetssystem</a></li> + <li><a href="#kostnader">Kostnader</a></li> + <li><a href="#kontakt">Kontaktpersoner</a></li> + </ul> + </aside> +</div> + +<h1>Information för kommuner</h1> + +<p> +Fixa Min Gata är en e-tjänst som drivs av +<a href="http://sambruk.se/">Föreningen Sambruk</a> och är framtagen i +samarbete med <a href="http://kivos.se/">KIVOS</a> och +<a href="http://ffkp.se/">FFKP</a>. Invånare i medverkande kommuner kan +använda e-tjänsten för att rapportera fel i sin lokala gatumiljö. I och +med att tjänsten drivs som en molntjänst kan den snabbt driftsättas för +en ny kommun. Fel som rapporteras skickas via e-post till berörd enhet +på kommunen. För kommuner som har befintliga verksamhetssystem för +rapportering och uppföljning finns flera möjligheter att integrera +systemen med varandra. +</p> + +<h2><a name="kommuner"></a>Kommuner</h2> +<p> +Fixa Min Gata stödjer samtliga Svenska kommuner, men hur det ser ut hos +varje kommun ser lite olika ut. En del kommuner väljer att inte ta emot +rapporter via Fixa Min Gata utan hänvisar istället medborgarna till sin +egen webbsida. I dessa fall ger Fixa Min Gata en länk till kommunens +webbsida om en medborgare försöker rapportera ett fel. +</p> +<p> +Andra kommuner har valt att vara med i styrgruppen för Fixa Min Gata +vilket ger dem möjlighet att påverka utvecklingen och den framtida +inriktningen, exempelvis för att bättre kunna integrera Fixa Min Gata +i sina egna verksamhetssystem. +</p> +<p> +De kommuner som var med i den ursprungliga +referensgruppen var Alingsås, Falköping, Tidaholm, Vårgårda, Aneby, +Eksjö, Gislaved, Gnosjö, Habo, Mullsjö, Nässjö, Sävsjö, Tranås, +Vaggeryd, Vetlanda och Värnamo. +</p> + +<h2><a name="nykommun"></a>Ny kommun</h2> +<p> + Här följer en checklista som kommuner kan använda sig av när de tittar på + hur Fixa Min Gata kan användas i kommunen. Eventuella frågor eller hjälp + i processen kan fås från Fixa Min Gatas <a href="#kontakt">kontaktpersoner</a>. +</p> +<p> + <ul> + <li>Fixa Min Gata använder + <a href="http://www.openstreetmap.org/">Open Street Map</a> för sin + kartinformation. Verifiera så att de kartor som finns för kommunen + är relevanta. Om det finns fel i kartinformationen går detta att + korrigera, av kommunen själva eller i samarbete med invånarna.</li> + <li>Fixa Min Gata låter medborgarna välja position genom att ange postnummer. + Dessvärre finns det ingen publik lista över postnummer och dess + geografiska koordinater som är tillgänglig att använda för vem som helst + och en del koordinater kan därför vara fel. Verifiera genom att välja + ett par postnummer i kommunen och mata in dem i Fixa Min Gata för att + se hur det ser ut i er kommun. Om något postnummer inte centrerar på + rätt geografisk koordinat går detta att ändra. Kontakta Fixa Min Gatas + <a href="#kontakt">kontaktpersoner</a> för mer information om detta.</li> + <li>För kommuner som har ett eget verksamhetssystem finns möjlighet att + integrera Fixa Min Gata med detta. Kontakta leverantören av + verksamhetssystemet för att fråga om integration med Fixa Min Gata. + Det finns flera sätt på vilket detta kan ske och du kan få mer + information från Fixa Min Gatas <a href="#kontakt">kontaktpersoner</a>. + </li> + <li>Titta på den lista med <a href="#kategorier">kategorier</a> som finns + i Fixa Min Gata och fundera över om några förändringar behövs i den + listan. Det finns möjigheter att förändra den listan per kommun.</li> + <li>Om felrapporter från invånarna ska skickas via epost till kommunen, + bestäm vilka adresser som information ska skickas till och om det är + samma adress för samtliga kategorier eller om olika kategorier ska + skickas till olika adresser.</li> + <li>Prata med och informera de anställda som kommer att ta emot och arbeta + med felrapporter. Säkerställ att alla är på det klara med hur kommunen + arbetar med inkomna felrapporer och vikten av att fel också rapporteras + som åtgärdat när arbetet är klart.</li> + <li>Bjud in de anställda att vara med i den första testen av systemet så att + de som vill kan testa att rapportera fel och följa upp ärenden. Det kan + ske under ett par veckor innan systemet driftsätts helt för att ge + personalen möjlighet att bli komfortabel med systemet först.</li> + <li>Prata med kommunens informationsansvarige eller motsvarande för att + länka till Fixa Min Gata från kommunens hemsida. Logotyper för FixaMinGata + kan hämtas från <a + href="http://www.sambruk.se/projektnatverk/fixamingata/projektdokument.4.7b34e07a139d0d50e8b23cb.html?folder=19.7b34e07a139d0d50e8b23b1&sv.url=12.7b34e07a139d0d50e8b23d1">här</a>.</li> + <li>Följ upp löpande under den första tiden med de personer som från + kommunen tar emot felrapporter. Du kan också ta hjälp av den + <a href="/reports">statistik</a> som publiceras i Fixa Min Gata för + att se vilka problem som rapporteras samt om de markeras som åtgärdade. + </li> + </ul> +</p> + + +<h2><a name="process"></a>Rapporteringprocess</h2> +<p> + +Fixa Min Gata erbjuder ett enkelt sätt för en invånare att rapportera ett fel +vilket sedan kommuniceras till kommunen. En visuell beskrivning av processen +finns tillgänglig på <a +href="http://www.sambruk.se/projektnatverk/fixamingata/projektdokument.4.7b34e07a139d0d50e8b23cb.html?folder=19.7b34e07a139d0d50e8b23b1&sv.url=12.7b34e07a139d0d50e8b23d1"> +Sambruks projeksida för FixaMinGata</a>. + +Nedanstående flöde beskriver hur FixaMinGata fungerar utifrån invånarens +perspektiv. + +</p> +<p> + <ol> + <li>En invånare söker på postnummer eller gatuadress och får upp en karta + över närområdet.</li> + <li>Invånaren kan se befintliga felrapporter inom området.</li> + <li>Om invånaren klickar på en position på kartan ges möjlighet att rapportera ett nytt fel.</li> + <li>Invånaren väljer en av de kategorier som finns, skriver in information om felet och bifogar eventuellt ett foto.</li> + <li>Om invånaren inte tidigare har rapporterat ett fel eller om invånaren valt att inte skapa ett konto i tjänsten skickas epost till invånaren med en länk som måste klickas på för att bekräfta felet.</li> + <li>När felet är bekräftat skickas detta till kommunen.</li> + <li>Andra invånare kan se felet och bifoga uppdateringar eller kommentarer.</li> + <li>När kommunen har åtgärdat felet eller engagerat sig på annat sätt kan kommunen lämna uppdateringar eller markera felet som åtgärdat.</li> + <li>Invånaren får information via epost om att felet är åtgärdat.</li> + </ol> +</p> + +<h2><a name="kategorier"></a>Kategorier</h2> +<p> +Följande kategorier finns för alla kommuner i Fixa Min Gata. +En del kommuner väljer andra kategorier beroende på vad som passar dem +bäst. +</p> +<p> + <ul> + <li>Buss- och tågstopp + <li>Cykelställ + <li>Cykelväg + <li>Dumpat skräp + <li>Gatlyse + <li>Gator och vägar + <li>Grafitti/taggning + <li>Hål i väg + <li>Igensatt brunn + <li>Nedskräpning + <li>Offentlig toalett + <li>Oljespill + <li>Parkering + <li>Park/landskap + <li>Snöplogning + <li>Trafiklyse + <li>Trafikskylt + <li>Träd + <li>Trottoar/gångbana + <li>Vattenförsörjning + <li>Vägstädning + <li>Vägnamnsskylt + <li>Övergiven bil + <li>Övrigt + </ul> + +<h2><a name="integration"></a>Integration med verksamhetssystem</h2> +<p> + För <strong>kommuner som har ett eget verksamhetssystem</strong> + finns det flera olika sätt att integrera detta med Fixa Min Gata. + Det enklaste, vilket stödjs av i princip samtliga verksamhetssystem, är + att Fixa Min Gata skickar epost till verksamhetssystemet när någon + lämnar en rapport vilket sedan görs till ett ärende i systemet. När + rapporten är åtgärdad rapporterar kommunen detta i sitt verksamhetssystem + <strong>samt</strong> i Fixa Min Gata. +</p> +<p> + Det finns också möjlighet att på olika sätt integrera systemen så att en + rapport som avslutas i verksamhetssystemet också markeras som åtgärdad + i Fixa Min Gata. Beroende på verksamhetssystem kan en viss kostnad utgå + för detta från leverantören. Ta kontakt med din leverantör av + verksamhetssystem för att höra dig för. +</p> +<p> + Vi har också tagit fram en sida med + <a href="https://wiki.ffkp.se/index.php?title=Open311_och_annan_integration_mot_FixaMinGata">teknisk information om integration av Fixa Min Gata</a> som + kan vara lämplig att titta på för mer information. +</p> + +<h2><a name="kostnader"></a>Kostnader för medverkan</h2> +<p> + Kommuner som är med i styrgruppen för Fixa Min Gata betalar en kostnad + per invånare, vilket täcker kostnaden för drift och utveckling. För mer + information + om kostnader och deltagande, kontakta våra <a href="#kontakt">kontaktpersoner</a>. + +<h2><a name="kontakt"></a>Kontaktpersoner</h2> +<p> + Du kan alltid kontakta oss genom <a + href="mailto:info@fixamingata.se">info@fixamingata.se</a>. Vi ser då + till att din fråga behandlas och kommer till rätt person. +</p> +<p> + För frågor kring medverkan, villkor och kostnader, kontakta Claes-Olof Olsson, Sambruk via e-postadressen <a href="mailto:claes-olof.olsson@sambruk.se">claes-olof.olsson@sambruk.se</a> eller ledningen för styrgruppen på <a href="mailto:info@fixamingata.se">info@fixamingata.se</a>. +</p> +<p> + För tekniska frågor om plattformen, integration med verksamhetssystem eller + uppdaterade kontakt uppgifter, använda vårt <a href="/contact">kontaktformulär</a>. +</p> + +[% INCLUDE 'footer.html' pagefooter = 'yes' %] diff --git a/templates/web/fixamingata/static/fun.html b/templates/web/fixamingata/static/fun.html new file mode 100644 index 000000000..ff8f30e49 --- /dev/null +++ b/templates/web/fixamingata/static/fun.html @@ -0,0 +1,35 @@ +[% INCLUDE header.html + title = 'Udda och imponerande rapporter' +%] + +<h1>Udda och imponerande rapporter</h1> + +<p> +Här är några av de bästa och mest udda rapporter som har synts på +den engelska FixMyStreet. Meddela oss om du hittar några liknande +rapporter på svenska FixaMingata!</p> + +<ul class="plain-list"> + + <li><img src='http://www.fixmystreet.com/photo/9468.jpeg' align='right' hspace=8> + <h2>Dumped Piano (right)</h2> + <p>The reporter of this problem summed it up with their report, + which consisted solely of the one character “!”. — + <a href='http://www.fixmystreet.com/report/9468'>Problem report</a> + + <li><h2>Mad Seagull</h2> + <p>“A seagull is attacking various cars within this road. He starts at around 05:45 every morning and continues until around 19:30. This causes a lot of noisy banging and wakes up children.” — + <a href='http://www.fixmystreet.com/report/2722'>Problem report</a> + + <li><img src='http://www.fixmystreet.com/photo/6553.jpeg' align='right' hspace=8> + <h2>Boxes full of cheese dumped (right)</h2> + <p>“About a dozen boxes full of mozzarella cheese have been dumped opposite 3 rufford street. if it warms up we could have nasty road topping problem (seriously there is a lot of cheese)” — + <a href='http://www.fixmystreet.com/report/6553'>Problem report</a> + + <li><h2>Dangerous Nivea Billboard</h2> + <p>“The Nivea 'Oxygen is a wonderful thing' billboard here has a device on it releasing bubbles and foam. This is blowing into the road which is both distracting and dangerous to drivers. A large ball of foam hit my windscreen unexpectedly and nearly caused me to have an accident” — + <a href='http://www.fixmystreet.com/report/7552'>Problem report</a> +</ul> + +[% INCLUDE footer.html %] + diff --git a/templates/web/fixamingata/static/privacy.html b/templates/web/fixamingata/static/privacy.html new file mode 100755 index 000000000..2a3c88071 --- /dev/null +++ b/templates/web/fixamingata/static/privacy.html @@ -0,0 +1,82 @@ +[% INCLUDE 'header.html', title => loc('Vanliga Frågor'), bodyclass => 'twothirdswidthpage' %] + +<div class="sticky-sidebar"> + <aside> + <ul class="plain-list"> + <li><a href="/faq#faq">Vanliga frågor</a></li> + <li><a href="/faq#practical">Praktiska frågor</a></li> + <li><a href="/faq#organisation">Organisation</a></li> + <li><a href="/faq#pul">Personuppgiftsombud</a></li> + <li><strong>Offentlighet och kakor</strong></li> + </ul> + </aside> +</div> + +<h1>Offentlighet, kakor och tredjepartstjänster</h1> + +<p><strong>Vår användning av din information och vad du behöver veta.</strong></p> + +<p>Sammanfattning: Vi bryr oss om våra användares privatliv. Du kan läsa +mer detaljer om det här nedan. Vi gör vårt bästa för säkra den privata +information som vi har i vår databas. Precis som många andra webbplatser +använder vi ibland kakor för att hjälpa oss göra +tjänsten bättre. De här verktygen är väldigt vanliga och används av många +andra tjänster, men det finns nackdelar med dem och vi är måna om att du +förstår hur din data används.</p> + +<h2>Offentlighet och personuppgifter</h2> + <dl> + <dt>Hur hanteras mina personuppgifter?</dt> + <dd>Dina personuppgifter hanteras med största försiktighet. Din +epostadress och namn lagras i vår databas. Du har rätt att begära att få +ta del av de uppgifter som finns registrerade om dig genom att kontakta vårt +personuppgiftsombud.</dd> + + <dt>Hur hanteras min information hos Fixa Min Gata?</dt> + <dd>Vi kommer att visa en rapports ärende och information publikt. Vi kommer dock inte att visa din e-postadress eller ditt namn, om du inte ger oss tillsånt att visa ditt namn.</dd> + + <dt>Hur hanteras min information hos kommunen?</dt> + <dd>All information du anger kring ett problem kommer att skickas till berörd kommun. Alla handlingar som inkommer till en kommun betraktas som offentliga och därmed kommer också alla rapporter från Fixa Min Gata att vara offentliga via den berörda kommunen.</dd> + </dl> + +<h2>Sekretess</h2> + + <dl> + <dt>Vem ser min epostadress?</dt> + <dd>Om du rapporterar ett problem kommer vi att skicka din +information och information om problemet till den kommun som är ansvarig +för det område där du lokaliserat problemet. Förutom kommunen, som +givetvis får se din epostadress, kommer personer som är ansvariga för +tjänsten FixaMinGata att kunna se din epostadress. Ingen kommer att +använda din epostadress för något annat än för att kunna administrera +FixaMinGata. Vi kommer inte ge ut eller sälja din epostadress till någon +annan om vi inte blir tvingade till det av domstol. Ditt namn, som du +anger det, kommer inte att publiceras om du inte vill att vi publicerar +det. Observera dock att om du skriver ditt namn någon annan stans, +exempelvis i informationen om en rapport, kommer det att bli publik +synligt.</dd> + + <dt>Kommer ni att skicka spam?</dt> + <dd>Aldrig. Vi kommer att skicka brev till dig om någon lämnar +en uppdatering på ett problem som du rapporterat, och skicka dig ett +frågeformulär fyra veckor efter din rapportering där vi frågar om +uppdatering. Vi kommer endast att skicka brev i relation till ditt problem.</dd> + + </dl> + +<h2>Kakor</h2> + +<p>För att göra våra tjänster lättare och mer användbara skickar vi +ibland små datafiler till din dator eller mobiltelefon. Dessa kallas för +kakor och de flesta webbplatser använder dem. Vi använder den här +informationen för att, till exempel, komma ihåg när du har loggat in +så att du slipper göra det på varje sida, och för att mäta hur +tjänsten används så att vi kan förbättra den. Nedan ger vi en lista med +de kakor som den här tjänsten använder. + +<table cellpadding=5> +<tr align="left"><th scope="col">Namn</th><th scope="col">Innehåll</th><th scope="col">Giltighet</th></tr> +<tr><td>fixmystreet_app_session</td><td nowrap>A slumpvis sträng</td><td>Raderas när webbläsaren stängs, eller efter fyra veckor om “Håll mig inloggad” är valt</td></tr> +</table> + +[% INCLUDE 'footer.html' pagefooter = 'yes' %] diff --git a/templates/web/fixmystreet/header.html b/templates/web/fixmystreet/header.html index 5474c5cff..e0d0e7af2 100644 --- a/templates/web/fixmystreet/header.html +++ b/templates/web/fixmystreet/header.html @@ -39,6 +39,7 @@ <link rel="canonical" href="http://www.fixmystreet.com[% c.req.uri.path_query %]"> [% END %] + [% TRY %][% PROCESS 'header_extra.html' %][% CATCH file %][% END %] [% INCLUDE 'tracking_code.html' %] </head> diff --git a/templates/web/fixmystreet/report/_item.html b/templates/web/fixmystreet/report/_item.html index 852633f76..8e2e73a8d 100644 --- a/templates/web/fixmystreet/report/_item.html +++ b/templates/web/fixmystreet/report/_item.html @@ -6,7 +6,12 @@ <img class="img" height="60" width="90" src="[% photo.url_fp %]" alt=""> [% END %] <h4>[% problem.title | html %]</h4> - <small>[% prettify_dt( problem.confirmed, 1 ) %] + <small> + [% IF c.cobrand.moniker != 'fixamingata' %] [%# Default: %] + [%- prettify_dt( problem.confirmed, 1 ) %] + [% ELSE %] [%# Swedish cobrand fixamingata: %] + [%- prettify_dt( problem.confirmed) %] + [% END %] [%- IF dist %], [% dist %]km[% END %] [%- IF include_lastupdate AND problem.confirmed != problem.lastupdate AND problem.whensent != problem.lastupdate %], [% tprintf(loc('last updated %s'), prettify_dt( problem.lastupdate, 1 ) ) %] diff --git a/templates/web/fixmystreet/report/updates-sidebar-notes.html b/templates/web/fixmystreet/report/updates-sidebar-notes.html index bdbcae518..9f2420392 100644 --- a/templates/web/fixmystreet/report/updates-sidebar-notes.html +++ b/templates/web/fixmystreet/report/updates-sidebar-notes.html @@ -1,5 +1,7 @@ <p> - [% IF ( problem.bodies_str != '2482' AND !problem.bodies_str.match('2347') ) OR problem.send_method_used != 'Open311' %] + [% IF c.cobrand.moniker != 'fixamingata' %] + [% IF problem.send_method_used != 'Open311' OR c.cobrand.moniker != 'fixmystreet' OR ( problem.bodies_str != '2482' AND !problem.bodies_str.match('2347') ) %] [% loc( 'Please note that updates are not sent to the council.' ) %] [% END %] + [% END %] [% loc( 'Your information will only be used in accordance with our <a href="/privacy">privacy policy</a>' ) %]</p> diff --git a/web/cobrands/fixamingata/_colours.scss b/web/cobrands/fixamingata/_colours.scss new file mode 100644 index 000000000..31615c012 --- /dev/null +++ b/web/cobrands/fixamingata/_colours.scss @@ -0,0 +1,10 @@ +/* COLOURS */ + +$primary: #00b1da; +$primary_b: #0087a6; +$primary_text: #222; + +$col_click_map: #00BD08; +$col_click_map_dark: #4B8304; +$col_fixed_label: #00BD08; +$col_fixed_label_dark: #4B8304; diff --git a/web/cobrands/fixamingata/base.scss b/web/cobrands/fixamingata/base.scss new file mode 100644 index 000000000..73ef7ea13 --- /dev/null +++ b/web/cobrands/fixamingata/base.scss @@ -0,0 +1,31 @@ +/* Base stylesheet for FixMyStreet look + * + * In a mobile first way, this contains the look of the site, and a basic + * layout for browsers that can't handle media queries. Baseline grid of 1.5em. + */ + +$image-sprite: '/cobrands/fixamingata/images/sprite.png'; + +@import "../sass/h5bp"; +@import "./_colours"; +@import "../sass/mixins"; +@import "compass"; + +@import "../sass/base"; + +#site-header { + @include background(linear-gradient(#000, #ccc 10%, #ccc 90%, #000)); +} + +#site-logo { + width: 185px; + margin-top: 8px; + margin-left: 10px; + background: url('/cobrands/fixamingata/images/fms-logo.png') no-repeat; +} + +#front-main { + a#geolocate_link { + font-size: 0.9em; + } +} diff --git a/web/cobrands/fixamingata/config.rb b/web/cobrands/fixamingata/config.rb new file mode 100644 index 000000000..471b4b008 --- /dev/null +++ b/web/cobrands/fixamingata/config.rb @@ -0,0 +1,25 @@ +# Require any additional compass plugins here. + +# Set this to the root of your project when deployed: +http_path = "/" +css_dir = "" +sass_dir = "" +images_dir = "" +javascripts_dir = "" + +# You can select your preferred output style here (can be overridden via the command line): +# output_style = :expanded or :nested or :compact or :compressed + +# To enable relative paths to assets via compass helper functions. Uncomment: +# relative_assets = true + +# To disable debugging comments that display the original location of your selectors. Uncomment: +# line_comments = false + +# If you prefer the indented syntax, you might want to regenerate this +# project again passing --syntax sass, or you can uncomment this: +# preferred_syntax = :sass +# and then run: +# sass-convert -R --from scss --to sass sass scss && rm -rf sass && mv scss sass + +line_comments = false # by Compass.app
\ No newline at end of file diff --git a/web/cobrands/fixamingata/favicon.ico b/web/cobrands/fixamingata/favicon.ico Binary files differnew file mode 100644 index 000000000..f7dfd0697 --- /dev/null +++ b/web/cobrands/fixamingata/favicon.ico diff --git a/web/cobrands/fixamingata/favicon.png b/web/cobrands/fixamingata/favicon.png Binary files differnew file mode 100644 index 000000000..2c9ad9f68 --- /dev/null +++ b/web/cobrands/fixamingata/favicon.png diff --git a/web/cobrands/fixamingata/images/fms-logo.png b/web/cobrands/fixamingata/images/fms-logo.png Binary files differnew file mode 100644 index 000000000..92634c173 --- /dev/null +++ b/web/cobrands/fixamingata/images/fms-logo.png diff --git a/web/cobrands/fixamingata/images/sprite.png b/web/cobrands/fixamingata/images/sprite.png Binary files differnew file mode 100644 index 000000000..ebfd420b5 --- /dev/null +++ b/web/cobrands/fixamingata/images/sprite.png diff --git a/web/cobrands/fixamingata/images/tile-y-border.jpg b/web/cobrands/fixamingata/images/tile-y-border.jpg Binary files differnew file mode 100644 index 000000000..cc679f5e1 --- /dev/null +++ b/web/cobrands/fixamingata/images/tile-y-border.jpg diff --git a/web/cobrands/fixamingata/images/tile-y.jpg b/web/cobrands/fixamingata/images/tile-y.jpg Binary files differnew file mode 100644 index 000000000..1dfb6f017 --- /dev/null +++ b/web/cobrands/fixamingata/images/tile-y.jpg diff --git a/web/cobrands/fixamingata/images/tile.jpg b/web/cobrands/fixamingata/images/tile.jpg Binary files differnew file mode 100644 index 000000000..3e6deaf2f --- /dev/null +++ b/web/cobrands/fixamingata/images/tile.jpg diff --git a/web/cobrands/fixamingata/layout.scss b/web/cobrands/fixamingata/layout.scss new file mode 100644 index 000000000..8ff3cb443 --- /dev/null +++ b/web/cobrands/fixamingata/layout.scss @@ -0,0 +1,135 @@ +$image-sprite: '/cobrands/fixamingata/images/sprite.png'; + +@font-face { + font-family: 'MuseoSans'; + src: url('../fixmystreet/fonts/MuseoSans_300-webfont.eot'); + src: url('../fixmystreet/fonts/MuseoSans_300-webfont.eot?#iefix') format('embedded-opentype'), + url('../fixmystreet/fonts/MuseoSans_300-webfont.woff') format('woff'), + url('../fixmystreet/fonts/MuseoSans_300-webfont.ttf') format('truetype'), + url('../fixmystreet/fonts/MuseoSans_300-webfont.svg#MuseoSans300') format('svg'); + font-weight: normal; + font-style: normal; +} + +@font-face { + font-family: 'MuseoSans'; + src: url('../fixmystreet/fonts/MuseoSans_300_Italic-webfont.eot'); + src: url('../fixmystreet/fonts/MuseoSans_300_Italic-webfont.eot?#iefix') format('embedded-opentype'), + url('../fixmystreet/fonts/MuseoSans_300_Italic-webfont.woff') format('woff'), + url('../fixmystreet/fonts/MuseoSans_300_Italic-webfont.ttf') format('truetype'), + url('../fixmystreet/fonts/MuseoSans_300_Italic-webfont.svg#MuseoSans300Italic') format('svg'); + font-weight: normal; + font-style: italic; +} + +@font-face { + font-family: 'MuseoSans'; + src: url('../fixmystreet/fonts/MuseoSans_500-webfont.eot'); + src: url('../fixmystreet/fonts/MuseoSans_500-webfont.eot?#iefix') format('embedded-opentype'), + url('../fixmystreet/fonts/MuseoSans_500-webfont.woff') format('woff'), + url('../fixmystreet/fonts/MuseoSans_500-webfont.ttf') format('truetype'), + url('../fixmystreet/fonts/MuseoSans_500-webfont.svg#MuseoSans500') format('svg'); + font-weight: bold; + font-style: normal; +} + +@font-face { + font-family: 'MuseoSans'; + src: url('../fixmystreet/fonts/MuseoSans_500_Italic-webfont.eot'); + src: url('../fixmystreet/fonts/MuseoSans_500_Italic-webfont.eot?#iefix') format('embedded-opentype'), + url('../fixmystreet/fonts/MuseoSans_500_Italic-webfont.woff') format('woff'), + url('../fixmystreet/fonts/MuseoSans_500_Italic-webfont.ttf') format('truetype'), + url('../fixmystreet/fonts/MuseoSans_500_Italic-webfont.svg#MuseoSans500Italic') format('svg'); + font-weight: bold; + font-style: italic; +} + +@font-face { + font-family: 'Museo300-display'; + src: url('../fixmystreet/fonts/Museo300-Regular-webfont.eot'); + src: url('../fixmystreet/fonts/Museo300-Regular-webfont.eot?#iefix') format('embedded-opentype'), + url('../fixmystreet/fonts/Museo300-Regular-webfont.woff') format('woff'), + url('../fixmystreet/fonts/Museo300-Regular-webfont.ttf') format('truetype'), + url('../fixmystreet/fonts/Museo300-Regular-webfont.svg#Museo300') format('svg'); + font-weight: normal; + font-style: normal; +} + +/* Opera has a bug (from around 10.5 upwards to current 11.6) with showing the + * table caption *at all* if the header is set to a font-face :( */ +noindex:-o-prefocus, #site-header { + font-family: sans-serif; +} + +h3, h4 { + font-weight: bold; +} + +@import "_colours"; +@import "../sass/layout"; + +body { + background: #eee url(/cobrands/fixamingata/images/tile.jpg) 0 0 repeat; +} + +.nav-wrapper { + .nav-wrapper-2 { + border-top: 0; + } +} + +body.mappage { + .nav-wrapper { + .nav-wrapper-2 { + background: #eee; + } + } +} + +#main-nav { + ul { + li { + a, span { + color: $primary_text; + } + } + } +} + +#front-main { + background: $primary url(/cobrands/fixamingata/images/tile-y.jpg); +} + +.tablewrapper { + >div { + width: auto; + } +} +.ie6, .ie7 { + .tablewrapper { + div { + width: auto; + } + } +} + +#footer-help { + ul { + li { + width: 30%; + border-right: 1.25em solid transparent; + &:last-child { + border-left: none; + } + } + } +} +.ie6, .ie7 { + #footer-help { + ul { + li { + width: 33%; + } + } + } +} |