diff options
author | Struan Donald <struan@exo.org.uk> | 2011-10-17 19:20:33 +0100 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2011-10-17 19:20:33 +0100 |
commit | c0e8290e1a1e846dc555d6b03d2fe8bb71057a2c (patch) | |
tree | 0d1066e8821a7f4f3ed92a97a474cb985e8db89e | |
parent | f058885277b593c2e866cf251177fe2d70207edb (diff) |
initial Reading borough council cobrand
-rw-r--r-- | perllib/FixMyStreet/Cobrand/Reading.pm | 80 | ||||
-rw-r--r-- | templates/web/reading/footer.html | 40 | ||||
-rw-r--r-- | templates/web/reading/header.html | 43 | ||||
-rw-r--r-- | web/cobrands/reading/css/mysoc.css | 1 | ||||
-rw-r--r-- | web/cobrands/reading/css/mysoc.scss | 34 | ||||
-rw-r--r-- | web/cobrands/reading/css/print3rdParty.css | 33 | ||||
-rw-r--r-- | web/cobrands/reading/css/reading.css | 176 | ||||
-rwxr-xr-x | web/cobrands/reading/images/favicon.ico | bin | 0 -> 3262 bytes | |||
-rw-r--r-- | web/cobrands/reading/images/reading-borough-council-logo.gif | bin | 0 -> 4575 bytes |
9 files changed, 407 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/Cobrand/Reading.pm b/perllib/FixMyStreet/Cobrand/Reading.pm new file mode 100644 index 000000000..6ec0a7958 --- /dev/null +++ b/perllib/FixMyStreet/Cobrand/Reading.pm @@ -0,0 +1,80 @@ +package FixMyStreet::Cobrand::Reading; +use base 'FixMyStreet::Cobrand::Default'; + +use strict; +use warnings; + +use Carp; +use URI::Escape; +use mySociety::VotingArea; + +sub site_restriction { + return ( "and council='2596'", 'reading', { council => '2596' } ); +} + +sub problems_clause { + return { council => '2596' }; +} + +sub problems { + my $self = shift; + return $self->{c}->model('DB::Problem')->search( $self->problems_clause ); +} + +sub base_url { + my $base_url = mySociety::Config::get('BASE_URL'); + if ($base_url !~ /reading/) { + $base_url =~ s{http://(?!www\.)}{http://reading.}g; + $base_url =~ s{http://www\.}{http://reading.}g; + } + return $base_url; +} + +sub site_title { + my ( $self ) = @_; + return 'Reading City Council FixMyStreet'; +} + +sub enter_postcode_text { + my ( $self ) = @_; + return 'Enter a Reading postcode, or street name and area'; +} + +sub council_check { + my ( $self, $params, $context ) = @_; + + my $councils = $params->{all_councils}; + my $council_match = defined $councils->{2596}; + if ($council_match) { + return 1; + } + my $url = 'http://www.fixmystreet.com/'; + $url .= 'alert' if $context eq 'alert'; + $url .= '?pc=' . URI::Escape::uri_escape_utf8($self->{c}->req->param('pc')) + if $self->{c}->req->param('pc'); + my $error_msg = "That location is not covered by Reading. +Please visit <a href=\"$url\">the main FixMyStreet site</a>."; + return ( 0, $error_msg ); +} + +# All reports page only has the one council. +sub all_councils_report { + return 0; +} + +sub disambiguate_location { + return { + centre => '51.452983169803964,-0.98382678731985973', + span => '0.0833543573028663,0.124500468843446', + bounds => [ '51.409779668156361,-1.0529948144525243', '51.493134025459227,-0.92849434560907829' ], + }; +} + +sub recent_photos { + my ($self, $num, $lat, $lon, $dist) = @_; + $num = 2 if $num == 3; + return $self->problems->recent_photos( $num, $lat, $lon, $dist ); +} + +1; + diff --git a/templates/web/reading/footer.html b/templates/web/reading/footer.html new file mode 100644 index 000000000..900e9bfbb --- /dev/null +++ b/templates/web/reading/footer.html @@ -0,0 +1,40 @@ +</div> +</div> + +<h2 class="v">[% loc('Navigation') %]</h2> +<ul id="navigation"> +<li><a href="/">[% loc("Report a problem") %]</a></li> +<li id="nav_new"><a href="/my">[% loc("Your reports") %]</a></li> +<li><a href="/reports">[% loc("All reports") %]</a></li> +<li><a href="/alert[% pc ? '/list?pc=' : '' %][% pc | uri %]">[% loc("Local alerts") %]</a></li> +<li><a href="/faq">[% loc("Help") %]</a></li> +</ul> + +<div id="footer"> + <p>[% loc('Built by <a href="http://www.mysociety.org/">mySociety</a>') %] + | <a href="/contact">[% loc("Contact FixMyStreet") | replace(' ', ' ') %]</a></p> +[% loc('<a href="http://www.mysociety.org/"><img id="logo" width="133" height="26" src="/i/mysociety-dark.png" alt="View mySociety.org"><span id="logoie"></span></a>') %] +</div> + <!-- start of footer --> + <div style="clear:both"></div> + </div> + <div style="clear:both"></div> + </div> + <div class="footer"> + <div class="contact"> + <p class="title">Contact</p> + <address> + Reading Borough Council<br /> + Civic Centre<br /> + Reading<br /> + RG1 7AE + </address> + <div class="phone"> + <p>Phone: 0118 937 3737<br />Text: 81722</p> + </div> + </div> + <div class="clear"></div> + </div> + </div> +</body> +</html> diff --git a/templates/web/reading/header.html b/templates/web/reading/header.html new file mode 100644 index 000000000..9eb0a4050 --- /dev/null +++ b/templates/web/reading/header.html @@ -0,0 +1,43 @@ +<!doctype html> +<!--[if lt IE 7]><html class="no-js ie6 oldie" lang="[% lang_code %]"><![endif]--> +<!--[if IE 7]> <html class="no-js ie7 oldie" lang="[% lang_code %]"><![endif]--> +<!--[if IE 8]> <html class="no-js ie8 oldie" lang="[% lang_code %]"><![endif]--> +<!--[if gt IE 8]><!--><html class="no-js" lang="[% lang_code %]"><!--<![endif]--> + +<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> +<head id="ctl00_pageHead"> +<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> + <title>Reading Borough Council | Title of 3rd party product</title> + <link rel="shortcut icon" href="[% version('/cobrands/reading/images/favicon.ico') %]"> + <link rel="stylesheet" type="text/css" href="[% version('/css/core.css') %]"> + <link rel="stylesheet" type="text/css" href="[% version('/css/main.css') %]"> + <link rel="stylesheet" type="text/css" href="[% version('/cobrands/reading/css/mysoc.css') %]" /> + <link rel="stylesheet" type="text/css" href="[% version('/cobrands/reading/css/reading.css') %]" /> + <link rel="stylesheet" type="text/css" href="[% version('/cobrands/reading/css/print3rdParty.css') %]" media="print"/> + + [% INCLUDE 'common_header_tags.html' %] + +</head> +<body> + <div class="wrapper"> + <div class="header"> + <p id="reading-logo" class="thirdParty"><img src="/cobrands/reading/images/reading-borough-council-logo.gif" width="176" height="38" alt="reading borough council logo" class="printMe" /><a href="http://www.reading.gov.uk/" title="Click to return to home page">Reading Borough Council</a></p> + </div> + + <div id="content"> + <div class="thirdParty"> + <!-- end of header --> + + [% IF NOT title AND NOT c.req.path %]<h1 id="header">[% ELSE %]<div id="header"><a href="/">[% END %] + [%- loc('Fix<span id="my">My</span>Street') %] + [%- IF NOT title AND NOT c.req.path %]</h1>[% ELSE %]</a></div>[% END %] + + <div id="wrapper"><div id="mysociety"> + <ul id="meta"> + [% IF c.user_exists %] + <li>[% tprintf(loc('Signed in as %s'), c.user.name || c.user.email) %] + <li><a href="/auth/sign_out">[% loc('Sign out') %]</a></li> + [% ELSE %] + <li> </li> + [% END %] + </ul> diff --git a/web/cobrands/reading/css/mysoc.css b/web/cobrands/reading/css/mysoc.css new file mode 100644 index 000000000..1d39c3cbd --- /dev/null +++ b/web/cobrands/reading/css/mysoc.css @@ -0,0 +1 @@ +#navigation{margin-top:110px}#logo{top:12em}#header,#my{background-color:#ecf5fd}a{color:#9C2161}body{font-family:Helvetica, Arial, sans-serif;font-size:13.5px;color:black}#mysociety #postcodeForm{background-color:#ecf5fd}#mysociety #front_stats div{background-color:#ecf5fd} diff --git a/web/cobrands/reading/css/mysoc.scss b/web/cobrands/reading/css/mysoc.scss new file mode 100644 index 000000000..f7951b571 --- /dev/null +++ b/web/cobrands/reading/css/mysoc.scss @@ -0,0 +1,34 @@ +$background: #ecf5fd; + + #navigation { + margin-top: 110px; + } + + #logo { + top: 12em; + } + + #header, #my { + background-color: $background; + } + + a { + color: #9C2161; + } + + body { + font-family: Helvetica, Arial, sans-serif; + font-size: 13.5px; + color: black; + } + +#mysociety { + #postcodeForm { + background-color: $background; + } + + #front_stats div { + background-color: $background; + } + +} diff --git a/web/cobrands/reading/css/print3rdParty.css b/web/cobrands/reading/css/print3rdParty.css new file mode 100644 index 000000000..f5b7ebc83 --- /dev/null +++ b/web/cobrands/reading/css/print3rdParty.css @@ -0,0 +1,33 @@ +body { + background: white; + font-size: 12pt; + color:#000; + } +#access, +.header .social, .nav, .footer { + display: none; +} +.wrapper, #content { + width: auto; + margin: 0 2%; + padding: 0; + border: 0; + float: none !important; + color: black; + background: transparent none; +} +p#logo img.printMe { display:block; vertical-align: bottom; } +div#content { + margin-left: 5%; + padding-top: 1em; + border-top: 1px solid #9c2161; +} +p#logo { + margin-bottom: -8px; +} +a:link, a:visited { + color: #9c2161; + background: transparent; + font-weight: bold; + text-decoration: underline; +}
\ No newline at end of file diff --git a/web/cobrands/reading/css/reading.css b/web/cobrands/reading/css/reading.css new file mode 100644 index 000000000..4daef13c9 --- /dev/null +++ b/web/cobrands/reading/css/reading.css @@ -0,0 +1,176 @@ +html, body, div, span, object, iframe, +h1, h2, h3, h4, h5, h6, p, blockquote, pre, +abbr, address, cite, code, del, dfn, em, img, ins, kbd, q, samp, +small, strong, sub, sup, var, b, i, dl, dt, dd, ol, ul, li, +fieldset, form, label, legend, +table, caption, tbody, tfoot, thead, tr, th, td, +article, aside, canvas, details, figcaption, figure, +footer, header, hgroup, menu, nav, section, summary, +time, mark, audio, video { + margin: 0; + padding: 0; + border: 0; + font-size: 100%; + font: inherit; + vertical-align: baseline; +} +article, aside, details, figcaption, figure, +footer, header, hgroup, menu, nav, section { + display: block; +} +blockquote, q { quotes: none; } +blockquote:before, blockquote:after, +q:before, q:after { content: ''; content: none; } +ins { background-color: #ff9; color: #000; text-decoration: none; } +mark { background-color: #ff9; color: #000; font-style: italic; font-weight: bold; } +del { text-decoration: line-through; } +abbr[title], dfn[title] { border-bottom: 1px dotted; cursor: help; } +table { border-collapse: collapse; border-spacing: 0; } +hr { display: block; height: 1px; border: 0; border-top: 1px solid #ccc; margin: 1em 0; padding: 0; } +input, select { vertical-align: middle; } +body { font:13px/1.231 sans-serif; *font-size:small; } +select, input, textarea, button { font:99% sans-serif; } +pre, code, kbd, samp { font-family: monospace, sans-serif; } +html { overflow-y: scroll; } +a:hover, a:active { outline: none; } +ul, ol { margin-left: 0; } +ol { list-style-type: decimal; } +nav ul, nav li, +.nav ul, .nav li{ margin: 0; list-style:none; list-style-image: none; } +small { font-size: 85%; } +strong, th { font-weight: bold; } +td { vertical-align: top; } +sub, sup { font-size: 75%; line-height: 0; position: relative; } +sup { top: -0.5em; } +sub { bottom: -0.25em; } +pre { white-space: pre; white-space: pre-wrap; word-wrap: break-word; padding: 15px; } +textarea { overflow: auto; } +.ie6 legend, .ie7 legend { margin-left: -7px; } +input[type="radio"] { vertical-align: text-bottom; } +input[type="checkbox"] { vertical-align: bottom; } +.ie7 input[type="checkbox"] { vertical-align: baseline; } +.ie6 input { vertical-align: text-bottom; } +label, input[type="button"], input[type="submit"], input[type="image"], button { cursor: pointer; } +button, input, select, textarea { margin: 0; } +input:valid, textarea:valid { } +input:invalid, textarea:invalid { border-radius: 1px; -moz-box-shadow: 0px 0px 5px red; -webkit-box-shadow: 0px 0px 5px red; box-shadow: 0px 0px 5px red; } +.no-boxshadow input:invalid, .no-boxshadow textarea:invalid { background-color: #f0dddd; } +button { width: auto; overflow: visible; } +img { -ms-interpolation-mode: bicubic; } +body { + margin:0; + padding:0; + font:normal 14px Helvetica, Arial, serif; +} + + + +/*Main Structure*/ +.wrapper { + max-width: 1376px; + margin-bottom:20px; +} +header, nav, footer, +.header, .nav, .footer, +#content{ + margin:0 20px; +} + + +.header {} + +p#reading-logo{ + text-indent:-9999px; + background:url("/cobrands/reading/images/reading-borough-council-logo.gif") top left no-repeat; + width:176px; + padding-bottom:20px; +} +p.thirdParty#reading-logo { margin-top:35px;} +p#reading-logo img.printMe { display:none;} +p#reading-logo a{ + display:block; + height:38px; +} + +#content{ + margin-top:30px; +} +#content h1 { + font-weight: bold; + font-size:1.6em; + margin-bottom:1em; +} +.thirdParty { } +.thirdParty p { margin-bottom:1em;} + .footer .contact { + width:44%!important; + } + .footer .links { + width:55%!important; + margin-right:0!important; + } + .footer .links ul li { + display:inline; + font-size:12px; + margin-right:3px; + border-right:1px solid #999; + padding-right:4px; + } + .footer .links ul li.last { + margin-right:0; + border:none; + paddin-right:0; + } + .footer .partners { + width:100%!important; + } +footer, +.footer{ + margin-top:15px; +} +footer h3, +.footer h3{ + border-bottom:1px solid #b4b4b4; + padding-bottom:3px; + margin-bottom:10px; +} +footer p.title, +.footer p.title{ + border-bottom:1px solid #b4b4b4; + padding-bottom:3px; + margin-bottom:10px; +} +footer .contact, +.footer .contact { + width:38.9%; + margin-top:15px; +} +footer .links, +.footer .links { + width:15%; + margin-top:15px; +} +footer .partners, +.footer .partners { + width:44%; + margin-top:15px; +} +footer h4, +.footer h4 {display:inline;} +footer .contact, +footer .links, +.footer .contact, +.footer .links { + margin-right:1%; +} +footer .contact address, footer .contact .phone, +.footer .contact address, .footer .contact .phone{ + width:49%; +} +footer .contact,footer .links,footer .contact address,footer .contact .phone,footer .partners, +.footer .contact,.footer .links,.footer .contact address,.footer .contact .phone,.footer .partners{ + float:left; + font-style:normal +} +.clear { clear:both;} + diff --git a/web/cobrands/reading/images/favicon.ico b/web/cobrands/reading/images/favicon.ico Binary files differnew file mode 100755 index 000000000..2619d70e9 --- /dev/null +++ b/web/cobrands/reading/images/favicon.ico diff --git a/web/cobrands/reading/images/reading-borough-council-logo.gif b/web/cobrands/reading/images/reading-borough-council-logo.gif Binary files differnew file mode 100644 index 000000000..8532e63ea --- /dev/null +++ b/web/cobrands/reading/images/reading-borough-council-logo.gif |