diff options
author | Hakim Cassimally <hakim@mysociety.org> | 2014-09-16 17:26:41 +0000 |
---|---|---|
committer | Hakim Cassimally <hakim@mysociety.org> | 2014-09-16 17:26:41 +0000 |
commit | 8f7fb5624c3b8d82e2f365bc2a6951eebf3a7a99 (patch) | |
tree | da5db5107992227d5b886ceb92e3d7c4d2222edf | |
parent | 1ca31d093403ce49092ffdbcfacfacee7eb55ba7 (diff) | |
parent | 378150a466ccac89855b6035f226bd9aeee4d496 (diff) |
Merge branch 'east-sussex-candidate'
-rw-r--r-- | perllib/FixMyStreet/Cobrand/Default.pm | 13 | ||||
-rw-r--r-- | perllib/FixMyStreet/Cobrand/EastSussex.pm | 114 | ||||
-rw-r--r-- | perllib/FixMyStreet/Geocode.pm | 2 | ||||
-rw-r--r-- | templates/web/eastsussex/.gitignore | 6 | ||||
-rw-r--r-- | templates/web/eastsussex/around/intro.html | 4 | ||||
-rwxr-xr-x | templates/web/eastsussex/build_eastsussex_templates.py | 96 | ||||
-rw-r--r-- | templates/web/eastsussex/email_sent.html | 34 | ||||
-rw-r--r-- | templates/web/eastsussex/footer.html.template | 36 | ||||
-rw-r--r-- | templates/web/eastsussex/header.html.template | 57 | ||||
-rw-r--r-- | templates/web/eastsussex/report/new/category.html | 18 | ||||
-rw-r--r-- | templates/web/eastsussex/report/new/fill_in_details_text.html | 10 | ||||
-rw-r--r-- | templates/web/eastsussex/report/new/notes.html | 11 | ||||
-rw-r--r-- | web/cobrands/eastsussex/_colours.scss | 21 | ||||
-rw-r--r-- | web/cobrands/eastsussex/base.scss | 225 | ||||
-rw-r--r-- | web/cobrands/eastsussex/config.rb | 25 | ||||
-rw-r--r-- | web/cobrands/eastsussex/layout.scss | 261 | ||||
-rw-r--r-- | web/cobrands/eastsussex/position_map.js | 21 | ||||
-rw-r--r-- | web/cobrands/fixmystreet/fixmystreet.js | 4 |
18 files changed, 956 insertions, 2 deletions
diff --git a/perllib/FixMyStreet/Cobrand/Default.pm b/perllib/FixMyStreet/Cobrand/Default.pm index 8eb637879..779c0a7a2 100644 --- a/perllib/FixMyStreet/Cobrand/Default.pm +++ b/perllib/FixMyStreet/Cobrand/Default.pm @@ -862,6 +862,19 @@ Perform any extra validation on the contact form. sub extra_contact_validation { (); } + +=head2 get_geocoder + +Return the default geocoder from config. + +=cut + +sub get_geocoder { + my ($self, $c) = @_; + return $c->config->{GEOCODER}; +} + + sub problem_as_hashref { my $self = shift; my $problem = shift; diff --git a/perllib/FixMyStreet/Cobrand/EastSussex.pm b/perllib/FixMyStreet/Cobrand/EastSussex.pm new file mode 100644 index 000000000..c039b8410 --- /dev/null +++ b/perllib/FixMyStreet/Cobrand/EastSussex.pm @@ -0,0 +1,114 @@ +package FixMyStreet::Cobrand::EastSussex; +use base 'FixMyStreet::Cobrand::UKCouncils'; + +use strict; +use warnings; + +sub council_id { return 2224; } +sub council_area { return 'East Sussex'; } +sub council_name { return 'East Sussex County Council'; } +sub council_url { return 'eastsussex'; } +# sub is_two_tier { return 1; } + +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 disambiguate_location { + my $self = shift; + my $string = shift; + return { + %{ $self->SUPER::disambiguate_location() }, + town => 'East Sussex', + centre => '50.9413275309703,0.276320277101682', + span => '0.414030932264716,1.00374244745585', + bounds => [ 50.7333642759327, -0.135851370247794, 51.1473952081975, 0.867891077208056 ], + }; +} + +sub example_places { + return ( 'BN7 2LZ', 'White Hill, Lewes' ); +} + +sub enter_postcode_text { + my ($self) = @_; + return 'Enter an East Sussex postcode, or street name and area'; +} + +# increase map zoom level so street names are visible +sub default_map_zoom { return 3; } + + +=head2 temp_update_potholes_contact + +Routine to update the extra for potholes (temporary setup hack, will be +superseded by Open311/integration). + +Can run with a script or command line like: + + bin/cron-wrapper perl -MFixMyStreet::App -MFixMyStreet::Cobrand::EastSussex -e \ + 'FixMyStreet::Cobrand::EastSussex->new({c => FixMyStreet::App->new})->temp_update_potholes_contact' + +=cut + +use constant POTHOLE_SIZES => [ + {'key' => ['Blank'], 'name' => ['--']}, + {'key' => ['golf'], 'name' => ['Golf ball sized']}, + {'key' => ['tennis'], 'name' => ['Tennis ball sized']}, + {'key' => ['football'], 'name' => ['Football sized']}, + {'key' => ['larger'], 'name' => ['Larger']} +]; + +use constant POTHOLE_DICT => { + map { + @{ $_->{key} }, + @{ $_->{name} }, + } @{ POTHOLE_SIZES() }, +}; + +sub resolve_pothole_size { + my ($self, $key) = @_; + return $self->POTHOLE_DICT->{$key}; +} + +sub temp_update_potholes_contact { + 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 }); +} + +sub get_geocoder { + return 'OSM'; # default of Bing gives poor results, let's try overriding. +} + +1; + diff --git a/perllib/FixMyStreet/Geocode.pm b/perllib/FixMyStreet/Geocode.pm index 61c398985..2a318ea5a 100644 --- a/perllib/FixMyStreet/Geocode.pm +++ b/perllib/FixMyStreet/Geocode.pm @@ -35,7 +35,7 @@ sub lookup { sub string { my ($s, $c) = @_; - my $service = $c->config->{GEOCODER}; + my $service = $c->cobrand->get_geocoder($c); $service = $service->{type} if ref $service; $service = 'OSM' unless $service =~ /^(Bing|Google|OSM|Zurich)$/; $service = 'OSM' if $service eq 'Bing' && !FixMyStreet->config('BING_MAPS_API_KEY'); diff --git a/templates/web/eastsussex/.gitignore b/templates/web/eastsussex/.gitignore new file mode 100644 index 000000000..8380978ad --- /dev/null +++ b/templates/web/eastsussex/.gitignore @@ -0,0 +1,6 @@ +header.html +footer.html +FooterDesktop.html +HeaderDesktop.html +HtmlTag.html +MetadataDesktop.html diff --git a/templates/web/eastsussex/around/intro.html b/templates/web/eastsussex/around/intro.html new file mode 100644 index 000000000..b3f403087 --- /dev/null +++ b/templates/web/eastsussex/around/intro.html @@ -0,0 +1,4 @@ + <h1>Report and view street and road problems </h1> + <h2> + (including potholes, broken paving slabs and street lighting) + </h2> diff --git a/templates/web/eastsussex/build_eastsussex_templates.py b/templates/web/eastsussex/build_eastsussex_templates.py new file mode 100755 index 000000000..389755042 --- /dev/null +++ b/templates/web/eastsussex/build_eastsussex_templates.py @@ -0,0 +1,96 @@ +#!/usr/bin/env python +import urllib2 +import os +import sys +import argparse +import time + +try: + from fsevents import Stream, Observer + WATCH_AVAILABLE = True +except ImportError: + WATCH_AVAILABLE = False + +TEMPLATES = { + "header.html.template": ( + "HtmlTag", + "MetadataDesktop", + ( + "HeaderDesktop", + ( + ("<header>", '<header class="eastsussex">'), + ) + ), + ), + "footer.html.template": ( + "FooterDesktop", + ) +} + +BASE_URL = "https://www.eastsussex.gov.uk/masterpages/remote/control.aspx?control={fragment}&host=mysociety.org" + + +def patch_fragment(fragment, patches): + if not patches: + return fragment + for search, replacement in patches: + fragment = fragment.replace(search, replacement) + return fragment + + +def update_templates(): + for template_path, fragment_names in TEMPLATES.items(): + template = open(template_path).read() + fragments = {} + for name in fragment_names: + if isinstance(name, tuple): + name, patches = name + else: + patches = None + url = BASE_URL.format(fragment=name) + content = urllib2.urlopen(url).read().replace("\r", "") + fragments[name] = patch_fragment(content, patches) + open("{0}.html".format(name), "wb").write(fragments[name]) + with open(template_path[:-9], "wb") as outfile: + outfile.write(template.format(**fragments)) + + +def event_callback(event): + filename = os.path.basename(event.name) + if filename in TEMPLATES.keys(): + print "{} has changed, updating templates...".format(filename) + update_templates() + print "done." + +def watch_local_files(): + print "Watching for changes to: {}".format(", ".join(TEMPLATES.keys())) + observer = Observer() + stream = Stream(event_callback, os.getcwd(), file_events=True) + observer.schedule(stream) + try: + observer.start() + while True: + time.sleep(86400) + except KeyboardInterrupt: + observer.stop() + + +def main(): + os.chdir(os.path.dirname(__file__)) + + parser = argparse.ArgumentParser(description="Build header.html and footer.html from online East Sussex template fragments.") + parser.add_argument("-w", "--watch", action="store_true") + + args = parser.parse_args() + + if args.watch: + if not WATCH_AVAILABLE: + print "Watch functionality not available. This currently needs OS X and the macfsevents Python package." + sys.exit(1) + watch_local_files() + else: + update_templates() + + +if __name__ == '__main__': + main() diff --git a/templates/web/eastsussex/email_sent.html b/templates/web/eastsussex/email_sent.html new file mode 100644 index 000000000..f64a3cd64 --- /dev/null +++ b/templates/web/eastsussex/email_sent.html @@ -0,0 +1,34 @@ +[% INCLUDE 'header.html', bodyclass = 'twothirdswidthpage', title = loc('Create a report') %] + +<h1>[% loc("Nearly done! Now check your email…") %]</h1> + +[% IF c.cobrand.moniker != 'zurich' %] + <p>[% loc("The confirmation email <strong>may</strong> take a few minutes to arrive — <em>please</em> be patient.") %]</p> +[% END %] + +<p>[% loc("If you use web-based email or have 'junk mail' filters, you may wish to check your bulk/spam mail folders: sometimes, our messages are marked that way.") %]</p> + +[% IF c.cobrand.moniker != 'zurich' %] + <p> + [% loc("You must now click the link in the email we've just sent you.") %] + [% IF email_type == 'problem' %] + [% loc("If you do not, your problem will not be posted.") %] + [% ELSIF email_type == 'update' %] + [% loc("If you do not, your update will not be posted.") %] + [% ELSIF email_type == 'alert' %] + [% loc("If you do not, your alert will not be activated.") %] + [% END %] + </p> + + <p> + [% IF email_type == 'problem' %] + [% loc("(Don't worry — we'll hang on to your problem report while you're checking your email.)") %] + [% ELSIF email_type == 'update' %] + [% loc("(Don't worry — we'll hang on to your update while you're checking your email.)") %] + [% ELSIF email_type == 'alert' %] + [% loc("(Don't worry — we'll hang on to your alert while you're checking your email.)") %] + [% END %] + </p> +[% END %] + +[% INCLUDE 'footer.html' %] diff --git a/templates/web/eastsussex/footer.html.template b/templates/web/eastsussex/footer.html.template new file mode 100644 index 000000000..b5b1a8ac6 --- /dev/null +++ b/templates/web/eastsussex/footer.html.template @@ -0,0 +1,36 @@ + </div> <!-- content --> + </div> <!-- container --> + </div> + +</div></div></div> <!-- 3 levels of wrapper --> + + <div class="nav-wrapper clearfix"> + <div class="main-menu-wrapper"> + <div class="main-menu"> + <ul class="clearfix button-nav" id="mobile-menu"> + <li class="home"><[% IF c.req.uri.path == '/' %]span[% ELSE %]a href="/"[% END %] class="report-a-problem-btn" + >[% "Report" %]</[% c.req.uri.path == '/' ? 'span' : 'a' %]></li>[% + %]<li><[% IF c.req.uri.path == '/my' OR ( c.req.uri.path == '/auth' AND c.req.params.r == 'my' ) %]span[% ELSE %]a href="/my"[% END + %]>[% loc("Your reports") %]</[% ( c.req.uri.path == '/my' OR ( c.req.uri.path == '/auth' AND c.req.params.r == 'my' ) ) ? 'span' : 'a' %]></li>[% + %]<li><[% IF c.req.uri.path == '/reports/East+Sussex' %]span[% ELSE %]a href="/reports/East+Sussex"[% 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> + [% IF c.user_exists %] + <li> + [% tprintf(loc('Hi %s'), c.user.name || c.user.email) %] + <a href="/auth/sign_out">[% loc('sign out') %]</a> + </li> + [% END %] + </ul> + </div> + </div> + </div> +</div> + +{FooterDesktop} + +</body> +</html> diff --git a/templates/web/eastsussex/header.html.template b/templates/web/eastsussex/header.html.template new file mode 100644 index 000000000..20e3b9417 --- /dev/null +++ b/templates/web/eastsussex/header.html.template @@ -0,0 +1,57 @@ +{HtmlTag} + +<head> + {MetadataDesktop} + + <link rel="stylesheet" href="[% start %][% version('/cobrands/' _ c.cobrand.moniker _ '/base.css') %]"> + <link rel="stylesheet" href="[% start %][% version('/cobrands/' _ c.cobrand.moniker _ '/layout.css') %]" media="(min-width:48em)"> + [% extra_css %] + <!--[if (lt IE 9) & (!IEMobile)]> + <link rel="stylesheet" href="[% start %][% version('/cobrands/' _ c.cobrand.moniker _ '/layout.css') %]"> + <![endif]--> + + <script src="[% start %][% version('/cobrands/' _ c.cobrand.moniker _ '/position_map.js') %]" charset="utf-8"></script> + [% INCLUDE 'common_header_tags.html', js_override = '/cobrands/fixmystreet/fixmystreet.js', site_title = c.cobrand.site_title %] + [% extra_js %] + + [% IF c.req.uri.host == 'osm.fixmystreet.com' %] + <link rel="canonical" href="http://www.fixmystreet.com[% c.req.uri.path_query %]"> + [% END %] + + <title>East Sussex County Council</title> +</head> + +<body id="eastsussex-gov-uk" class="[% bodyclass | html IF bodyclass %]"> + +<div id="site-header"> + {HeaderDesktop} + + <div class="container" id="nav-container"> + <nav id="breadcrumb_breadcrumbTrail"> + <ol class="button-nav application-nav screen"> + <li class="home"><[% IF c.req.uri.path == '/' %]span[% ELSE %]a href="/"[% END %] class="report-a-problem-btn" + >[% "Report" %]</[% c.req.uri.path == '/' ? 'span' : 'a' %]></li>[% + %]<li><[% IF c.req.uri.path == '/my' OR ( c.req.uri.path == '/auth' AND c.req.params.r == 'my' ) %]span[% ELSE %]a href="/my"[% END + %]>[% loc("Your reports") %]</[% ( c.req.uri.path == '/my' OR ( c.req.uri.path == '/auth' AND c.req.params.r == 'my' ) ) ? 'span' : 'a' %]></li>[% + %]<li><[% IF c.req.uri.path == '/reports/East+Sussex' %]span[% ELSE %]a href="/reports/East+Sussex"[% 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 class="last"><[% IF c.req.uri.path == '/faq' %]span[% ELSE %]a href="/faq"[% END + %]>[% loc("Help") %]</[% c.req.uri.path == '/faq' ? 'span' : 'a' %]></li> + </ol> + [% IF c.user_exists %] + <div class="sign-in large"> + [% tprintf(loc('Hi %s'), c.user.name || c.user.email) %] + <a href="/auth/sign_out">[% loc('sign out') %]</a> + </div> + [% END %] + </nav> + </div> +</div> + +<div class="wrapper" id="wrapper"><div id="wrapper2"><div id="wrapper3"> + <div id="mysociety" role="main" class="body"> + <div class="container"> + [% pre_container_extra %] + <div class="content[% " $mainclass" | html IF mainclass %]" role="main"> diff --git a/templates/web/eastsussex/report/new/category.html b/templates/web/eastsussex/report/new/category.html new file mode 100644 index 000000000..1759f450f --- /dev/null +++ b/templates/web/eastsussex/report/new/category.html @@ -0,0 +1,18 @@ +[% FILTER collapse %] +[% IF category_options.size %] + [% IF category; + category = category | lower; + END; %] + <label for='form_category' id="form_category_label"> + Type + </label> + <select name='category' id='form_category'[% ' onchange="form_category_onchange()"' IF category_extras.size %]> + [% FOREACH cat_op IN category_options %] + [% cat_op_lc = cat_op | lower %] + [% IF loop.first; cat_op = '-- Pick a type --'; END %] + <option value='[% cat_op | html %]'[% ' selected' IF report.category == cat_op || category == cat_op_lc || (category_options.size == 2 AND loop.last) -%] + >[% IF loop.first %][% cat_op %][% ELSE %][% cat_op | html %][% END %]</option> + [% END %] + </select> +[% END %] +[% END -%] diff --git a/templates/web/eastsussex/report/new/fill_in_details_text.html b/templates/web/eastsussex/report/new/fill_in_details_text.html new file mode 100644 index 000000000..3f967a72a --- /dev/null +++ b/templates/web/eastsussex/report/new/fill_in_details_text.html @@ -0,0 +1,10 @@ +[% + IF area_ids_to_list.size != 0; + loc('East Sussex County 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.'); + IF category_extras; + ' ' _ loc('Some categories may require additional information.'); + END; + ELSE; + loc('Please fill in details of the problem below.'); + END; +%] diff --git a/templates/web/eastsussex/report/new/notes.html b/templates/web/eastsussex/report/new/notes.html new file mode 100644 index 000000000..c29925925 --- /dev/null +++ b/templates/web/eastsussex/report/new/notes.html @@ -0,0 +1,11 @@ +<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> + [% IF c.cobrand.moniker != 'zurich' %] + <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> + [% END %] + <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 us directly using our website <a href=\"http://www.eastsussex.gov.uk\">eastsussex.gov.uk</a>.") %]</li> +</ul> diff --git a/web/cobrands/eastsussex/_colours.scss b/web/cobrands/eastsussex/_colours.scss new file mode 100644 index 000000000..0887ba82e --- /dev/null +++ b/web/cobrands/eastsussex/_colours.scss @@ -0,0 +1,21 @@ +/* COLOURS */ + +$eastsussex_dark: #194C7E; +$eastsussex_primary: #155F91; + +$primary: $eastsussex_primary; +$col_click_map: $eastsussex_primary; +$col_click_map_dark: $eastsussex_primary; +$col_fixed_label_dark: $eastsussex_primary; +$col_fixed_label: $eastsussex_primary; + +$primary_b: #000000; +$primary_text: #ffffff; + +$base_bg: #ffffff; +$base_fg: #1a1a1a; + +/* Unused here */ +$map_nav_bg: #222; +$nav_fg: #fff; +$nav_fg_hover: #444; diff --git a/web/cobrands/eastsussex/base.scss b/web/cobrands/eastsussex/base.scss new file mode 100644 index 000000000..581223b60 --- /dev/null +++ b/web/cobrands/eastsussex/base.scss @@ -0,0 +1,225 @@ +@import "../sass/h5bp"; +@import "./_colours"; +@import "../sass/mixins"; +@import "compass"; + +$heading-font: Arial, "Helvetica Neue", Helvetica, sans-serif !default; + +@import "../sass/base"; + +body { + font-size: 13px; +} + +footer { + background: #00a1de; +} + +.content { + padding: 0 1em; +} + +a, a:visited { + color: #369; + &:hover, &:active { + color: #369; + } +} + +.issue-list-a { + li { + color:#666; + a { + color:#666; + } + } +} + +h1.main { + color: $primary; + text-align: center; + margin: 0.5em 0; +} + +.container { + padding: 0 1em 1em; /* if remove this 1em, need to edit .full-width! */ +} + +#site-header { + background: $primary; + height: 76px; + border-top-width: 4px; + margin-top: -4px; +} +#site-header .eastsussex .header { + margin: 0 0 2px; +} +.frontpage #site-header .eastsussex .header { + margin: 0 0 9px; +} + +.mappage .application-nav, .twothirdswidthpage .application-nav { + padding: 4.5px 9px; +} + +// Colour tab to match colour scheme +#nav-link { + width: 50px; + height: 48px; +} + +#breadcrumb_breadcrumbTrail ol li { + list-style: none; +} + +#problems-nav { + border-bottom:0.25em solid $primary; + ul li a { + text-transform: none; + color: #666; + &.active { + background: $primary; + color: #fff; + } + } +} + +#report-a-problem-sidebar .sidebar-notes a { + color: #fff; + text-decoration: underline; +} + +.big-green-banner { + text-transform: none; + z-index: 5000; +} + +.green-btn, input.green-btn, input.green-btn:hover { + background: #44697d; + font-weight: bold; + font-size: 1.1em; +} + +#form_sign_in { + margin-top: 1em; +} + +#front-main { + + margin: 0; + padding: 1em; + + #front-main-container { + text-align: center; + } + + #postcodeForm { + padding: 1em; + + label { + text-align: center; + } + + div { + padding-top: 0px; + input#pc { + } + input#sub { + height: 100%; + } + } + } +} + +.frontpage #mysociety #front-main-container { + h1, h2 { + text-align: center; + } +} + + +body > p { + margin: 0; +} + +.main-menu ul { + padding: 0; + margin: 6px; + text-align: center; + + li { + display: inline-block; + list-style: none; + + a, span { + padding: 2px 6px; + margin: 3px; + border-radius: 3px; + } + + a, a:hover { + background-color: #00a1de; + color: white; + } + + span { + background-color: #00a1de; + color: white; + } + } +} + +footer { + display: none; +} + +.footer .languages ul { + + li { + display: inline-block; + float: none !important; + } +} + +button, input[type=submit], .btn { + text-transform: none; +} + +/* as per email from Matt Tooke, we are using ESCC's .button-nav +styling, but this doesn't dtrt with span, so adding ourselves */ + +.button-nav span { + float: left; + display: block; + margin: 5px 2px 5px 0; + padding: 4px 10px; + background: #00a1de; + color: #fff; + font-weight: bold; + text-decoration: none; + white-space: nowrap; + border-radius: 3px; + border: 0; +} + +.email { + background-image: none; +} + +::-webkit-input-placeholder { + font-style: normal; +} +:-moz-placeholder { + font-style: normal; +} +:-ms-placeholder { + font-style: normal; +} +.placeholder { + font-style: normal; +} + + +#geolocate_link { + font-size: 1.0em; +} diff --git a/web/cobrands/eastsussex/config.rb b/web/cobrands/eastsussex/config.rb new file mode 100644 index 000000000..cab97b18f --- /dev/null +++ b/web/cobrands/eastsussex/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/eastsussex/layout.scss b/web/cobrands/eastsussex/layout.scss new file mode 100644 index 000000000..a6e919229 --- /dev/null +++ b/web/cobrands/eastsussex/layout.scss @@ -0,0 +1,261 @@ +@import "_colours";; +@import "../sass/layout"; + +/* from http://nicolasgallagher.com/micro-clearfix-hack/ */ +.clearfix:before, +.clearfix:after { content: " "; display: table; } +.clearfix:after { clear: both; } +/* For IE 6/7 only */ +.clearfix { *zoom: 1; } + +#front-main { + padding: 0 +} +#front-main-container { + background-color: $eastsussex_primary; + padding: 1em; +} + +.container, .eastsussex-container { + width: 100%; + max-width: 966px; +} + +#menu { + height: 55px; +} + +footer { + position: relative; + z-index: 1000; + margin-top: 0; + background: #aee1f4; + + a { + text-decoration: underline; + } + + h2 { + margin: 0; + } + + form.newsletter.form { + input#newsletter { + display: inline-block; + } + + input[type=submit] { + background: #1e5b83; + text-transform: none; + } + + label { + font-weight: normal; + } + } +} + + +div.form-error, p.form-error { + display: block !important; +} + +body.mappage { + .main-menu-wrapper { + position: fixed + } + + footer { + display: none; + } + + #fms_pan_zoom { + top: 16em!important; + } + + #mysociety { + margin-top: 0; + padding-top: 0; + width: auto; + background: transparent; + } + + .content { + width: 27em; + } + + #wrapper { + display: block; + width: auto; + } + + #report-a-problem-sidebar { + top: 1em; + } +} + +.general-sidebar-notes p, #report-a-problem-sidebar p, #report-a-problem-sidebar .sidebar-notes .plain-list li { + font-size: 13px; + line-height: 14px; +} + +body.twothirdswidthpage.alertindex .content .sticky-sidebar aside { + top: -17em; +} + +body.twothirdswidthpage .content .sticky-sidebar aside { + top: 0; + position: absolute; +} + +body.frontpage { + #site-header { + height: auto; + + .mobile-header-nav { + display: none; + } + } +} + +#site-header { + border-top-width: 0; + margin-top: 0; + background: rgb(3, 160, 227); + + .container { + position: relative; + } + + #nav-container.container { + min-height: 0; + } + + #breadcrumb_breadcrumbTrail { + position: relative; + + a { + color: white; + } + + + .breadcrumb { + margin: 9px 0 6px 0; + + span { + font-weight: bold; + } + + li.level1 a { + color: #194c7e; + } + } + + .sign-in { + position: absolute; + top: 4px; + right: 4px; + } + } + + .header { + a.contact { + text-decoration: underline; + } + + .alphabet h2 { + font-size: 1em; + font-weight: bold; + } + } +} + +#mysociety { + margin-top: 0; + padding-bottom: 24px; + + .container { + padding: 0; + } +} + +.content { + margin-top: 0; + width: auto; +} + +body.twothirdswidthpage .content aside { + box-shadow: 0 0 12px 0 #dae1e5; +} + +.banner p#fixed { + background-position: -328px -333px; +} + +#skipped-map { + clear: both; + margin-top: 3em; /* required to push "Your Reports" visible on Safari/IE */ +} + +#main-nav { + margin-top: 106px; + ul { + margin-left: 157px; + float: none; + } +} + +#main-nav ul li { + text-align: center; + text-transform: uppercase; + padding: 0 15px; + font-size: 16px; + border-right: solid 1px white; + line-height: 1.5em; +} + +#main-nav ul li a { + padding: 0; + font-size: inherit; +} + +#main-nav ul li:last-child { + border-right: none; +} + +#main-nav ul li a:link, #main-nav ul li a:visited { + color: #fff; +} + +#main-nav ul li:hover, #main-nav ul li:hover a, { + background-color: white; + color: black; + text-decoration: none; +} + +.main-menu-wrapper { + display: none; +} + + + +@media only screen and (max-width: 61em) { + #main-nav { + padding-left: 0px; + float:none; + } + + #site-header { + height: auto; + } + + body.twothirdswidthpage .content .sticky-sidebar { + top: 1em; + } +} + +@media only screen and (min-width: 48em) { + footer { + display: block; + } +} diff --git a/web/cobrands/eastsussex/position_map.js b/web/cobrands/eastsussex/position_map.js new file mode 100644 index 000000000..30ee88c67 --- /dev/null +++ b/web/cobrands/eastsussex/position_map.js @@ -0,0 +1,21 @@ +function position_map_box() { + var $html = $('html'); + if ($html.hasClass('ie6')) { + $('#map_box').prependTo('body').css({ + zIndex: -1, position: 'absolute', + top: 0, left: 0, right: 0, bottom: 0, + width: '100%', height: $(window).height(), + margin: 0 + }); + } else { + $('#map_box').prependTo('body').css({ + zIndex: -1, position: 'fixed', + top: 0, left: 0, right: 0, bottom: 0, + width: '100%', height: '100%', + margin: 0 + }); + } +} + +function map_fix() {} +var slide_wards_down = 0; diff --git a/web/cobrands/fixmystreet/fixmystreet.js b/web/cobrands/fixmystreet/fixmystreet.js index 073f745dd..054bd4480 100644 --- a/web/cobrands/fixmystreet/fixmystreet.js +++ b/web/cobrands/fixmystreet/fixmystreet.js @@ -462,7 +462,9 @@ $.fn.drawer = function(id, ajax) { if (cobrand == 'bromley') { offset = -110; } - heightFix(window, '.content', offset, 1); + if (cobrand !== "eastsussex") { + heightFix(window, '.content', offset, 1); + } // in case we have a map that isn't full screen map_fix(); } |