aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStruan Donald <struan@exo.org.uk>2017-12-15 10:34:24 +0000
committerMatthew Somerville <matthew-github@dracos.co.uk>2018-03-15 13:17:19 +0000
commitf1c8da3ed21adc1c64e8276edc116af200b8883f (patch)
tree30639faef128d05f6bbe45f4a997ac71923e5c11
parent935f431ee0da77dd26a78b959d3b9afb89665c0f (diff)
[Rutland] cobrand files for Rutland
Web and email template changes, CSS plus cobrand file with open311 config
-rw-r--r--perllib/FixMyStreet/Cobrand/Rutland.pm44
-rw-r--r--t/cobrand/rutland.t60
-rw-r--r--templates/email/rutland/_email_color_overrides.html21
-rwxr-xr-x[-rw-r--r--]templates/web/base/footer.html0
-rwxr-xr-xtemplates/web/rutland/front/footer-marketing.html8
-rwxr-xr-xtemplates/web/rutland/site-name.html1
-rwxr-xr-xweb/cobrands/rutland/RCCLogo.gifbin0 -> 74768 bytes
-rwxr-xr-xweb/cobrands/rutland/_colours.scss34
-rwxr-xr-xweb/cobrands/rutland/base.scss16
-rw-r--r--web/cobrands/rutland/images/email-logo.gifbin0 -> 3606 bytes
-rwxr-xr-xweb/cobrands/rutland/layout.scss15
11 files changed, 199 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/Cobrand/Rutland.pm b/perllib/FixMyStreet/Cobrand/Rutland.pm
new file mode 100644
index 000000000..087744cd7
--- /dev/null
+++ b/perllib/FixMyStreet/Cobrand/Rutland.pm
@@ -0,0 +1,44 @@
+package FixMyStreet::Cobrand::Rutland;
+use base 'FixMyStreet::Cobrand::UKCouncils';
+
+use strict;
+use warnings;
+
+sub council_area_id { return 2600; }
+sub council_area { return 'Rutland'; }
+sub council_name { return 'Rutland County Council'; }
+sub council_url { return 'rutland'; }
+
+sub open311_config {
+ my ($self, $row, $h, $params) = @_;
+
+ my $extra = $row->get_extra_fields;
+ push @$extra, { name => 'external_id', value => $row->id };
+ push @$extra, { name => 'title', value => $row->title };
+ push @$extra, { name => 'description', value => $row->detail };
+
+ if ($h->{closest_address}) {
+ push @$extra, { name => 'closest_address', value => $h->{closest_address} }
+ }
+ $row->set_extra_fields( @$extra );
+}
+
+sub example_places {
+ return ( 'LE15 6HP', 'High Street', 'Oakham' );
+}
+
+sub disambiguate_location {
+ my $self = shift;
+ my $string = shift;
+
+ return {
+ bounds => [52.524755166940075, -0.8217480325342802, 52.7597945702699, -0.4283542728893742]
+ };
+}
+
+sub pin_colour {
+ my ( $self, $p, $context ) = @_;
+ return 'green' if $p->is_fixed || $p->is_closed;
+ return 'yellow';
+}
+1;
diff --git a/t/cobrand/rutland.t b/t/cobrand/rutland.t
new file mode 100644
index 000000000..8943e64fc
--- /dev/null
+++ b/t/cobrand/rutland.t
@@ -0,0 +1,60 @@
+use CGI::Simple;
+use FixMyStreet::TestMech;
+use FixMyStreet::Script::Reports;
+my $mech = FixMyStreet::TestMech->new;
+
+# Create test data
+my $user = $mech->create_user_ok( 'rutland@example.com' );
+my $body = $mech->create_body_ok( 2482, 'Rutland County Council');
+my $contact = $mech->create_contact_ok(
+ body_id => $body->id,
+ category => 'Other',
+ email => 'LIGHT',
+);
+$contact->update;
+
+my @reports = $mech->create_problems_for_body( 1, $body->id, 'Test', {
+ cobrand => 'rutland',
+ user => $user,
+});
+my $report = $reports[0];
+
+for my $update ('in progress', 'unable to fix') {
+ FixMyStreet::DB->resultset('Comment')->find_or_create( {
+ problem_state => $update,
+ problem_id => $report->id,
+ user_id => $user->id,
+ name => 'User',
+ mark_fixed => 'f',
+ text => "This update marks it as $update",
+ state => 'confirmed',
+ confirmed => 'now()',
+ anonymous => 'f',
+ } );
+}
+
+subtest 'testing special Open311 behaviour', sub {
+ $report->set_extra_fields();
+ $report->update;
+ $body->update( { send_method => 'Open311', endpoint => 'http://rutland.endpoint.example.com', jurisdiction => 'FMS', api_key => 'test', send_comments => 1 } );
+ my $test_data;
+ FixMyStreet::override_config {
+ STAGING_FLAGS => { send_reports => 1 },
+ ALLOWED_COBRANDS => [ 'fixmystreet', 'rutland' ],
+ }, sub {
+ $test_data = FixMyStreet::Script::Reports::send();
+ };
+ $report->discard_changes;
+ ok $report->whensent, 'Report marked as sent';
+ is $report->send_method_used, 'Open311', 'Report sent via Open311';
+ is $report->external_id, 248, 'Report has right external ID';
+
+ my $req = $test_data->{test_req_used};
+ my $c = CGI::Simple->new($req->content);
+ is $c->param('attribute[title]'), $report->title, 'Request had title';
+ is $c->param('attribute[description]'), $report->detail, 'Request had description';
+ is $c->param('attribute[external_id]'), $report->id, 'Request had correct ID';
+ is $c->param('jurisdiction_id'), 'FMS', 'Request had correct jurisdiction';
+};
+
+done_testing();
diff --git a/templates/email/rutland/_email_color_overrides.html b/templates/email/rutland/_email_color_overrides.html
new file mode 100644
index 000000000..12ec97bc3
--- /dev/null
+++ b/templates/email/rutland/_email_color_overrides.html
@@ -0,0 +1,21 @@
+[%
+
+color_rutland_dark_green = '#265123'
+color_rutland_mid_green = '#A7B980'
+color_rutland_pale_green = '#DCE6C9'
+color_rutland_dark_grey = '#3C3C3C'
+
+body_font_family = "'PT Sans', Verdana, sans-serif"
+
+header_background_color = color_rutland_mid_green
+header_text_color = color_black
+
+secondary_column_background_color = color_rutland_pale_green
+
+button_background_color = color_rutland_dark_green
+button_text_color = color_white
+
+logo_width = "150" # pixel measurement, but without 'px' suffix
+logo_height = "77" # pixel measurement, but without 'px' suffix
+
+%]
diff --git a/templates/web/base/footer.html b/templates/web/base/footer.html
index e2bdbb01a..e2bdbb01a 100644..100755
--- a/templates/web/base/footer.html
+++ b/templates/web/base/footer.html
diff --git a/templates/web/rutland/front/footer-marketing.html b/templates/web/rutland/front/footer-marketing.html
new file mode 100755
index 000000000..7d998eba6
--- /dev/null
+++ b/templates/web/rutland/front/footer-marketing.html
@@ -0,0 +1,8 @@
+ <div class="tablewrapper bordered footer-marketing">
+ <p>
+ [% loc('') %]
+ </p>
+ <p>
+ [% loc('Powered by <a class="platform-logo" href="http://fixmystreet.org/">FixMyStreet Platform</a>') %]
+ </p>
+ </div>
diff --git a/templates/web/rutland/site-name.html b/templates/web/rutland/site-name.html
new file mode 100755
index 000000000..62188c84a
--- /dev/null
+++ b/templates/web/rutland/site-name.html
@@ -0,0 +1 @@
+Rutland County Council FixMyStreet
diff --git a/web/cobrands/rutland/RCCLogo.gif b/web/cobrands/rutland/RCCLogo.gif
new file mode 100755
index 000000000..aeacf01f6
--- /dev/null
+++ b/web/cobrands/rutland/RCCLogo.gif
Binary files differ
diff --git a/web/cobrands/rutland/_colours.scss b/web/cobrands/rutland/_colours.scss
new file mode 100755
index 000000000..c3666ca17
--- /dev/null
+++ b/web/cobrands/rutland/_colours.scss
@@ -0,0 +1,34 @@
+/* LAYOUT */
+
+// If you are wanting a right-to-left layout, uncomment the following line.
+// $direction: right;
+
+/* COLOURS */
+
+$orange: #ff9900;
+$bluey: #6688ff;
+$RCCGreen: #a7b980;
+$RCCGreen_dark: #265123;
+$RCCbg: #F1F1F1;
+
+$primary: $RCCGreen;
+$primary_b: #000000;
+$primary_text: #222222;
+
+$base_bg: $RCCbg;
+$base_fg: #000;
+
+$map_nav_bg: $RCCbg;
+$nav_fg: #000;
+$nav_fg_hover: $primary;
+
+// Colour used for front page 'how to report a problem' steps
+$col_big_numbers: #ccc;
+
+$col_click_map: $RCCGreen_dark;
+
+$col_fixed_label: #00BD08;
+$col_fixed_label_dark: #4B8304;
+
+//$image-sprite: '/cobrands/rutland/RCCLogo.gif';
+
diff --git a/web/cobrands/rutland/base.scss b/web/cobrands/rutland/base.scss
new file mode 100755
index 000000000..4837e970a
--- /dev/null
+++ b/web/cobrands/rutland/base.scss
@@ -0,0 +1,16 @@
+@import "../sass/h5bp";
+@import "./_colours";
+@import "../sass/mixins";
+
+@import "../sass/base";
+
+
+#site-logo {
+ background: url("/cobrands/rutland/RCCLogo.gif");
+ background-size: contain;
+ height: 50px;
+ width: 110px;
+}
+
+
+
diff --git a/web/cobrands/rutland/images/email-logo.gif b/web/cobrands/rutland/images/email-logo.gif
new file mode 100644
index 000000000..bab9d2eef
--- /dev/null
+++ b/web/cobrands/rutland/images/email-logo.gif
Binary files differ
diff --git a/web/cobrands/rutland/layout.scss b/web/cobrands/rutland/layout.scss
new file mode 100755
index 000000000..eb0447be2
--- /dev/null
+++ b/web/cobrands/rutland/layout.scss
@@ -0,0 +1,15 @@
+@import "_colours";
+@import "../sass/layout";
+
+
+body.frontpage #site-header {
+ height: 10em;
+}
+
+
+body.frontpage #site-logo {
+ background: url("/cobrands/rutland/RCCLogo.gif");
+ background-size: contain;
+ height: 100px;
+ width: 220px;
+}