diff options
-rw-r--r-- | perllib/FixMyStreet/Cobrand/EastSussex.pm | 64 | ||||
-rw-r--r-- | templates/web/eastsussex/around/intro.html | 4 | ||||
-rw-r--r-- | templates/web/eastsussex/footer.html.template | 2 | ||||
-rw-r--r-- | templates/web/eastsussex/header.html.template | 5 | ||||
-rw-r--r-- | templates/web/eastsussex/report/new/category.html | 18 | ||||
-rw-r--r-- | web/cobrands/eastsussex/base.scss | 45 | ||||
-rw-r--r-- | web/cobrands/eastsussex/layout.scss | 18 |
7 files changed, 142 insertions, 14 deletions
diff --git a/perllib/FixMyStreet/Cobrand/EastSussex.pm b/perllib/FixMyStreet/Cobrand/EastSussex.pm index 9eadbed4e..94b404bc3 100644 --- a/perllib/FixMyStreet/Cobrand/EastSussex.pm +++ b/perllib/FixMyStreet/Cobrand/EastSussex.pm @@ -42,5 +42,69 @@ sub enter_postcode_text { # 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 }); +} + 1; 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/footer.html.template b/templates/web/eastsussex/footer.html.template index e98ea7168..b5b1a8ac6 100644 --- a/templates/web/eastsussex/footer.html.template +++ b/templates/web/eastsussex/footer.html.template @@ -7,7 +7,7 @@ <div class="nav-wrapper clearfix"> <div class="main-menu-wrapper"> <div class="main-menu"> - <ul class="clearfix" id="mobile-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 diff --git a/templates/web/eastsussex/header.html.template b/templates/web/eastsussex/header.html.template index c7fda68f4..20e3b9417 100644 --- a/templates/web/eastsussex/header.html.template +++ b/templates/web/eastsussex/header.html.template @@ -28,10 +28,7 @@ <div class="container" id="nav-container"> <nav id="breadcrumb_breadcrumbTrail"> - <ol class="breadcrumb screen large"> - <li> - <a href="/">FixMyStreet</a> - </li> + <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 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/web/cobrands/eastsussex/base.scss b/web/cobrands/eastsussex/base.scss index 4dc63f800..581223b60 100644 --- a/web/cobrands/eastsussex/base.scss +++ b/web/cobrands/eastsussex/base.scss @@ -11,6 +11,10 @@ body { font-size: 13px; } +footer { + background: #00a1de; +} + .content { padding: 0 1em; } @@ -47,6 +51,16 @@ h1.main { 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 { @@ -80,6 +94,12 @@ h1.main { 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; } @@ -149,9 +169,11 @@ body > p { } } +footer { + display: none; +} + .footer .languages ul { - padding: 0; - margin: 0; li { display: inline-block; @@ -163,6 +185,23 @@ 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; } @@ -183,4 +222,4 @@ button, input[type=submit], .btn { #geolocate_link { font-size: 1.0em; -}
\ No newline at end of file +} diff --git a/web/cobrands/eastsussex/layout.scss b/web/cobrands/eastsussex/layout.scss index e4a897cc9..a6e919229 100644 --- a/web/cobrands/eastsussex/layout.scss +++ b/web/cobrands/eastsussex/layout.scss @@ -55,6 +55,7 @@ footer { } } + div.form-error, p.form-error { display: block !important; } @@ -115,10 +116,6 @@ body.frontpage { display: none; } } - - .content { - margin-top: 3em; - } } #site-header { @@ -175,8 +172,11 @@ body.frontpage { #mysociety { margin-top: 0; - padding-top: 24px; padding-bottom: 24px; + + .container { + padding: 0; + } } .content { @@ -184,7 +184,7 @@ body.frontpage { width: auto; } -.content, body.twothirdswidthpage .content aside { +body.twothirdswidthpage .content aside { box-shadow: 0 0 12px 0 #dae1e5; } @@ -253,3 +253,9 @@ body.frontpage { top: 1em; } } + +@media only screen and (min-width: 48em) { + footer { + display: block; + } +} |