diff --git a/app/helpers/filters_helper.rb b/app/helpers/filters_helper.rb
index 9fb4bf7ac..98f83d275 100644
--- a/app/helpers/filters_helper.rb
+++ b/app/helpers/filters_helper.rb
@@ -1,14 +1,4 @@
module FiltersHelper
- def filter_title(filter)
- if filter.collections.none?
- Current.user.collections.one? ? Current.user.collections.first.name : "All collections"
- elsif filter.collections.one?
- filter.collections.first.name
- else
- filter.collections.map(&:name).to_sentence
- end
- end
-
def filter_chip_tag(text, params)
link_to cards_path(params), class: "btn txt-x-small btn--remove fill-selected flex-inline" do
concat tag.span(text)
@@ -21,25 +11,6 @@ module FiltersHelper
hidden_field_tag name, value, id: nil
end
- # TODO: REMOVE
- def filter_selected_collections_sentence(filter)
- if filter.collections.any?
- filter.collections.collect { "#{it.name}" }.uniq.sort.to_sentence
- else
- tag.strong "All collections"
- end
- end
-
- def filter_selected_collections_label(filter)
- selected_collections = if filter.collections.any?
- filter.collections.collect { "#{it.name}" }.uniq.sort.to_sentence
- else
- "all collections"
- end
-
- "Activity in #{selected_collections}".html_safe
- end
-
def any_filters?(filter)
filter.tags.any? || filter.assignees.any? || filter.creators.any? || filter.closers.any? ||
filter.stages.any? || filter.terms.any? || filter.card_ids&.any? ||
diff --git a/app/models/user/filtering.rb b/app/models/user/filtering.rb
index e52cea178..f3ac4f2fd 100644
--- a/app/models/user/filtering.rb
+++ b/app/models/user/filtering.rb
@@ -22,4 +22,14 @@ class User::Filtering
def filters
@filters ||= Current.user.filters.all
end
+
+ def collections_title
+ if filter.collections.none?
+ collections.one? ? collections.first.name : "All collections"
+ elsif filter.collections.one?
+ filter.collections.first.name
+ else
+ filter.collections.map(&:name).to_sentence
+ end
+ end
end
diff --git a/app/views/cards/index.html.erb b/app/views/cards/index.html.erb
index 1b5f95849..db952c9f6 100644
--- a/app/views/cards/index.html.erb
+++ b/app/views/cards/index.html.erb
@@ -1,4 +1,4 @@
-<% @page_title = filter_title @filter %>
+<% @page_title = @user_filtering.collections_title %>
<%= render "filters/broadcasts", filter: @filter %>
@@ -13,17 +13,12 @@
<% end %>