diff options
-rw-r--r-- | perllib/FixMyStreet/Cobrand/FiksGataMi.pm | 46 | ||||
-rw-r--r-- | templates/email/fiksgatami/login.txt | 5 | ||||
-rw-r--r-- | templates/web/fiksgatami/about/_sidebar.html | 15 | ||||
-rw-r--r-- | templates/web/fiksgatami/about/faq-nb.html | 6 | ||||
-rw-r--r-- | templates/web/fiksgatami/about/faq-nn.html | 6 | ||||
-rw-r--r-- | templates/web/fiksgatami/front/footer-marketing.html | 3 |
6 files changed, 56 insertions, 25 deletions
diff --git a/perllib/FixMyStreet/Cobrand/FiksGataMi.pm b/perllib/FixMyStreet/Cobrand/FiksGataMi.pm index 242735073..5e2473280 100644 --- a/perllib/FixMyStreet/Cobrand/FiksGataMi.pm +++ b/perllib/FixMyStreet/Cobrand/FiksGataMi.pm @@ -28,6 +28,13 @@ sub disambiguate_location { }; } +sub pin_colour { + my ( $self, $p, $context ) = @_; + return 'green' if $p->is_fixed || $p->is_closed; + return 'red' if $p->state eq 'unconfirmed' || $p->state eq 'confirmed'; + return 'yellow'; +} + sub area_types { my $self = shift; return $self->next::method() if FixMyStreet->config('STAGING_SITE') && FixMyStreet->config('SKIP_CHECKS_ON_STAGING'); @@ -93,13 +100,16 @@ sub remove_redundant_areas { sub short_name { my $self = shift; - my ($area, $info) = @_; + my ($body) = @_; - my $name = $area->{name} || $area->name; + my $name = $body->{name} || $body->name; if ($name =~ /^(Os|Nes|V\xe5ler|Sande|B\xf8|Her\xf8y)$/) { - my $parent = $info->{$area->{parent_area}}->{name}; - return URI::Escape::uri_escape_utf8("$name, $parent"); + my $area_id = $body->body_areas->first->area_id || $body->{id} || $body->id; + my $area = mySociety::MaPit::call('area', $area_id); + my $parent = mySociety::MaPit::call('area', $area->{parent_area}); + + $name .= ", " . $parent->{name}; } $name =~ s/ & / and /; @@ -125,7 +135,7 @@ sub council_rss_alert_options { } if ( $fylke->{id} == 3 ) { # Oslo - my $short_name = $self->short_name($fylke, $all_councils); + my $short_name = $self->short_name($fylke); ( my $id_name = $short_name ) =~ tr/+/_/; push @options, @@ -139,10 +149,10 @@ sub council_rss_alert_options { }; } else { - my $short_kommune_name = $self->short_name($kommune, $all_councils); + my $short_kommune_name = $self->short_name($kommune); ( my $id_kommune_name = $short_kommune_name ) =~ tr/+/_/; - my $short_fylke_name = $self->short_name($fylke, $all_councils); + my $short_fylke_name = $self->short_name($fylke); ( my $id_fylke_name = $short_fylke_name ) =~ tr/+/_/; push @options, @@ -191,34 +201,38 @@ sub council_rss_alert_options { } sub reports_body_check { - my ( $self, $c, $council ) = @_; - - if ($council eq 'Oslo') { + my ( $self, $c, $code ) = @_; + if ($code eq 'Oslo') { # There are two Oslos (kommune and fylke), we only want one of them. - $c->stash->{council} = mySociety::MaPit::call('area', 3); + my @bodies = $c->model('DB::Body')->search( { id => 3 } )->all; + $c->stash->{body} = $bodies[0]; return 1; + } - } elsif ($council =~ /,/) { - + if ($code =~ /,/) { # Some kommunes have the same name, use the fylke name to work out which. - my ($kommune, $fylke) = split /\s*,\s*/, $council; + my ($kommune, $fylke) = split /\s*,\s*/, $code; 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} = $_; + my @bodies = $c->model('DB::Body')->search( { id => $_->{id} } )->all; + $c->stash->{body} = $bodies[0]; return 1; } } } + # If we're here, we've been given a bad name. $c->detach( 'redirect_index' ); - } + + return; } sub jurisdiction_id_example { diff --git a/templates/email/fiksgatami/login.txt b/templates/email/fiksgatami/login.txt index 170350590..4247fba6a 100644 --- a/templates/email/fiksgatami/login.txt +++ b/templates/email/fiksgatami/login.txt @@ -1,4 +1,6 @@ -Subject: [% loc('Your FixMyStreet.com account details') %] +Subject: Bekreft din konto på FiksGataMi.no + +Hei, Vennligst klikk på linken under for å bekrefte din e-post. Når dette er gjort vil du lett kunne holde oversikt over dine problemrapporter. @@ -6,4 +8,3 @@ er gjort vil du lett kunne holde oversikt over dine problemrapporter. Vennlig hilsen, FiksGataMi-gruppen - diff --git a/templates/web/fiksgatami/about/_sidebar.html b/templates/web/fiksgatami/about/_sidebar.html new file mode 100644 index 000000000..0a21454f5 --- /dev/null +++ b/templates/web/fiksgatami/about/_sidebar.html @@ -0,0 +1,15 @@ +<div class="sticky-sidebar"> + <aside> + <ul class="plain-list"> + <li>[% INCLUDE link h='/faq' t=loc('Frequently Asked Questions') %]</li> + <!-- <li>[% INCLUDE link h='/privacy' t=loc('Privacy and cookies') %]</li> --> + <li>[% INCLUDE link h='/contact' t=tprintf(loc("Contact %s", "%s is the site name"), site_name) %]</li> + </ul> + </aside> +</div> + +[% BLOCK link -%] +<[% IF c.req.uri.path == h %]strong[% ELSE %]a href="[% h %]"[% END %]> +[%- t -%] +</[% IF c.req.uri.path == h %]strong[% ELSE %]a[% END %]> +[%- END %] diff --git a/templates/web/fiksgatami/about/faq-nb.html b/templates/web/fiksgatami/about/faq-nb.html index da35cb03c..3ce0ef12e 100644 --- a/templates/web/fiksgatami/about/faq-nb.html +++ b/templates/web/fiksgatami/about/faq-nb.html @@ -1,4 +1,6 @@ -[% INCLUDE 'header.html', title => loc('Frequently Asked Questions') %] +[% INCLUDE 'header.html', title => loc('Frequently Asked Questions'), bodyclass = 'twothirdswidthpage' %] + +[% INCLUDE 'about/_sidebar.html' %] <h1>Ofte stilte spørsmål</h1> <dl> @@ -159,4 +161,4 @@ </dl> -[% INCLUDE 'footer.html' %] +[% INCLUDE 'footer.html', pagefooter = 'yes' %] diff --git a/templates/web/fiksgatami/about/faq-nn.html b/templates/web/fiksgatami/about/faq-nn.html index 161cfbea5..df7ff5e40 100644 --- a/templates/web/fiksgatami/about/faq-nn.html +++ b/templates/web/fiksgatami/about/faq-nn.html @@ -1,4 +1,6 @@ -[% INCLUDE 'header.html', title => loc('Frequently Asked Questions') %] +[% INCLUDE 'header.html', title => loc('Frequently Asked Questions'), bodyclass = 'twothirdswidthpage' %] + +[% INCLUDE 'about/_sidebar.html' %] <h1>Ofte stilte spurnader</h1> <dl> @@ -160,4 +162,4 @@ </dl> -[% INCLUDE 'footer.html' %] +[% INCLUDE 'footer.html', pagefooter = 'yes' %] diff --git a/templates/web/fiksgatami/front/footer-marketing.html b/templates/web/fiksgatami/front/footer-marketing.html index 6069c8793..da59fe6e6 100644 --- a/templates/web/fiksgatami/front/footer-marketing.html +++ b/templates/web/fiksgatami/front/footer-marketing.html @@ -1,8 +1,5 @@ <div class="tablewrapper bordered"> <div id="footer-mobileapps"> - <p> - <a href="http://wiki.nuug.no/grupper/fiksgatami/android">Last ned FiksGataMi-app for din Android-telefon.</a> - </p> </div> <div id="footer-help"> |