diff options
| author | jpl | 2017-03-02 15:02:25 +0100 | 
|---|---|---|
| committer | jpl | 2017-03-02 15:02:25 +0100 | 
| commit | 1238523513a6699bfdbb7bc1baf63044ed3aab9e (patch) | |
| tree | 722600bb3af098f5dcb6ac17693da5f520aed282 | |
| parent | 3db14baba4d7b2980c6802a746c2e01c2693119b (diff) | |
| download | chouette-core-1238523513a6699bfdbb7bc1baf63044ed3aab9e.tar.bz2 | |
Refs #2704: updating filter/search bars, beginning with workbenches#show
| -rw-r--r-- | app/assets/stylesheets/components/_forms.sass | 24 | ||||
| -rw-r--r-- | app/assets/stylesheets/components/_tables.sass | 4 | ||||
| -rw-r--r-- | app/views/workbenches/show.html.slim | 10 | ||||
| -rw-r--r-- | spec/features/lines_spec.rb | 6 | 
4 files changed, 26 insertions, 18 deletions
| diff --git a/app/assets/stylesheets/components/_forms.sass b/app/assets/stylesheets/components/_forms.sass index 3b0f75d08..14ede2860 100644 --- a/app/assets/stylesheets/components/_forms.sass +++ b/app/assets/stylesheets/components/_forms.sass @@ -58,11 +58,17 @@ input  // Search bar  .search_bar    position: relative +  background-color: rgba($grey, 0.15) +  padding: 7px 15px    width: 100% +  padding-right: 60%    > .form-control +    vertical-align: top +    border-color: rgba($grey, 0.3)      border-radius: 4px -    padding-right: 31px +    height: 31px +    padding: 4px 31px 5px 12px      &:first-child, &:last-child        border-radius: 4px @@ -71,13 +77,13 @@ input      position: absolute      top: 0      bottom: 0 -    right: 0 +    right: 60%      z-index: 2      width: auto      > .btn        margin: 0 -      padding: 6px 9px +      padding: 4px 9px 5px 9px        border: none        border-radius: 0        background-color: transparent @@ -247,10 +253,13 @@ $cbx-size: 20px  .form.form-filter    display: block    position: relative -  background-color: lighten($blue, 58%) +  background-color: rgba($grey, 0.15)    padding-right: 167px    min-height: 42px -  border-bottom: 2px solid $darkgrey +  border-top: 1px solid #fff + +  &:first-child +    border-top: none    > *      display: inline-block @@ -265,7 +274,7 @@ $cbx-size: 20px      .control-label        font-weight: 700 -      color: $blue +      color: $darkgrey        line-height: 34px        margin: 0        padding: 0 10px 0 0 @@ -310,7 +319,6 @@ $cbx-size: 20px      &.togglable        padding: 7px 44px 7px 15px -      // padding-right: 44px        cursor: pointer        > .control-label @@ -324,7 +332,7 @@ $cbx-size: 20px          width: 100%        &:hover, &.open -        background-color: rgba($blue, 0.4) +        background-color: $blue          color: #fff          > .control-label, &:before diff --git a/app/assets/stylesheets/components/_tables.sass b/app/assets/stylesheets/components/_tables.sass index f4519f549..bfbc4183f 100644 --- a/app/assets/stylesheets/components/_tables.sass +++ b/app/assets/stylesheets/components/_tables.sass @@ -106,9 +106,9 @@              background-color: darken($red, 5%)    &.noselect -    .st_action > a +    > ul > .st_action > a        &, &[title='Supprimer'], &:hover, &:focus -        background-color: rgba($grey, 0.65) +        background-color: rgba($grey, 0.3)          cursor: not-allowed    > .info-msg diff --git a/app/views/workbenches/show.html.slim b/app/views/workbenches/show.html.slim index d6b7a5b4e..c5d1da1cc 100644 --- a/app/views/workbenches/show.html.slim +++ b/app/views/workbenches/show.html.slim @@ -13,19 +13,19 @@  .page_content    .container-fluid      - if params[:q].present? or @wbench_refs.any? +      .row.mb-md +        .col-lg-12.text-right +          = new_pagination @wbench_refs +        .row.mb-sm -        .col-lg-5.col-md-6.col-sm-6.col-xs-8 +        .col-lg-12            = search_form_for @q, url: workbench_path(@workbench.id), builder: SimpleForm::FormBuilder do |f|              .input-group.search_bar                = f.search_field :name_cont, class: 'form-control', placeholder: 'Indiquez un nom de référentiel'                span.input-group-btn                  button.btn.btn-default type='submit'                    span.fa.fa-search -        .col-lg-7.col-md-6.col-sm-6.col-xs-4.text-right -          = new_pagination @wbench_refs -      .row -        .col-lg-12            = render 'filters'      - if @wbench_refs.any? diff --git a/spec/features/lines_spec.rb b/spec/features/lines_spec.rb index 4ecefab33..f15d33f60 100644 --- a/spec/features/lines_spec.rb +++ b/spec/features/lines_spec.rb @@ -28,21 +28,21 @@ describe "Lines", :type => :feature do      context 'filtering' do        it 'supports filtering by name' do -        fill_in 'q[name_or_number_or_objectid_cont]', with: lines.first.name +        fill_in 'q[name_or_objectid_cont]', with: lines.first.name          click_button 'search-btn'          expect(page).to have_content(lines.first.name)          expect(page).not_to have_content(lines.last.name)        end        it 'supports filtering by number' do -        fill_in 'q[name_or_number_or_objectid_cont]', with: lines.first.number +        fill_in 'q[name_or_objectid_cont]', with: lines.first.number          click_button 'search-btn'          expect(page).to have_content(lines.first.name)          expect(page).not_to have_content(lines.last.name)        end        it 'supports filtering by objectid' do -        fill_in 'q[name_or_number_or_objectid_cont]', with: lines.first.objectid +        fill_in 'q[name_or_objectid_cont]', with: lines.first.objectid          click_button 'search-btn'          expect(page).to have_content(lines.first.name)          expect(page).not_to have_content(lines.last.name) | 
