From d9e060579b195fd7fdee26f58ef032a70a6fecce Mon Sep 17 00:00:00 2001 From: Louis Kirkham Date: Tue, 30 Jul 2024 14:51:33 +0100 Subject: [PATCH 1/6] Copy change for RAG labels Signed-off-by: Louis Kirkham Updates RAG options with new labels https://app.asana.com/0/1200504523179345/1207930030109384/f --- forms/appraisal_form.rb | 6 +++--- spec/support/shared_contexts/appraisal_form_context.rb | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/forms/appraisal_form.rb b/forms/appraisal_form.rb index 03fee18eb..07e046c86 100644 --- a/forms/appraisal_form.rb +++ b/forms/appraisal_form.rb @@ -59,9 +59,9 @@ class AppraisalForm ] RAG_OPTIONS_2025 = [ - %w[Red negative], - %w[Amber average], - %w[Green positive], + ["Does not meet expectations", "negative"], + ["Meets expectations", "average"], + ["Exceeds expectations", "positive"], ] CSR_RAG_OPTIONS_2016 = [ diff --git a/spec/support/shared_contexts/appraisal_form_context.rb b/spec/support/shared_contexts/appraisal_form_context.rb index 443c85001..275f80a85 100644 --- a/spec/support/shared_contexts/appraisal_form_context.rb +++ b/spec/support/shared_contexts/appraisal_form_context.rb @@ -79,7 +79,7 @@ def assert_rag_change(section_id, header_id) find(".dropdown-menu .rag-negative").click wait_for_ajax expect(page).to have_selector(rag, text: "Select RAG", count: 3) - expect(page).to have_selector(rag, text: "Red", count: 1) + expect(page).to have_selector(rag, text: "Does not meet expectations", count: 1) expect(page).to have_selector(rag, text: "Select verdict", count: 1) end @@ -90,7 +90,7 @@ def assert_rag_change(section_id, header_id) within section_id do expect(page).to have_selector(rag, text: "Select RAG", count: 3) - expect(page).to have_selector(rag, text: "Red", count: 1) + expect(page).to have_selector(rag, text: "Does not meet expectations", count: 1) expect(page).to have_selector(rag, text: "Select verdict", count: 1) end visit show_path From a4beb446dde8491f22c4eaed41c76cddaa610b45 Mon Sep 17 00:00:00 2001 From: Louis Kirkham Date: Wed, 31 Jul 2024 12:43:45 +0100 Subject: [PATCH 2/6] Updates styles of RAG labels --- app/assets/stylesheets/admin/base.scss | 110 +++++------------- .../case_summary_pdfs/general/data_pointer.rb | 8 +- .../_rag_section.html.slim | 30 ++--- .../_verdict_section.html.slim | 7 +- forms/appraisal_form.rb | 2 +- .../shared_contexts/appraisal_form_context.rb | 6 +- 6 files changed, 53 insertions(+), 110 deletions(-) diff --git a/app/assets/stylesheets/admin/base.scss b/app/assets/stylesheets/admin/base.scss index b339e12cc..5f3da1585 100644 --- a/app/assets/stylesheets/admin/base.scss +++ b/app/assets/stylesheets/admin/base.scss @@ -1583,9 +1583,9 @@ label.govuk-label.govuk-checkboxes__label.boolean.optional.govuk-label { } .btn-rag { - position: absolute; right: 0; top: pxToRem(-5); + padding-right: pxToRem(5); @include screen-xs-max { display: block; @@ -1598,6 +1598,25 @@ label.govuk-label.govuk-checkboxes__label.boolean.optional.govuk-label { } } + .btn { + padding-left: pxToRem(5) !important; + + &.rag-positive { + background-color: #CCE1D8; + color: #015A30 !important; + } + + &.rag-average { + background-color: #C0D3E8; + color: #152C48 !important; + } + + &.rag-negative { + background-color: #F6D7D2; + color: #942415 !important; + } + } + .strengths-section & { @include screen-lg-max { display: block; @@ -1624,7 +1643,7 @@ label.govuk-label.govuk-checkboxes__label.boolean.optional.govuk-label { .caret { position: absolute; top: 50%; - right: 0; + right: pxToRem(5); margin-top: pxToRem(-2); } @@ -1635,7 +1654,7 @@ label.govuk-label.govuk-checkboxes__label.boolean.optional.govuk-label { } .dropdown-toggle { - padding-right: pxToRem(25); + padding-right: pxToRem(20); padding-left: 0; @include screen-xs-max { @@ -1655,10 +1674,6 @@ label.govuk-label.govuk-checkboxes__label.boolean.optional.govuk-label { } } - &.rag-editable .dropdown-toggle { - padding-right: pxToRem(40); - } - .dropdown-menu { &.pull-right { @include screen-xs-max { @@ -1692,88 +1707,14 @@ label.govuk-label.govuk-checkboxes__label.boolean.optional.govuk-label { color: #a94442 !important; } - .rag-blank { - &, - a, - a:hover, - a:focus { - color: $black; - } - - .icon-rag { - background-image: image-url("icon-grade-blank.png"); - - @include is-retina { - background-image: image-url("icon-grade-blank@2.png"); - } - } - } - - .rag-neutral { + .rag-blank, .rag-neutral, .rag-positive, .rag-average, .rag-negative { &, a, a:hover, a:focus { color: $black; - } - - .icon-rag { - background-image: image-url("icon-grade-neutral.png"); - - @include is-retina { - background-image: image-url("icon-grade-neutral@2.png"); - } - } - } - - .rag-positive { - &, - a, - a:hover, - a:focus { - color: $green; - } - - .icon-rag { - background-image: image-url("icon-grade-green.png"); - - @include is-retina { - background-image: image-url("icon-grade-green@2.png"); - } - } - } - - .rag-average { - &, - a, - a:hover, - a:focus { - color: $amber; - } - - .icon-rag { - background-image: image-url("icon-grade-amber.png"); - - @include is-retina { - background-image: image-url("icon-grade-amber@2.png"); - } - } - } - - .rag-negative { - &, - a, - a:hover, - a:focus { - color: $red; - } - - .icon-rag { - background-image: image-url("icon-grade-red.png"); - - @include is-retina { - background-image: image-url("icon-grade-red@2.png"); - } + text-decoration: none; + font: normal pxToRem(16) 'Arial', sans-serif; } } @@ -1785,6 +1726,7 @@ label.govuk-label.govuk-checkboxes__label.boolean.optional.govuk-label { a:hover, a:focus { text-decoration: none; + font-weight: normal; } } } diff --git a/app/pdf_generators/case_summary_pdfs/general/data_pointer.rb b/app/pdf_generators/case_summary_pdfs/general/data_pointer.rb index 6fa2e6e90..15459743e 100644 --- a/app/pdf_generators/case_summary_pdfs/general/data_pointer.rb +++ b/app/pdf_generators/case_summary_pdfs/general/data_pointer.rb @@ -4,9 +4,9 @@ module CaseSummaryPdfs::General::DataPointer "sustainable_development" => "Sustainable Development" } COLOR_LABELS = %w[positive average negative neutral] - POSITIVE_COLOR = "6B8E23" - AVERAGE_COLOR = "DAA520" - NEGATIVE_COLOR = "FF0000" + POSITIVE_COLOR = "017E44" + AVERAGE_COLOR = "2C5C96" + NEGATIVE_COLOR = "B72C1A" NEUTRAL_COLOR = "ECECEC" LINK_REGEXP = /((?:https?:\/\/|www\d{0,3}[.]|[a-z0-9.-]+[.][a-z]{2,4}\/)(?:[^\s()<>`!{}:;'"\[\]]*))/im @@ -186,9 +186,9 @@ def render_items end pdf_doc.text entry[0], header_text_properties + pdf_doc.move_down 3.mm pdf_doc.text entry[2], header_text_properties.merge({ color: color_by_value(entry[2], year) }) - pdf_doc.move_down 5.mm pdf_doc.text entry[1], header_text_properties.merge({ style: :normal }) diff --git a/app/views/admin/form_answers/appraisal_form_components/_rag_section.html.slim b/app/views/admin/form_answers/appraisal_form_components/_rag_section.html.slim index e565c9f92..19b24e6bd 100644 --- a/app/views/admin/form_answers/appraisal_form_components/_rag_section.html.slim +++ b/app/views/admin/form_answers/appraisal_form_components/_rag_section.html.slim @@ -4,28 +4,28 @@ .form-group.rag-section[class="#{'form-edit' if f.object.public_send(section.desc).blank? && editable} form-#{section.label.parameterize}" data-controller="element-focus"] .form-container + label.form-label.form-label-rag for="#{f.object.position}_#{section.desc}_comment" + span.rag_section_label + = section.label + = f.input section.rate, as: :select, label: false, collection: form.options, input_html: { class: "if-js-hide", "data-updated-section" => section.rate, id: "#{f.object.position}_#{section.desc}_select" } - label.form-label.form-label-rag for="#{f.object.position}_#{section.desc}_comment" - span.rag_section_label - = section.label - .btn-group.btn-rag class="#{'rag-editable' if editable}" - button.btn.btn-link.dropdown-toggle type="button" data-toggle="dropdown" aria-expanded="false" class="rag-#{form.option[1]}" - span.rag-text= form.option[0] - span.glyphicon.icon-rag - - if editable - span.caret + .btn-group.btn-rag.if-no-js-hide class="#{'rag-editable' if editable}" + button.btn.dropdown-toggle type="button" data-toggle="dropdown" aria-expanded="false" class="rag-#{form.option[1]} rag_#{f.object.public_send(section.rate)}" + span.rag-text= form.option[0] - if editable - ul.dropdown-menu.pull-right role="menu" - - form.options.each do |opt| - li class="rag-#{opt[1]}" - = link_to "#" - span.icon-rag - span.rag-text= opt[0] + span.caret + - if editable + ul.dropdown-menu role="menu" + - form.options.each do |opt| + li class="rag-#{opt[1]}" + = link_to "#" + span.icon-rag + span.rag-text= opt[0] .form-value p diff --git a/app/views/admin/form_answers/appraisal_form_components/_verdict_section.html.slim b/app/views/admin/form_answers/appraisal_form_components/_verdict_section.html.slim index a862dd28f..84680a35d 100644 --- a/app/views/admin/form_answers/appraisal_form_components/_verdict_section.html.slim +++ b/app/views/admin/form_answers/appraisal_form_components/_verdict_section.html.slim @@ -4,15 +4,16 @@ .form-group.verdict-section[class="#{'form-edit' if f.object.public_send(section.desc).blank? && editable} form-#{section.label.parameterize}" data-controller="element-focus"] .form-container + label.form-label.form-label-rag for="#{f.object.position}_verdict" + = section.label + = f.input section.rate, as: :select, label: false, collection: form.options, input_html: { class: "if-js-hide", "data-updated-section" => section.desc, id: "#{f.object.position}_#{section.desc}_select"} - label.form-label.form-label-rag for="#{f.object.position}_verdict" - = section.label - .btn-group.btn-rag class="#{'rag-editable' if rag_editable}" + .btn-group.btn-rag.if-no-js-hide class="#{'rag-editable' if rag_editable}" button.btn.btn-link.dropdown-toggle class="#{'non-editable' if !rag_editable}" type="button" data-toggle="dropdown" aria-expanded="false" class="rag-#{form.option[1]}" span.rag-text= form.option[0] span.glyphicon.icon-rag diff --git a/forms/appraisal_form.rb b/forms/appraisal_form.rb index 07e046c86..816562bd0 100644 --- a/forms/appraisal_form.rb +++ b/forms/appraisal_form.rb @@ -263,7 +263,7 @@ def self.rag_options_for(object, section) option = options.detect do |opt| opt[1] == object.public_send(section.rate) - end || ["Select RAG", "blank"] + end || ["Select evaluation", "blank"] OpenStruct.new( options: options, diff --git a/spec/support/shared_contexts/appraisal_form_context.rb b/spec/support/shared_contexts/appraisal_form_context.rb index 275f80a85..e45a3e284 100644 --- a/spec/support/shared_contexts/appraisal_form_context.rb +++ b/spec/support/shared_contexts/appraisal_form_context.rb @@ -72,13 +72,13 @@ def assert_rag_change(section_id, header_id) expect(page).to have_css(section_id) # Forces capybara to wait for the section to become visible within section_id do - expect(page).to have_selector(rag, text: "Select RAG", count: 4) + expect(page).to have_selector(rag, text: "Select evaluation", count: 4) expect(page).to have_selector(rag, text: "Select verdict", count: 1) first(".btn-rag").click find(".dropdown-menu .rag-negative").click wait_for_ajax - expect(page).to have_selector(rag, text: "Select RAG", count: 3) + expect(page).to have_selector(rag, text: "Select evaluation", count: 3) expect(page).to have_selector(rag, text: "Does not meet expectations", count: 1) expect(page).to have_selector(rag, text: "Select verdict", count: 1) end @@ -89,7 +89,7 @@ def assert_rag_change(section_id, header_id) take_a_nap within section_id do - expect(page).to have_selector(rag, text: "Select RAG", count: 3) + expect(page).to have_selector(rag, text: "Select evaluation", count: 3) expect(page).to have_selector(rag, text: "Does not meet expectations", count: 1) expect(page).to have_selector(rag, text: "Select verdict", count: 1) end From 52c023869f611bb9113d5cefd209f24defa57d22 Mon Sep 17 00:00:00 2001 From: Louis Kirkham Date: Wed, 31 Jul 2024 16:10:52 +0100 Subject: [PATCH 3/6] Guard patch for missing method error Adds guards for missing method when trying to call keys on eligibility errors. This error is shown when previous award winner is true but no year has been entered. https://app.asana.com/0/0/1207921559820514/f --- app/controllers/form_award_eligibilities_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/form_award_eligibilities_controller.rb b/app/controllers/form_award_eligibilities_controller.rb index 6ad0be272..5e0088325 100644 --- a/app/controllers/form_award_eligibilities_controller.rb +++ b/app/controllers/form_award_eligibilities_controller.rb @@ -39,7 +39,7 @@ def show @award_eligibility.force_validate_now = true @award_eligibility.valid? - step = @award_eligibility.errors.keys.first + step = @award_eligibility.errors.try(:keys).try(:first) end if step From cd3cc3a2e5948778280a31cdbad1bdfc7433ab0b Mon Sep 17 00:00:00 2001 From: Louis Kirkham Date: Thu, 1 Aug 2024 11:30:16 +0100 Subject: [PATCH 4/6] Use all years for admin search when no params Signed-off-by: Louis Kirkham Changes selected year to all for admin search default Clears up params to use :year --- .../form_answers/_admin_award_year.html.slim | 55 ++++++++----------- 1 file changed, 23 insertions(+), 32 deletions(-) diff --git a/app/views/shared/form_answers/_admin_award_year.html.slim b/app/views/shared/form_answers/_admin_award_year.html.slim index f714c97cf..dc3979f9c 100644 --- a/app/views/shared/form_answers/_admin_award_year.html.slim +++ b/app/views/shared/form_answers/_admin_award_year.html.slim @@ -1,42 +1,33 @@ - current_year = AwardYear.current.year -- selected_year = params[:year] ? params[:year].to_i : current_year +- selected_year = params[:year] ? params[:year].to_i : namespace_name == :admin ? 'all_years' : current_year - other_years = AwardYear.admin_switch.keys.select{ |year| year <= current_year } fieldset.award-year-z-index.applications-filter.award-year-radios label.applications-filter__label ' Award year .input__award-years - .if-no-js-hide - input type="radio" id="current_year" name="award_year" value="#{current_year}" checked=(current_year == params[:year].to_i || (namespace_name == :assessor && other_years.exclude?(params[:year].to_i))) - label for="current_year" - | Current year - input type="radio" id="all_years" name="award_year" value="all_years" checked=(params[:year].to_s == 'all_years' || (namespace_name == :admin && other_years.exclude?(params[:year].to_i))) - label for="all_years" - | All years - input type="radio" id="other" name="award_year" value="#{selected_year}" checked=(current_year != selected_year && other_years.include?(params[:year].to_i)) - label for="other" - | Other + input type="radio" id="current_year" name="year" value="#{current_year}" checked=(current_year == params[:year].to_i || (namespace_name == :assessor && other_years.exclude?(params[:year].to_i))) + label for="current_year" + | Current year + input type="radio" id="all_years" name="year" value="all_years" checked=(params[:year].to_s == 'all_years' || (namespace_name == :admin && other_years.exclude?(params[:year].to_i))) + label for="all_years" + | All years + input type="radio" id="other" name="year" value="#{selected_year}" checked=(current_year != selected_year && other_years.include?(params[:year].to_i)) + label for="other" + | Other - .dropdown.other-years-dropdown class="#{(current_year != selected_year && other_years.include?(params[:year].to_i) ? '' : 'hide')}" - a.dropdown-toggle.btn.btn-block.btn-default href="#" data-toggle="dropdown" role="button" aria-expanded="false" - - current_year_text = params[:year].to_s == "all_years" || !params[:year] || !other_years.include?(params[:year].to_i) ? "All Years" : "#{selected_year - 1} - #{selected_year}" + .dropdown.other-years-dropdown class="#{(current_year != selected_year && other_years.include?(params[:year].to_i) ? '' : 'hide')}" + a.dropdown-toggle.btn.btn-block.btn-default href="#" data-toggle="dropdown" role="button" aria-expanded="false" + - current_year_text = params[:year].to_s == "all_years" || !params[:year] || !other_years.include?(params[:year].to_i) ? "All Years" : "#{selected_year - 1} - #{selected_year}" - = current_year_text - span.caret-container - span.caret - ul.dropdown-menu.dropdown-menu-right - li class="#{'active' if params[:year].to_s == 'all_years' || !params[:year]}" id="all_years" - = link_to "All Years", "#" + = current_year_text + span.caret-container + span.caret + ul.dropdown-menu.dropdown-menu-right + li class="#{'active' if params[:year].to_s == 'all_years' || !params[:year]}" id="all_years" + = link_to "All Years", "#" - - AwardYear.admin_switch.each do |year, label| - - if year <= current_year - li class="#{'active' if label == current_year_text}" id="#{year}" - = link_to label, "#" - - select name="year" id="award_year" class="form-control if-js-hide" - option value="all_years" selected=(params[:year].to_s == 'all_years' || (namespace_name == :admin && other_years.exclude?(params[:year].to_i))) - | All years - - AwardYear.admin_switch.each do |year, label| - - if year <= current_year - option value="#{year}" selected=(year == selected_year) - = label + - AwardYear.admin_switch.each do |year, label| + - if year <= current_year + li class="#{'active' if label == current_year_text}" id="#{year}" + = link_to label, "#" From 8639ae95e72580e47417b8070d595ade16a52d4b Mon Sep 17 00:00:00 2001 From: Louis Kirkham Date: Thu, 1 Aug 2024 15:37:48 +0100 Subject: [PATCH 5/6] Change cloud foundry path Signed-off-by: Louis Kirkham --- .github/workflows/ci.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7261b681b..5d980e5b6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -110,8 +110,10 @@ jobs: SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} run: | npm install -g yarn - curl -v -L -o cf-cli_amd64.deb 'https://cli.run.pivotal.io/stable?release=debian64&source=github' - sudo dpkg -i cf-cli_amd64.deb + wget -q -O - https://packages.cloudfoundry.org/debian/cli.cloudfoundry.org.key | sudo apt-key add - + echo "deb https://packages.cloudfoundry.org/debian stable main" | sudo tee /etc/apt/sources.list.d/cloudfoundry-cli.list + sudo apt-get update + sudo apt-get install cf7-cli cf -v cf add-plugin-repo CF-Community https://plugins.cloudfoundry.org cf install-plugin blue-green-deploy -r CF-Community -f From 46f9b6ba8d344b0ce0e3e71c96d80a07608824c8 Mon Sep 17 00:00:00 2001 From: Louis Kirkham Date: Fri, 2 Aug 2024 08:22:07 +0100 Subject: [PATCH 6/6] Disable duplicate inputs on submit Signed-off-by: Louis Kirkham The non-js select is used to pass the year params, so we disable the checked radio input on submit to not duplicate the year param --- .../admin/applications-filter.js.coffee | 13 +++++ .../form_answers/_admin_award_year.html.slim | 53 +++++++++++-------- 2 files changed, 44 insertions(+), 22 deletions(-) diff --git a/app/assets/javascripts/admin/applications-filter.js.coffee b/app/assets/javascripts/admin/applications-filter.js.coffee index 1b1f412be..35213169c 100644 --- a/app/assets/javascripts/admin/applications-filter.js.coffee +++ b/app/assets/javascripts/admin/applications-filter.js.coffee @@ -132,11 +132,17 @@ filterApplicationsDropdowns = () -> dropdownWrapper.removeClass("hide") dropdown = dropdownWrapper.find(".dropdown-toggle") dropdown.focus().click() + $(this).prop('disabled', true); else selected_year = $(this).val() $(this).closest(".input__award-years").find("select option[value='#{selected_year}']").attr('selected', true).change() + $(this).prop('disabled', true); $(this).closest('form').submit() + # If other option is selected on page load, disable the radio button + if $(".applications-filter .input__award-years input[type='radio']:checked").attr('id') == "other" + $(".applications-filter .input__award-years input[type='radio']:checked").prop('disabled', true); + # On clicking the award year from the other year dropdown $(document).on "click", ".applications-filter .other-years-dropdown .dropdown-menu li", (e) -> e.stopPropagation() @@ -146,4 +152,11 @@ filterApplicationsDropdowns = () -> $(this).closest(".input__award-years").find("select option[value='#{selected_year}']").attr('selected', true).change() $(this).closest('form').submit() + # On clicking the search button disable the radio button input + $(document).on "click", ".applications-filter .search-input input.search-submit", (e) -> + e.stopPropagation() + e.preventDefault() + $(".applications-filter .input__award-years input[type='radio']:checked").prop('disabled', true); + $(this).closest('form').submit() + $(document).ready(ready) diff --git a/app/views/shared/form_answers/_admin_award_year.html.slim b/app/views/shared/form_answers/_admin_award_year.html.slim index dc3979f9c..b1fc74bda 100644 --- a/app/views/shared/form_answers/_admin_award_year.html.slim +++ b/app/views/shared/form_answers/_admin_award_year.html.slim @@ -6,28 +6,37 @@ fieldset.award-year-z-index.applications-filter.award-year-radios label.applications-filter__label ' Award year .input__award-years - input type="radio" id="current_year" name="year" value="#{current_year}" checked=(current_year == params[:year].to_i || (namespace_name == :assessor && other_years.exclude?(params[:year].to_i))) - label for="current_year" - | Current year - input type="radio" id="all_years" name="year" value="all_years" checked=(params[:year].to_s == 'all_years' || (namespace_name == :admin && other_years.exclude?(params[:year].to_i))) - label for="all_years" - | All years - input type="radio" id="other" name="year" value="#{selected_year}" checked=(current_year != selected_year && other_years.include?(params[:year].to_i)) - label for="other" - | Other + .if-no-js-hide + input type="radio" id="current_year" name="year" value="#{current_year}" checked=(current_year == params[:year].to_i || (namespace_name == :assessor && other_years.exclude?(params[:year].to_i))) + label for="current_year" + | Current year + input type="radio" id="all_years" name="year" value="all_years" checked=(params[:year].to_s == 'all_years' || (namespace_name == :admin && other_years.exclude?(params[:year].to_i))) + label for="all_years" + | All years + input type="radio" id="other" name="year" value="#{selected_year}" checked=(current_year != selected_year && other_years.include?(params[:year].to_i)) + label for="other" + | Other - .dropdown.other-years-dropdown class="#{(current_year != selected_year && other_years.include?(params[:year].to_i) ? '' : 'hide')}" - a.dropdown-toggle.btn.btn-block.btn-default href="#" data-toggle="dropdown" role="button" aria-expanded="false" - - current_year_text = params[:year].to_s == "all_years" || !params[:year] || !other_years.include?(params[:year].to_i) ? "All Years" : "#{selected_year - 1} - #{selected_year}" + .dropdown.other-years-dropdown class="#{(current_year != selected_year && other_years.include?(params[:year].to_i) ? '' : 'hide')}" + a.dropdown-toggle.btn.btn-block.btn-default href="#" data-toggle="dropdown" role="button" aria-expanded="false" + - current_year_text = params[:year].to_s == "all_years" || !params[:year] || !other_years.include?(params[:year].to_i) || selected_year == "all_years" ? "All Years" : "#{selected_year - 1} - #{selected_year}" - = current_year_text - span.caret-container - span.caret - ul.dropdown-menu.dropdown-menu-right - li class="#{'active' if params[:year].to_s == 'all_years' || !params[:year]}" id="all_years" - = link_to "All Years", "#" + = current_year_text + span.caret-container + span.caret + ul.dropdown-menu.dropdown-menu-right + li class="#{'active' if params[:year].to_s == 'all_years' || !params[:year]}" id="all_years" + = link_to "All Years", "#" - - AwardYear.admin_switch.each do |year, label| - - if year <= current_year - li class="#{'active' if label == current_year_text}" id="#{year}" - = link_to label, "#" + - AwardYear.admin_switch.each do |year, label| + - if year <= current_year + li class="#{'active' if label == current_year_text}" id="#{year}" + = link_to label, "#" + + select name="year" id="award_year" class="form-control if-js-hide" + option value="all_years" selected=(params[:year].to_s == 'all_years' || (namespace_name == :admin && other_years.exclude?(params[:year].to_i))) + | All years + - AwardYear.admin_switch.each do |year, label| + - if year <= current_year + option value="#{year}" selected=(year == selected_year) + = label