Sha256: f8274db85a0b9f857e96fed17c058e7d146d5194d804546f86bef4e513719b1e

Contents?: true

Size: 895 Bytes

Versions: 1

Compression:

Stored size: 895 Bytes

Contents

.d-flex.mt-2
  %button.btn.quick-filter-btn{ type: 'button', 'data-target': '#my_task' }
    - if params[:my_task] == '1'
      %i.bi.bi-check-square
    - else
      %i.bi.bi-square
    Only my tasks
    = hidden_field_tag :my_task, params[:my_task]
  %button.btn.quick-filter-btn{ type: 'button', 'data-target': '#recently_updated' }
    - if params[:recently_updated] == 'asc'
      %i.bi.bi-sort-numeric-down
    - else
      %i.bi.bi-sort-numeric-down-alt
    Last updated
    = hidden_field_tag :recently_updated, params[:recently_updated]

:javascript
  $(document).ready(function() {
    $('.quick-filter-btn').on('click', function() {
      var isFilterActivatedInput = $($(this).attr('data-target'));
      var isFilterActivated = isFilterActivatedInput.val() == 'asc' ? 'desc' : 'asc';
      isFilterActivatedInput.val(isFilterActivated)
      $('#filter-form').submit();
    })
  })

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rails_execution-0.1.12 app/views/rails_execution/tasks/_quick_filter.html.haml