diff --git a/app/assets/stylesheets/filters.css b/app/assets/stylesheets/filters.css index 7fa28c92f..93bfba2d7 100644 --- a/app/assets/stylesheets/filters.css +++ b/app/assets/stylesheets/filters.css @@ -93,3 +93,9 @@ max-inline-size: calc(100dvw - (2 * var(--block-space-double))); z-index: 1; } + +.quick-filter:has(input:not(.default-value):checked) { + .input--select { + --input-background: var(--color-selected); + } +} diff --git a/app/helpers/filters_helper.rb b/app/helpers/filters_helper.rb index 13413280b..b185233f4 100644 --- a/app/helpers/filters_helper.rb +++ b/app/helpers/filters_helper.rb @@ -10,4 +10,10 @@ module FiltersHelper name = params[key].is_a?(Array) ? "#{key}[]" : key hidden_field_tag name, value, id: nil end + + def any_filters?(filter) + filter.tags.any? || filter.assignees.any? || filter.assigners.any? || + filter.stages.any? || filter.terms.any? || + filter.assignment_status.unassigned? || !filter.default_indexed_by? + end end diff --git a/app/views/filters/_assignees.html.erb b/app/views/filters/_assignees.html.erb new file mode 100644 index 000000000..ddf1399d0 --- /dev/null +++ b/app/views/filters/_assignees.html.erb @@ -0,0 +1,51 @@ +
+ + + + Assigned to… + <%= form_with url: bubbles_path, method: :get, class: "flex flex-column full-width popup__list", + data: { controller: "form" } do |form| %> + <% filter.as_params.except(:assignee_ids, :assignment_status).each do |key, value| %> + <%= filter_hidden_field_tag key, value %> + <% end %> + + <%= link_to bubbles_path(filter.as_params.except(:assignee_ids, :assignment_status)), class: "btn popup__item" do %> + Clear all + <% end %> + + + + <% Current.account.users.active.order(:name).each do |user| %> + + <% end %> + <% end %> + +
\ No newline at end of file diff --git a/app/views/filters/_assigners.html.erb b/app/views/filters/_assigners.html.erb new file mode 100644 index 000000000..8c03625b1 --- /dev/null +++ b/app/views/filters/_assigners.html.erb @@ -0,0 +1,51 @@ +<% if filter.assigners.any? %> +
+ + + + Assigned by… + <%= form_with url: bubbles_path, method: :get, class: "flex flex-column full-width popup__list", + data: { controller: "form" } do |form| %> + <% filter.as_params.except(:assigner_ids).each do |key, value| %> + <%= filter_hidden_field_tag key, value %> + <% end %> + + <%= link_to bubbles_path(filter.as_params.except(:assigner_ids)), class: "btn popup__item" do %> + Clear all + <% end %> + + + + <% Current.account.users.active.without(Current.user).order(:name).each do |user| %> + + <% end %> + <% end %> + +
+<% end %> \ No newline at end of file diff --git a/app/views/filters/_buckets.html.erb b/app/views/filters/_buckets.html.erb new file mode 100644 index 000000000..32c9fee56 --- /dev/null +++ b/app/views/filters/_buckets.html.erb @@ -0,0 +1,40 @@ +<% if filter.buckets.many? %> +
+ + + + In collection + <%= form_with url: bubbles_path, method: :get, class: "flex flex-column full-width popup__list", + data: { controller: "form" } do |form| %> + <% filter.as_params.except(:bucket_ids).each do |key, value| %> + <%= filter_hidden_field_tag key, value %> + <% end %> + + <%= link_to bubbles_path(filter.as_params.except(:bucket_ids)), class: "btn popup__item" do %> + Clear all + <% end %> + + <% filter.buckets.order(:name).each do |bucket| %> + + <% end %> + <% end %> + +
+<% end %> \ No newline at end of file diff --git a/app/views/filters/_dialog.html.erb b/app/views/filters/_dialog.html.erb index c04fb7619..c3f72b621 100644 --- a/app/views/filters/_dialog.html.erb +++ b/app/views/filters/_dialog.html.erb @@ -59,7 +59,7 @@ -
  • In Project
  • +
  • In Collection
  • <%= button_tag type: :button, class: "btn filter__button", data: { action: "filter-form#clearCategory", filter_form_name_param: "bucket_ids[]" } do %> diff --git a/app/views/filters/_indexed_by.html.erb b/app/views/filters/_indexed_by.html.erb new file mode 100644 index 000000000..f42324bdf --- /dev/null +++ b/app/views/filters/_indexed_by.html.erb @@ -0,0 +1,38 @@ +
    + + + + Sort by… + <%= form_with url: bubbles_path, method: :get, class: "flex flex-column full-width popup__list", + data: { controller: "form" } do |form| %> + <% filter.as_params.except(:indexed_by).each do |key, value| %> + <%= filter_hidden_field_tag key, value %> + <% end %> + + + + <% Filter::INDEXES.each do |index| %> + + <% end %> + <% end %> + +
    \ No newline at end of file diff --git a/app/views/filters/_settings.html.erb b/app/views/filters/_settings.html.erb index 6e9abcd05..e172aa880 100644 --- a/app/views/filters/_settings.html.erb +++ b/app/views/filters/_settings.html.erb @@ -5,36 +5,22 @@
    - <%= filter_chip_tag filter.indexed_by.humanize, filter.as_params_without(:indexed_by, filter.indexed_by) unless filter.default_indexed_by? %> - - <% filter.tags.each do |tag| %> - <%= filter_chip_tag tag.hashtag, filter.as_params_without(:tag_ids, tag.id) %> - <% end %> - - <% filter.assignees.each do |assignee| %> - <%= filter_chip_tag "for #{assignee.name}", filter.as_params_without(:assignee_ids, assignee.id) %> - <% end %> - - <% if filter.assignment_status.present? %> - <%= filter_chip_tag filter.assignment_status.humanize, filter.as_params_without(:assignment_status, filter.assignment_status) %> - <% end %> - - <% filter.assigners.each do |assigner| %> - <%= filter_chip_tag "by #{assigner.name}", filter.as_params_without(:assigner_ids, assigner.id) %> - <% end %> - - <% filter.stages.each do |stage| %> - <%= filter_chip_tag "in #{stage.name}", filter.as_params_without(:stage_ids, stage.id) %> - <% end %> - - <% if filter.buckets.many? %> - <% filter.buckets.each do |bucket| %> - <%= filter_chip_tag "in #{bucket.name}", filter.as_params_without(:bucket_ids, bucket.id) %> - <% end %> - <% end %> + <%= render "filters/indexed_by", filter: filter %> + <%= render "filters/buckets", filter: filter %> + <%= render "filters/tags", filter: filter %> + <%= render "filters/assignees", filter: filter %> + <%= render "filters/assigners", filter: filter %> + <%= render "filters/stages", filter: filter %> <% filter.terms.each do |term| %> <%= filter_chip_tag %Q("#{term}"), filter.as_params_without(:terms, term) %> <% end %> + + <% if any_filters?(filter) %> + <%= link_to bubbles_path, class: "btn btn--remove txt-small" do %> + <%= image_tag "close.svg", aria: { hidden: true }, size: 24 %> + Clear all + <% end %> + <% end %>
    diff --git a/app/views/filters/_stages.html.erb b/app/views/filters/_stages.html.erb new file mode 100644 index 000000000..0e6c01d3a --- /dev/null +++ b/app/views/filters/_stages.html.erb @@ -0,0 +1,44 @@ +<% if Current.account.workflows.any? && filter.stages.any? %> +
    + + + + In stage… + <%= form_with url: bubbles_path, method: :get, class: "flex flex-column full-width popup__list", + data: { controller: "form" } do |form| %> + <% filter.as_params.except(:stage_ids).each do |key, value| %> + <%= filter_hidden_field_tag key, value %> + <% end %> + + <%= link_to bubbles_path(filter.as_params.except(:stage_ids)), class: "btn popup__item" do %> + Clear all + <% end %> + + <% Current.account.workflows.order(:name).each do |workflow| %> + <%= workflow.name %> + + <% workflow.stages.order(:name).each do |stage| %> + + <% end %> + <% end %> + <% end %> + +
    +<% end %> \ No newline at end of file diff --git a/app/views/filters/_tags.html.erb b/app/views/filters/_tags.html.erb new file mode 100644 index 000000000..9e7d087f9 --- /dev/null +++ b/app/views/filters/_tags.html.erb @@ -0,0 +1,38 @@ +
    + + + + Tagged… + <%= form_with url: bubbles_path, method: :get, class: "flex flex-column full-width popup__list", + data: { controller: "form" } do |form| %> + <% filter.as_params.except(:tag_ids).each do |key, value| %> + <%= filter_hidden_field_tag key, value %> + <% end %> + + <%= link_to bubbles_path(filter.as_params.except(:tag_ids)), class: "btn popup__item" do %> + Clear all + <% end %> + + <% Current.account.tags.order(:title).each do |tag| %> + + <% end %> + <% end %> + +
    \ No newline at end of file