aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHakim Cassimally <hakim@mysociety.org>2014-12-02 16:24:46 +0000
committerHakim Cassimally <hakim@mysociety.org>2015-01-08 12:27:19 +0000
commite636b5fc95b2c1ded84b9381c8656bb5b1f286b7 (patch)
tree7ebe3743015d413b65b7cd2af8d418e7ef738a57
parentdc19200ce0f7c65cc5c3435ba9705b6a50e6bc82 (diff)
[Harrogate] basic cobrand
-rw-r--r--perllib/FixMyStreet/Cobrand/Harrogate.pm89
-rw-r--r--templates/web/harrogate/footer.html59
-rwxr-xr-xweb/cobrands/harrogate/HBCLogo-mobile.pngbin0 -> 2632 bytes
-rw-r--r--web/cobrands/harrogate/HBCLogo.pngbin0 -> 7102 bytes
-rw-r--r--web/cobrands/harrogate/_colours.scss22
-rw-r--r--web/cobrands/harrogate/base.scss36
-rw-r--r--web/cobrands/harrogate/config.rb25
-rw-r--r--web/cobrands/harrogate/layout.scss25
8 files changed, 256 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/Cobrand/Harrogate.pm b/perllib/FixMyStreet/Cobrand/Harrogate.pm
new file mode 100644
index 000000000..3d48a5e52
--- /dev/null
+++ b/perllib/FixMyStreet/Cobrand/Harrogate.pm
@@ -0,0 +1,89 @@
+package FixMyStreet::Cobrand::Harrogate;
+use base 'FixMyStreet::Cobrand::UKCouncils';
+
+use strict;
+use warnings;
+
+sub council_id { return 2407; }
+sub council_area { return 'Harrogate'; }
+sub council_name { return 'Harrogate Borough Council'; }
+sub council_url { return 'harrogate'; }
+sub is_two_tier { return 1; } # with North Yorkshire CC 2235
+
+sub disambiguate_location {
+ my $self = shift;
+ my $string = shift;
+
+ my $town = 'Harrogate';
+
+ # as it's the requested example location, try to avoid a disambiguation page
+ $town .= ', HG1 1DH' if $string =~ /^\s*king'?s\s+r(?:oa)?d\s*(?:,\s*har\w+\s*)?$/i;
+
+ return {
+ %{ $self->SUPER::disambiguate_location() },
+ town => $town,
+ centre => '54.0671557690306,-1.59581319536637',
+ span => '0.370193897090822,0.829517054931808',
+ bounds => [ 53.8914112467619, -2.00450542308575, 54.2616051438527, -1.17498836815394 ],
+ };
+}
+
+sub example_places {
+ return ( 'HG1 2SG', "King's Road" );
+}
+
+sub enter_postcode_text {
+ my ($self) = @_;
+ return 'Enter a Harrogate postcode, or street name and area';
+}
+
+# increase map zoom level so street names are visible
+sub default_map_zoom { return 3; }
+
+
+=head2 temp_email_to_update, temp_update_contacts
+
+Temporary helper routines to update the extra for potholes (temporary setup
+hack, cargo-culted from ESCC, may in future be superseded either by
+Open311/integration or a better mechanism for manually creating rich contacts).
+
+Can run with a script or command line like:
+
+ bin/cron-wrapper perl -MFixMyStreet::App -MFixMyStreet::Cobrand::Harrogate -e \
+ 'FixMyStreet::Cobrand::Harrogate->new({c => FixMyStreet::App->new})->temp_update_contacts'
+
+=cut
+
+sub temp_update_contacts {
+ my $self = shift;
+
+ my $category = 'Potholes';
+ my $contact = $self->{c}->model('DB::Contact')
+ ->search({
+ body_id => $self->council_id,
+ category => $category,
+ })->first
+ or die "No such category: $category";
+
+ my $fields = [
+ {
+ 'code' => 'detail_size', # there is already builtin handling for this field in Report::New
+ 'variable' => 'true',
+ 'order' => '1',
+ 'description' => 'Size of the pothole?',
+ 'required' => 'true',
+ 'datatype' => 'singlevaluelist',
+ 'datatype_description' => {},
+ 'values' => {
+ 'value' => $self->POTHOLE_SIZES,
+ },
+ }
+ ];
+ # require IO::String; require RABX;
+ # RABX::wire_wr( $fields, IO::String->new(my $extra) );
+
+ $contact->update({ extra => $fields });
+}
+
+1;
+
diff --git a/templates/web/harrogate/footer.html b/templates/web/harrogate/footer.html
new file mode 100644
index 000000000..bb1618b4b
--- /dev/null
+++ b/templates/web/harrogate/footer.html
@@ -0,0 +1,59 @@
+ [% IF pagefooter %]
+ <footer role="content-info">
+ [% INCLUDE 'front/footer-marketing.html' %]
+ </footer>
+ [% END %]
+ </div><!-- .content role=main -->
+ </div><!-- .container -->
+ [% IF c.cobrand.moniker == 'fixmystreet' AND bodyclass != 'mappage' %]
+ [% INCLUDE 'footer-nav.html' %]
+ [% END %]
+ </div><!-- .table-cell -->
+
+ <div class="nav-wrapper">
+ <div class="nav-wrapper-2">
+ <div id="main-nav" role="navigation">
+ <ul id="mysoc-menu">
+ <li><a id="mysoc-logo" href="https://www.mysociety.org/">mySociety</a></li>
+ </ul>
+
+ <ul id="main-menu">
+ [% selected = c.req.uri.path == '/' %]
+ <li [% selected ? 'class="menu-item-selected"' : '' %]>
+ <[% IF selected %]span[% ELSE %]a href="/"[% END %] class="report-a-problem-btn">
+ [% loc("Report a problem") %]</[% selected == '/' ? 'span' : 'a' %]></li>
+
+ [% selected = c.req.uri.path == '/my' %]
+ <li [% selected ? 'class="menu-item-selected"' : '' %]>
+ <[% IF selected %]span[% ELSE %]a href="/my"[% END %]>
+ [% loc("Your reports") %]</[% selected ? 'span' : 'a' %]></li>
+
+ [% selected = c.req.uri.path == '/reports/Harrogate' %]
+ <li [% selected ? 'class="menu-item-selected"' : '' %]>
+ <[% IF selected %]span[% ELSE %]a href="/reports"[% END %]>
+ [% loc("All reports") %]</[% selected ? 'span' : 'a' %]></li>
+
+ [% selected = c.req.uri.path == '/alert' %]
+ <li [% selected ? 'class="menu-item-selected"' : '' %]>
+ <[% IF selected %]span[% ELSE %]a href="/alert[% pc ? '/list?pc=' : '' %][% pc | uri %]"[% END %]>
+ [% loc("Local alerts") %]</[% selected ? 'span' : 'a' %]></li>
+
+ [% selected = c.req.uri.path == '/faq' %]
+ <li [% selected ? 'class="menu-item-selected"' : '' %]>
+ <[% IF selected %]span[% ELSE %]a href="/alert[% pc ? '/list?pc=' : '' %][% pc | uri %]"[% END %]>
+ <[% IF selected %]span[% ELSE %]a href="/faq"[% END %]>
+ [% loc("Help") %]</[% selected ? 'span' : 'a' %]></li>
+
+ [% selected = c.req.uri.path == '/privacy' %]
+ <li id="top-nav-privacy" [% selected ? 'class="menu-item-selected"' : '' %]>
+ <[% IF selected %]span[% ELSE %]a href="/privacy"[% END %]>
+ [% loc("Privacy") %]</[% selected ? 'span' : 'a' %]></li>
+ </ul>
+ </div>
+ </div>
+ </div>
+
+<!-- [% INCLUDE 'debug_footer.html' %] -->
+ </div> <!-- .wrapper -->
+</body>
+</html>
diff --git a/web/cobrands/harrogate/HBCLogo-mobile.png b/web/cobrands/harrogate/HBCLogo-mobile.png
new file mode 100755
index 000000000..7b4cd6063
--- /dev/null
+++ b/web/cobrands/harrogate/HBCLogo-mobile.png
Binary files differ
diff --git a/web/cobrands/harrogate/HBCLogo.png b/web/cobrands/harrogate/HBCLogo.png
new file mode 100644
index 000000000..11ee7c79c
--- /dev/null
+++ b/web/cobrands/harrogate/HBCLogo.png
Binary files differ
diff --git a/web/cobrands/harrogate/_colours.scss b/web/cobrands/harrogate/_colours.scss
new file mode 100644
index 000000000..2b9714835
--- /dev/null
+++ b/web/cobrands/harrogate/_colours.scss
@@ -0,0 +1,22 @@
+/* COLOURS */
+
+$harrogate_primary: #7EB7D8;
+
+$primary: $harrogate_primary;
+$primary_dark: darken($harrogate_primary, 20%);
+
+$col_click_map: $harrogate_primary;
+$col_click_map_dark: $harrogate_primary;
+$col_fixed_label_dark: $harrogate_primary;
+$col_fixed_label: $harrogate_primary;
+
+$primary_b: #000000;
+$primary_text: #ffffff;
+
+$base_bg: #fff;
+$base_fg: #1a1a1a;
+
+/* Following seem to be required in layout.scss */
+$map_nav_bg: #222;
+$nav_fg: #fff;
+$nav_fg_hover: #444;
diff --git a/web/cobrands/harrogate/base.scss b/web/cobrands/harrogate/base.scss
new file mode 100644
index 000000000..118f0b8b7
--- /dev/null
+++ b/web/cobrands/harrogate/base.scss
@@ -0,0 +1,36 @@
+@import "../sass/h5bp";
+@import "./_colours";
+@import "../sass/mixins";
+@import "compass";
+
+@import "../sass/base";
+
+
+body.frontpage #site-logo,
+.ie6 body.frontpage #site-logo,
+#site-logo
+{
+ display: block;
+ background: url("/cobrands/harrogate/HBCLogo-mobile.png") 0 0 no-repeat;
+ margin: 2px;
+ padding-left: 10px;
+ position: static;
+ width: 106px;
+ height: 37px;
+}
+
+#main-nav ul#main-menu li {
+
+ // blue button background, darker if selected
+ background: $primary;
+ &.menu-item-selected { background: $primary_dark; }
+
+ @include border-radius(1em);
+ padding: 0.25em;
+ margin: 0.25em;
+ border: solid 1px black;
+
+ span {
+ color: $nav_fg;
+ }
+}
diff --git a/web/cobrands/harrogate/config.rb b/web/cobrands/harrogate/config.rb
new file mode 100644
index 000000000..cab97b18f
--- /dev/null
+++ b/web/cobrands/harrogate/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
diff --git a/web/cobrands/harrogate/layout.scss b/web/cobrands/harrogate/layout.scss
new file mode 100644
index 000000000..0e76bb111
--- /dev/null
+++ b/web/cobrands/harrogate/layout.scss
@@ -0,0 +1,25 @@
+@import "_colours";
+@import "../sass/layout";
+
+@media only screen and (min-width: 48em) {
+ body.frontpage #site-logo,
+ .ie6 body.frontpage #site-logo,
+ body.twothirdswidthpage #site-logo,
+ .ie6 body.twothirdswidthpage #site-logo
+ {
+ position: relative;
+ top: 5px;
+ margin: 0;
+ margin-left: 2.25em;
+ padding: 0;
+ background: url("/cobrands/harrogate/HBCLogo.png") 0 0 no-repeat;
+ width: 227px;
+ height: 122px;
+ }
+}
+
+#main-nav ul#main-menu li {
+ span {
+ color: $nav_fg;
+ }
+}