Extract title to helper

This commit is contained in:
Adrien Maston
2026-01-12 14:55:32 +01:00
parent 05c0cbb839
commit caafebbf22
8 changed files with 11 additions and 7 deletions
+4
View File
@@ -40,6 +40,10 @@ module FiltersHelper
}, &block
end
def filter_title(title)
tag.strong title, class: "popup__title", tabindex: (-1 if platform.mobile?), autofocus: platform.mobile?
end
def collapsible_nav_section(title, **properties, &block)
tag.details class: "nav__section popup__section", data: { action: "toggle->nav-section-expander#toggle", nav_section_expander_target: "section", nav_section_expander_key_value: title.parameterize }, open: true, **properties do
concat(tag.summary(class: "popup__section-title") do
@@ -16,7 +16,7 @@
</template>
<%= filter_dialog "Board…" do %>
<%= tag.strong "Board…", class: "popup__title", tabindex: (-1 if platform.mobile?), autofocus: platform.mobile? %>
<%= filter_title "Board…" %>
<%= text_field_tag nil, nil, id: nil, placeholder: "Filter…", class: "input input--transparent txt-small font-weight-normal", autofocus: !platform.mobile?,
type: "search", autocorrect: "off", autocomplete: "off", data: { "1p-ignore": "true", filter_target: "input", action: "input->filter#filter" } %>
+1 -1
View File
@@ -16,7 +16,7 @@
</template>
<%= filter_dialog "Person…" do %>
<%= tag.strong "Person…", class: "popup__title", tabindex: (-1 if platform.mobile?), autofocus: platform.mobile? %>
<%= filter_title "Person…" %>
<%= text_field_tag nil, nil, id: nil, placeholder: "Filter…", class: "input input--transparent txt-small font-weight-normal", autofocus: !platform.mobile?,
type: "search", autocorrect: "off", autocomplete: "off", data: { "1p-ignore": "true", filter_target: "input", action: "input->filter#filter" } %>
@@ -16,7 +16,7 @@
</template>
<%= filter_dialog "Assigned to…" do %>
<%= tag.strong "Assigned to…", class: "popup__title", tabindex: (-1 if platform.mobile?), autofocus: platform.mobile? %>
<%= filter_title "Assigned to…" %>
<% if Current.account.users.active.many? %>
<%= text_field_tag nil, nil, id: nil, placeholder: "Filter…", class: "input input--transparent txt-small", autofocus: !platform.mobile?,
type: "search", autocorrect: "off", autocomplete: "off", data: { "1p-ignore": "true", filter_target: "input", action: "input->filter#filter" } %>
+1 -1
View File
@@ -17,7 +17,7 @@
</template>
<%= filter_dialog "Board…" do %>
<%= tag.strong "Board…", class: "popup__title", tabindex: (-1 if platform.mobile?), autofocus: platform.mobile? %>
<%= filter_title "Board…" %>
<% if user_filtering.boards.many? %>
<%= text_field_tag nil, nil, id: nil, placeholder: "Filter…", class: "input input--transparent txt-small", autofocus: !platform.mobile?,
type: "search", autocorrect: "off", autocomplete: "off", data: { "1p-ignore": "true", filter_target: "input", action: "input->filter#filter" } %>
+1 -1
View File
@@ -17,7 +17,7 @@
</template>
<%= filter_dialog "Closed by…" do %>
<%= tag.strong "Closed by…", class: "popup__title", tabindex: (-1 if platform.mobile?), autofocus: platform.mobile? %>
<%= filter_title "Closed by…" %>
<% if user_filtering.users.many? %>
<%= text_field_tag nil, nil, id: nil, placeholder: "Filter…", class: "input input--transparent txt-small", autofocus: !platform.mobile?,
type: "search", autocorrect: "off", autocomplete: "off", data: { "1p-ignore": "true", filter_target: "input", action: "input->filter#filter" } %>
@@ -17,7 +17,7 @@
</template>
<%= filter_dialog "Added by…" do %>
<%= tag.strong "Added by…", class: "popup__title", tabindex: (-1 if platform.mobile?), autofocus: platform.mobile? %>
<%= filter_title "Added by…" %>
<% if user_filtering.users.many? %>
<%= text_field_tag nil, nil, id: nil, placeholder: "Filter…", class: "input input--transparent txt-small", autofocus: !platform.mobile?,
type: "search", autocorrect: "off", autocomplete: "off", data: { "1p-ignore": "true", filter_target: "input", action: "input->filter#filter" } %>
+1 -1
View File
@@ -15,7 +15,7 @@
</template>
<%= filter_dialog "Tagged…" do %>
<%= tag.strong "Tagged…", class: "popup__title", tabindex: (-1 if platform.mobile?), autofocus: platform.mobile? %>
<%= filter_title "Tagged…" %>
<% if user_filtering.tags.many? %>
<%= text_field_tag nil, nil, id: nil, placeholder: "Filter…", class: "input input--transparent txt-small", autofocus: !platform.mobile?,
type: "search", autocorrect: "off", autocomplete: "off", data: { "1p-ignore": "true", filter_target: "input", action: "input->filter#filter" } %>