diff options
Diffstat (limited to 'app/assets')
-rw-r--r-- | app/assets/javascripts/admin.js | 3 | ||||
-rw-r--r-- | app/assets/javascripts/admin/category-order.js | 42 | ||||
-rw-r--r-- | app/assets/stylesheets/admin.scss | 17 | ||||
-rw-r--r-- | app/assets/stylesheets/main.scss | 31 | ||||
-rw-r--r-- | app/assets/stylesheets/responsive/_global_style.scss | 3 | ||||
-rw-r--r-- | app/assets/stylesheets/responsive/_new_request_layout.scss | 37 | ||||
-rw-r--r-- | app/assets/stylesheets/responsive/_new_request_style.scss | 7 | ||||
-rw-r--r-- | app/assets/stylesheets/responsive/_user_layout.scss | 9 |
8 files changed, 102 insertions, 47 deletions
diff --git a/app/assets/javascripts/admin.js b/app/assets/javascripts/admin.js index 0b5d56525..4925a65a4 100644 --- a/app/assets/javascripts/admin.js +++ b/app/assets/javascripts/admin.js @@ -1,7 +1,10 @@ // ... //= require jquery //= require jquery.ui.tabs +//= require jquery.ui.sortable +//= require jquery.ui.effect-highlight //= require admin/bootstrap-collapse //= require admin/bootstrap-tab //= require admin/admin +//= require admin/category-order //= require jquery_ujs diff --git a/app/assets/javascripts/admin/category-order.js b/app/assets/javascripts/admin/category-order.js new file mode 100644 index 000000000..3be82e46f --- /dev/null +++ b/app/assets/javascripts/admin/category-order.js @@ -0,0 +1,42 @@ +$(function() { + $('.save-order').each(function(index){ + + // identify the elements that will work together + var save_button = $(this); + var save_notice = save_button.next(); + var save_panel = save_button.parent(); + var list_element = $(save_button.data('list-id')); + var endpoint = save_button.data('endpoint'); + + // on the first list change, show that there are unsaved changes + list_element.sortable({ + update: function (event, ui) { + if (save_button.is('.disabled')){ + save_button.removeClass("disabled"); + save_notice.html(save_notice.data('unsaved-text')); + save_panel.effect('highlight', {}, 2000); + } + } + }); + // on save, POST to endpoint + save_button.click(function(){ + if (!save_button.is('.disabled')){ + var data = list_element.sortable('serialize', {'attribute': 'data-id'}); + var update_call = $.ajax({ data: data, type: 'POST', url: endpoint }); + + // on success, disable the save button again, and show success notice + update_call.done(function(msg) { + save_button.addClass('disabled'); + save_panel.effect('highlight', {}, 2000); + save_notice.html(save_notice.data('success-text')); + }) + // on failure, show error message + update_call.fail(function(jqXHR, msg) { + save_panel.effect('highlight', {'color': '#cc0000'}, 2000); + save_notice.html(save_notice.data('error-text') + jqXHR.responseText); + }); + } + return false; + }) + }); +}); diff --git a/app/assets/stylesheets/admin.scss b/app/assets/stylesheets/admin.scss index b0de2eb7b..104f10c75 100644 --- a/app/assets/stylesheets/admin.scss +++ b/app/assets/stylesheets/admin.scss @@ -27,13 +27,16 @@ body.admin { } .admin { + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; + font-size: 14px; + line-height: 20px; @import "compass/css3"; @import "bootstrap"; #main { + margin-bottom: 50px; padding-top: 50px; - } .form-inline { @@ -47,6 +50,9 @@ body.admin { .accordion-group { border: none; + div { + clear: both; + } } .accordion-heading { .btn { @@ -104,5 +110,14 @@ body.admin { width: 750px; } + .save-notice { + display: inline-block; + padding-left: 1em; + } + + .category-list-item { + padding: 3px 0; + } + } diff --git a/app/assets/stylesheets/main.scss b/app/assets/stylesheets/main.scss index 8aa8010ae..b063b0d77 100644 --- a/app/assets/stylesheets/main.scss +++ b/app/assets/stylesheets/main.scss @@ -586,26 +586,22 @@ width:40%; width:26em; } -#authority_preview { -width:45%; -float:right; -background-color:#FFFFE0; -padding-left:1em; -padding-right:1em; -overflow:hidden; -margin-top:-67px; -} - -#authority_preview #header_left,#authority_preview.request_left,#authority_preview #stepwise_make_request { -width:95%; -} - #request_advice { float:right; width:250px; margin-top:1em; } +#select_authority_help { +background-color: #FEF1F6; +float: right; +margin-top: 31px; +overflow: hidden; +padding-left: 1em; +padding-right: 1em; +width: 45%; +} + #request_advice ul { margin:0 auto; } @@ -1717,16 +1713,11 @@ width:575px; padding-right:50px; } -#authority_preview .request_left, -#authority_preview #header_left { - width: 100%; -} - #request_sidebar h2,.list-filter-item { margin-bottom:10px; } -div.ff-icon-printfix,.comment_in_request_text img.comment_quote,body.front #other-country-notice,#other-country-notice,#authority_preview .public-body-name-prefix,#authority_preview #list-filter,#authority_preview h2.foi_results,div#show_response_view p.event_actions, div.batch_public_body_toggle { +div.ff-icon-printfix,.comment_in_request_text img.comment_quote,body.front #other-country-notice,#other-country-notice,div#show_response_view p.event_actions, div.batch_public_body_toggle { display:none; } diff --git a/app/assets/stylesheets/responsive/_global_style.scss b/app/assets/stylesheets/responsive/_global_style.scss index 290591b5f..af25fb0b0 100644 --- a/app/assets/stylesheets/responsive/_global_style.scss +++ b/app/assets/stylesheets/responsive/_global_style.scss @@ -17,6 +17,9 @@ a { &:focus { color: #333333; } + &:visited { + color: darken(#2688dc, 10%); + } } h1, h2, h3, h4, h5, h6 { diff --git a/app/assets/stylesheets/responsive/_new_request_layout.scss b/app/assets/stylesheets/responsive/_new_request_layout.scss index eec95ae77..a8b24e1b1 100644 --- a/app/assets/stylesheets/responsive/_new_request_layout.scss +++ b/app/assets/stylesheets/responsive/_new_request_layout.scss @@ -11,6 +11,9 @@ @include lte-ie7 { width: 27.125em; } + #query { + width: 80%; + } } } @@ -18,41 +21,19 @@ @include grid-row($behavior: nest); } -#authority_preview { +#select_authority_help { @include grid-column(12); - @include respond-min( $main_menu-mobile_menu_cutoff ){ + @include respond-min( $main_menu-mobile_menu_cutoff ) { @include grid-column(6); - margin-top:-67px; - @include ie8{ + @include ie8 { padding-right: 0.9375em; } @include lte-ie7 { width: 26.188em; } } - - /* Hide some elements of the public body that aren't appropriate in this - context */ - #list-filter, h2.foi_results, .public-body-name-prefix { - display: none; - } - - /* Compact request list for viewing in authority preview column */ - .request_left, #header_left { - @include grid-column(12, $collapse: true); - } - - .request_right { - @include grid-column(12, $collapse: true); - } - - span.desc { - background:none; - line-height:18px; - padding: 0; - } - } + /* /new/[body_name] page */ #request_header { @include grid-row; @@ -77,6 +58,10 @@ } } +#typeahead_response .close-button { + float: right; +} + /* Advice sits on right hand side */ #request_advice { diff --git a/app/assets/stylesheets/responsive/_new_request_style.scss b/app/assets/stylesheets/responsive/_new_request_style.scss index ab144b39f..86e17cbfe 100644 --- a/app/assets/stylesheets/responsive/_new_request_style.scss +++ b/app/assets/stylesheets/responsive/_new_request_style.scss @@ -1,5 +1,12 @@ /* Styles for pages in making a new request */ +/* /select_authority page */ +#select_authority_help { + .info { + font-style: italic; + } +} + /* /new/[body_name] page */ .new_info_request { label { diff --git a/app/assets/stylesheets/responsive/_user_layout.scss b/app/assets/stylesheets/responsive/_user_layout.scss index 8087f978c..84ddbf562 100644 --- a/app/assets/stylesheets/responsive/_user_layout.scss +++ b/app/assets/stylesheets/responsive/_user_layout.scss @@ -1,2 +1,11 @@ /* Layout for user pages */ +#user_profile_search { + #search_form { + margin-top: 2rem; + } + + #request_latest_status { + width: 300px; + } +} |