Pass filter to filter helpers
This commit is contained in:
@@ -3,17 +3,17 @@ module FiltersHelper
|
||||
(Bucket::View::ORDERS[params[:order_by]] || Bucket::View::STATUSES[params[:status]] || Bubble.default_order_by).humanize
|
||||
end
|
||||
|
||||
def tag_filter_text
|
||||
if @filter&.tags
|
||||
@filter.tags.map(&:hashtag).to_choice_sentence
|
||||
def tag_filter_text(filter)
|
||||
if filter.tags
|
||||
filter.tags.map(&:hashtag).to_choice_sentence
|
||||
else
|
||||
"any tag"
|
||||
end
|
||||
end
|
||||
|
||||
def assignee_filter_text
|
||||
if @filter&.assignees
|
||||
"assigned to #{@filter.assignees.pluck(:name).to_choice_sentence}"
|
||||
def assignee_filter_text(filter)
|
||||
if filter.assignees
|
||||
"assigned to #{filter.assignees.pluck(:name).to_choice_sentence}"
|
||||
else
|
||||
"assigned to anyone"
|
||||
end
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<div class="filter align-center gap-half" data-controller="dialog" data-action="keydown.esc->dialog#close click@document->dialog#closeOnClickOutside">
|
||||
<button class="btn btn--plain filter__button" data-action="click->dialog#toggle" data-dialog-modal-value="true">
|
||||
<%= assignee_filter_text %>
|
||||
<%= assignee_filter_text filter %>
|
||||
</button>
|
||||
|
||||
<dialog class="filter__popup panel fill-white shadow" data-dialog-target="dialog">
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<div class="filter align-center gap-half" data-controller="dialog" data-action="keydown.esc->dialog#close click@document->dialog#closeOnClickOutside">
|
||||
<button class="btn btn--plain filter__button" data-action="click->dialog#toggle" data-dialog-modal-value="true">
|
||||
<%= tag_filter_text %>
|
||||
<%= tag_filter_text filter %>
|
||||
</button>
|
||||
|
||||
<dialog class="filter__popup panel fill-white shadow" data-dialog-target="dialog">
|
||||
|
||||
Reference in New Issue
Block a user