diff options
author | Chris Mytton <self@hecticjeff.net> | 2013-09-13 12:12:14 +0100 |
---|---|---|
committer | Chris Mytton <self@hecticjeff.net> | 2013-09-13 12:12:14 +0100 |
commit | b44f9edab53f59fb442e5ee4db28cb25408c652c (patch) | |
tree | e7cd62bd148a5332e1ec625dda6c3bc6b09ceb62 /web | |
parent | 2099ac31a4410f2cf8e1c7d31dc35cdd9ac1e070 (diff) | |
parent | 94ac7786132a538a5742ba325eb7fe9eff89cfc9 (diff) |
Merge branch 'master' into oxfordshire-usability-recommendations
Diffstat (limited to 'web')
-rw-r--r-- | web/cobrands/fixmystreet/fixmystreet.js | 2 | ||||
-rw-r--r-- | web/cobrands/sass/_layout.scss | 83 | ||||
-rw-r--r-- | web/cobrands/zurich/_zurich.scss | 4 | ||||
-rw-r--r-- | web/js/fixmystreet-admin.js | 61 | ||||
-rw-r--r-- | web/js/map-OpenStreetMap.js | 8 |
5 files changed, 152 insertions, 6 deletions
diff --git a/web/cobrands/fixmystreet/fixmystreet.js b/web/cobrands/fixmystreet/fixmystreet.js index 5c914e3a8..d4dfdf99f 100644 --- a/web/cobrands/fixmystreet/fixmystreet.js +++ b/web/cobrands/fixmystreet/fixmystreet.js @@ -373,7 +373,7 @@ $.fn.drawer = function(id, ajax) { //add permalink on desktop, force hide on mobile if (cobrand != 'zurich') { - $('#sub_map_links').append('<a href="#" id="map_permalink">Permalink</a>'); + $('#sub_map_links').append('<a href="#" id="map_permalink">' + translation_strings.permalink + '</a>'); } if($('.mobile').length){ diff --git a/web/cobrands/sass/_layout.scss b/web/cobrands/sass/_layout.scss index 07f944ffa..126e44685 100644 --- a/web/cobrands/sass/_layout.scss +++ b/web/cobrands/sass/_layout.scss @@ -1032,11 +1032,92 @@ $button_bg_col: #a1a1a1; // also search bar (tables) border: none; padding: 3px 0.5em; } + tr.is-deleted { + background-color: #ffdddd; + td.contact-category { + text-decoration: line-through; + } + } + } + .no-bullets { + margin-left: 0; + > li { + list-style: none; + } + } + .fms-admin-warning, .fms-admin-info, .admin-hint { + display: none; // don't display admin-notes unless .show-admin-notes class is present + } + &.show-admin-notes { + .fms-admin-warning, .fms-admin-info, .admin-hint { + display: block; + } + .fms-admin-warning, .fms-admin-info { + padding: 1em; + font-size: 90%; + border-style: solid; + border-width: 1px; + border-left-width: 1em; + margin-bottom: 1em; + } + .fms-admin-warning { + border-color: #f99; + background-color: #ffe1e1; + } + .fms-admin-info { + border-color: #9f9; + background-color: #e1ffe1; + } + .admin-open311-only { + border:1px solid #666; + padding:1em; + margin: 1em 0; + } + .admin-hint { + font-size: 80%; // little question marks are small + cursor: pointer; + display: block; + float:left; + overflow: hidden; + padding: 0.2em; + margin-right: 0.666em; + text-align: center; + color: #fff; + font-weight: bold; + background-color: #f93; + -moz-border-radius: 0.333em; + -webkit-border-radius: 0.333em; + border-radius: 0.333em; + p { + display:none; + } + &:before { content: "?" } + &.admin-hint-show { + font-size: 90%; + text-align: left; + display: block; + float:none; + margin:1em 0; + &:before { content: "" } + background-color: inherit !important; + p { + font-weight: normal; + display: block; + background-color: #ff9; + color: #000; + border-style: solid; + border-width: 1px; + border-left-width: 1em; + border-color: #f93; + padding:1em; + margin: 0; + } + } } + } } - /* MEDIA QUERIES */ @media only screen and (min-width: 48em) and (max-width: 61em) { .container { diff --git a/web/cobrands/zurich/_zurich.scss b/web/cobrands/zurich/_zurich.scss index c9eb7a080..f9ea29d9a 100644 --- a/web/cobrands/zurich/_zurich.scss +++ b/web/cobrands/zurich/_zurich.scss @@ -35,3 +35,7 @@ body.frontpage #zurich-footer-wrapper { #zurich-footer a:hover { color: #3c3c3c; } + +.muted, .muted a { + color: #aaa; +} diff --git a/web/js/fixmystreet-admin.js b/web/js/fixmystreet-admin.js new file mode 100644 index 000000000..1aabf8349 --- /dev/null +++ b/web/js/fixmystreet-admin.js @@ -0,0 +1,61 @@ +$(function(){ + // available for admin pages + + // hide the open311_only section and reveal it only when send_method is relevant + var $open311_only = $('.admin-open311-only'); + + function hide_or_show_open311(hide_fast) { + var send_method = $('#send_method').val(); + var show_open311 = false; + if ($('#endpoint').val()) { + show_open311 = true; // always show the form if there is an endpoint value + } else if (send_method && send_method.toLowerCase() != 'email') { + show_open311 = true; + } + if (show_open311) { + $open311_only.slideDown(); + } else { + if (hide_fast) { + $open311_only.hide(); + } else { + $open311_only.slideUp(); + } + } + } + + if ($open311_only) { + $('#send_method').on('change', hide_or_show_open311); + hide_or_show_open311(true); + } + + if ($('body').hasClass("show-admin-notes")) { + + // admin hints: maybe better implemented as tooltips? + $(".admin-hint").on('click', function(){ + if ($(this).hasClass('admin-hint-show')) { + $(this).removeClass('admin-hint-show'); + } else { + $(this).addClass('admin-hint-show'); + } + }); + + // on a body's page, hide/show deleted contact categories + var $table_with_deleted_contacts = $('table tr.is-deleted td.contact-category').closest('table'); + if ($table_with_deleted_contacts.length == 1) { + var $toggle_deleted_btn = $("<input type='submit' class='btn' value='Hide deleted contacts' id='toggle-deleted-contacts-btn' style='margin:1em 0;'/>"); + $table_with_deleted_contacts.before($toggle_deleted_btn); + $toggle_deleted_btn.on('click', function(e){ + e.preventDefault(); + var $cols = $table_with_deleted_contacts.find('tr.is-deleted'); + if ($cols.first().is(':visible')) { + $cols.hide(); + $(this).prop("value", 'Show deleted contacts'); + } else { + $cols.show(); + $(this).prop("value", 'Hide deleted contacts'); + } + }); + } + } +}); + diff --git a/web/js/map-OpenStreetMap.js b/web/js/map-OpenStreetMap.js index 9b8916946..79c646f7b 100644 --- a/web/js/map-OpenStreetMap.js +++ b/web/js/map-OpenStreetMap.js @@ -94,10 +94,10 @@ OpenLayers.Layer.OSM.MapQuestOpen = OpenLayers.Class(OpenLayers.Layer.OSM, { */ initialize: function(name, options) { var url = [ - "http://otile1.mqcdn.com/tiles/1.0.0/osm/${z}/${x}/${y}.png", - "http://otile2.mqcdn.com/tiles/1.0.0/osm/${z}/${x}/${y}.png", - "http://otile3.mqcdn.com/tiles/1.0.0/osm/${z}/${x}/${y}.png", - "http://otile4.mqcdn.com/tiles/1.0.0/osm/${z}/${x}/${y}.png" + "http://otile1.mqcdn.com/tiles/1.0.0/map/${z}/${x}/${y}.png", + "http://otile2.mqcdn.com/tiles/1.0.0/map/${z}/${x}/${y}.png", + "http://otile3.mqcdn.com/tiles/1.0.0/map/${z}/${x}/${y}.png", + "http://otile4.mqcdn.com/tiles/1.0.0/map/${z}/${x}/${y}.png" ]; options = OpenLayers.Util.extend({ /* Below line added to OSM's file in order to allow minimum zoom level */ |