Skip to content

Commit d583bfa

Browse files
committed
Merge pull request activeadmin#2228 from Daxter/ui/string_filter_side-by-side
update string filter UI
2 parents d1ba6d4 + 2417845 commit d583bfa

File tree

38 files changed

+30
-66
lines changed

38 files changed

+30
-66
lines changed

app/assets/javascripts/active_admin/pages/application.js.coffee

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,8 @@ $ ->
1414
# Filter form: don't send any inputs that are empty
1515
$('#q_search').submit ->
1616
$(@).find(':input').filter(-> @value is '').prop 'disabled', true
17+
18+
# Filter form: for filters that let you choose the query method from
19+
# a dropdown, apply that choice to the filter input field.
20+
$('.filter_form_field.select_and_search select').change ->
21+
$(@).siblings('input').prop name: "q[#{@value}]"

app/assets/stylesheets/active_admin/_forms.css.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ form.filter_form {
241241
margin-bottom: 10px;
242242
clear: both;
243243

244-
&.filter_numeric {
244+
&.select_and_search {
245245
input[type=text] {
246246
margin-left: $filter-field-seperator-width + 4;
247247
width: $side-by-side-filter-input-width;

config/locales/bg.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ bg:
2424
has_many_remove: "Премахване"
2525
filter: "Филтриране"
2626
clear_filters: "Изчистване"
27-
search_field: "Търсене по %{field}"
2827
contains: "съдържа"
2928
starts_with: "Започва с"
3029
ends_with: "Завършва с"

config/locales/ca.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ ca:
2323
has_many_remove: "Treure"
2424
filter: "Filtrar"
2525
clear_filters: "Treure filtres"
26-
search_field: "Cercar %{field}"
2726
contains: "Conté"
2827
starts_with: "Comença amb"
2928
ends_with: "Acaba amb"

config/locales/cs.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ cs:
2424
has_many_remove: "Odstranit"
2525
filter: "Filtrovat"
2626
clear_filters: "Vyčistit filtry"
27-
search_field: "Prohledat %{field}"
2827
contains: "Obsahuje"
2928
starts_with: "Začíná se"
3029
ends_with: "Končí"

config/locales/da.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ da:
2424
has_many_remove: "Fjern"
2525
filter: "Filtrer"
2626
clear_filters: "Ryd filtre"
27-
search_field: "Søg %{field}"
2827
contains: "Indeholder"
2928
starts_with: "Begynder med"
3029
ends_with: "Slutter med"

config/locales/de-CH.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
has_many_remove: "Entfernen"
2525
filter: "Filtern"
2626
clear_filters: "Filter entfernen"
27-
search_field: "Durchsuche %{field}"
2827
contains: "Enthält"
2928
starts_with: "Beginnt mit"
3029
ends_with: "Endet mit"

config/locales/de.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ de:
2424
has_many_remove: "Entfernen"
2525
filter: "Filtern"
2626
clear_filters: "Filter entfernen"
27-
search_field: "Durchsuche %{field}"
2827
contains: "Enthält"
2928
starts_with: "Beginnt mit"
3029
ends_with: "Endet mit"

config/locales/en-GB.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
has_many_remove: "Remove"
2525
filter: "Filter"
2626
clear_filters: "Clear Filters"
27-
search_field: "Search %{field}"
2827
contains: "Contains"
2928
starts_with: "Starts with"
3029
ends_with: "Ends with"

config/locales/en.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ en:
2424
has_many_remove: "Remove"
2525
filter: "Filter"
2626
clear_filters: "Clear Filters"
27-
search_field: "Search %{field}"
2827
contains: "Contains"
2928
starts_with: "Starts with"
3029
ends_with: "Ends with"

0 commit comments

Comments
 (0)