diff options
Diffstat (limited to 'web')
-rw-r--r-- | web/cobrands/sass/_layout.scss | 83 | ||||
-rw-r--r-- | web/js/fixmystreet-admin.js | 61 |
2 files changed, 143 insertions, 1 deletions
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/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'); + } + }); + } + } +}); + |