diff options
author | Matthew Somerville <matthew@mysociety.org> | 2012-07-13 21:57:10 +0100 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2012-07-13 21:57:10 +0100 |
commit | 0a512ce7d620a403a081b0bed500272e4ed55cf7 (patch) | |
tree | 8c924fe23f683cfb1f7de3e50642fed090a53b68 | |
parent | 52a27eb4589102f373dd4835a231301ad6060908 (diff) |
Move default cobrand to new design.
Due to old cobrands, this involves the subclasses implementing the
web templates dir to ignore what the default is doing.
A vaguely garish yet pleasing colour scheme has been chosen so that
the site is both usable and suggests you may want to change it.
-rw-r--r-- | .gitignore | 3 | ||||
-rwxr-xr-x | bin/make_css | 3 | ||||
-rw-r--r-- | perllib/FixMyStreet/App.pm | 5 | ||||
-rw-r--r-- | perllib/FixMyStreet/Cobrand/Base.pm | 2 | ||||
-rw-r--r-- | perllib/FixMyStreet/Cobrand/FiksGataMi.pm | 5 | ||||
-rw-r--r-- | perllib/FixMyStreet/Cobrand/UK.pm | 5 | ||||
-rw-r--r-- | templates/web/fixmystreet/header.html | 6 | ||||
-rw-r--r-- | web/cobrands/default/_colours.scss | 9 | ||||
-rw-r--r-- | web/cobrands/default/base.scss | 7 | ||||
-rw-r--r-- | web/cobrands/default/config.rb | 25 | ||||
-rw-r--r-- | web/cobrands/default/layout.scss | 60 |
11 files changed, 121 insertions, 9 deletions
diff --git a/.gitignore b/.gitignore index dfb7c786e..4785d883f 100644 --- a/.gitignore +++ b/.gitignore @@ -19,10 +19,11 @@ tags /web/cobrands/reading/css/css.css /web/css/core.css /web/css/main.css +/web/cobrands/default/*.css /web/cobrands/fixmystreet/*.css /web/cobrands/bromley/*.css -/web/photo /web/cobrands/barnet/*.css +/web/photo /local /web/cobrands/fixmystreet/compass_app_log.txt diff --git a/bin/make_css b/bin/make_css index 22ebddba2..2a78feb59 100755 --- a/bin/make_css +++ b/bin/make_css @@ -17,9 +17,10 @@ DIRECTORY=$(cd `dirname $0`/../web && pwd) compass compile --output-style compressed $DIRECTORY/cobrands/fixmystreet compass compile --output-style compressed $DIRECTORY/cobrands/bromley compass compile --output-style compressed $DIRECTORY/cobrands/barnet +compass compile --output-style compressed $DIRECTORY/cobrands/default # The rest are plain sass -for scss in `find $DIRECTORY -name "*.scss" -exec dirname {} \; | uniq | grep -v "cobrands/\(fixmystreet\|bromley\|barnet\)"` +for scss in `find $DIRECTORY -name "*.scss" -exec dirname {} \; | uniq | grep -v "cobrands/\(fixmystreet\|bromley\|barnet\|default\)"` do sass --scss --update --style compressed $scss done diff --git a/perllib/FixMyStreet/App.pm b/perllib/FixMyStreet/App.pm index 0adf66ee9..3096f2f72 100644 --- a/perllib/FixMyStreet/App.pm +++ b/perllib/FixMyStreet/App.pm @@ -153,8 +153,7 @@ sub setup_request { my $cobrand = $c->cobrand; # append the cobrand templates to the include path - $c->stash->{additional_template_paths} = $cobrand->path_to_web_templates - unless $cobrand->is_default; + $c->stash->{additional_template_paths} = $cobrand->path_to_web_templates; # work out which language to use my $lang_override = $c->get_override('lang'); @@ -421,7 +420,7 @@ call), use this method. sub render_fragment { my ($c, $template, $vars) = @_; $vars->{additional_template_paths} = $c->cobrand->path_to_web_templates - if $vars && !$c->cobrand->is_default; + if $vars; $c->view('Web')->render($c, $template, $vars); } diff --git a/perllib/FixMyStreet/Cobrand/Base.pm b/perllib/FixMyStreet/Cobrand/Base.pm index fada33b78..4a95294d6 100644 --- a/perllib/FixMyStreet/Cobrand/Base.pm +++ b/perllib/FixMyStreet/Cobrand/Base.pm @@ -62,7 +62,7 @@ Returns the path to the templates for this cobrand - by default sub path_to_web_templates { my $self = shift; - return [ FixMyStreet->path_to( 'templates/web', $self->moniker )->stringify ]; + return [ FixMyStreet->path_to( 'templates/web/fixmystreet' )->stringify ]; } 1; diff --git a/perllib/FixMyStreet/Cobrand/FiksGataMi.pm b/perllib/FixMyStreet/Cobrand/FiksGataMi.pm index 8ff5e3656..03777ac51 100644 --- a/perllib/FixMyStreet/Cobrand/FiksGataMi.pm +++ b/perllib/FixMyStreet/Cobrand/FiksGataMi.pm @@ -8,6 +8,11 @@ use Carp; use mySociety::MaPit; use FixMyStreet::Geocode::OSM; +sub path_to_web_templates { + my $self = shift; + return [ FixMyStreet->path_to( 'templates/web', $self->moniker )->stringify ]; +} + sub country { return 'NO'; } diff --git a/perllib/FixMyStreet/Cobrand/UK.pm b/perllib/FixMyStreet/Cobrand/UK.pm index 1c4c22fa6..174f2579c 100644 --- a/perllib/FixMyStreet/Cobrand/UK.pm +++ b/perllib/FixMyStreet/Cobrand/UK.pm @@ -3,6 +3,11 @@ use base 'FixMyStreet::Cobrand::Default'; use mySociety::VotingArea; +sub path_to_web_templates { + my $self = shift; + return [ FixMyStreet->path_to( 'templates/web', $self->moniker )->stringify ]; +} + sub country { return 'GB'; } sub area_types { return qw(DIS LBO MTD UTA CTY COI); } sub area_types_children { return @$mySociety::VotingArea::council_child_types } diff --git a/templates/web/fixmystreet/header.html b/templates/web/fixmystreet/header.html index 731af797a..44387ba8d 100644 --- a/templates/web/fixmystreet/header.html +++ b/templates/web/fixmystreet/header.html @@ -11,11 +11,11 @@ <meta name="HandHeldFriendly" content="true"> <meta name="mobileoptimized" content="0"> - <link rel="stylesheet" href="[% version('/cobrands/fixmystreet/base.css') %]"> - <link rel="stylesheet" href="[% version('/cobrands/fixmystreet/layout.css') %]" media="(min-width:48em)"> + <link rel="stylesheet" href="[% version('/cobrands/' _ c.cobrand.moniker _ '/base.css') %]"> + <link rel="stylesheet" href="[% version('/cobrands/' _ c.cobrand.moniker _ '/layout.css') %]" media="(min-width:48em)"> [% extra_css %] <!--[if (lt IE 9) & (!IEMobile)]> - <link rel="stylesheet" href="[% version('/cobrands/fixmystreet/layout.css') %]"> + <link rel="stylesheet" href="[% version('/cobrands/' _ c.cobrand.moniker _ '/layout.css') %]"> <![endif]--> <script src="[% version('/js/modernizr.custom.js') %]" charset="utf-8"></script> diff --git a/web/cobrands/default/_colours.scss b/web/cobrands/default/_colours.scss new file mode 100644 index 000000000..2c044a6e7 --- /dev/null +++ b/web/cobrands/default/_colours.scss @@ -0,0 +1,9 @@ +/* COLOURS */ + +$primary: #ff9900; +$primary_b: #000000; +$primary_text: #222222; + +$contrast1: #6688ff; +$contrast1_dark: darken(#6688ff, 10%); +$contrast2: #AA8D11; diff --git a/web/cobrands/default/base.scss b/web/cobrands/default/base.scss new file mode 100644 index 000000000..4594f832f --- /dev/null +++ b/web/cobrands/default/base.scss @@ -0,0 +1,7 @@ +@import "../fixmystreet/_h5bp"; +@import "./_colours"; +@import "../fixmystreet/_mixins"; +@import "compass"; + +@import "../fixmystreet/_base"; + diff --git a/web/cobrands/default/config.rb b/web/cobrands/default/config.rb new file mode 100644 index 000000000..cab97b18f --- /dev/null +++ b/web/cobrands/default/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/default/layout.scss b/web/cobrands/default/layout.scss new file mode 100644 index 000000000..93a3f7120 --- /dev/null +++ b/web/cobrands/default/layout.scss @@ -0,0 +1,60 @@ +@import "_colours"; +@import "../fixmystreet/_layout"; + +/* +Note: The fact that the below has to override the CSS, though it is for the +default template, is a sign that the CSS is not best organised. It needs +refactoring, and making more maintainable through the use of SMACSS, OOCSS +and similar. +*/ + +body { + background: #6688ff; +} + +#front-main { + color: $primary_text; + background: $primary; + // layout sets this because base has it slightly lighter + h2 { + color: $primary_text; + } + a#geolocate_link { + color: $primary_text; + } +} + +.nav-wrapper { + .nav-wrapper-2 { + border-top: 4px solid $primary; + @include border-image(none); + } +} +body.mappage { + .nav-wrapper { + .nav-wrapper-2 { + background: $contrast1; + } + } +} + +#main-nav { + ul { + li { + a, span { + color: #000; + } + } + &#main-menu { + li { + a:hover { + background: $primary; + } + } + } + &#mysoc-menu { + background: $primary; + } + } +} + |