Skip to content

Commit

Permalink
Renamed js widget to ransack_search_form, scoped I18n keys
Browse files Browse the repository at this point in the history
  • Loading branch information
ndbroadbent committed Dec 18, 2012
1 parent 7e2808a commit 9d63da7
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
(($) ->
$.widget 'ransack.search_form',
$.widget 'ransack.ransack_search_form',
options: {}

_create: ->
Expand Down
2 changes: 1 addition & 1 deletion app/views/ransack_ui/_condition_fields.html.haml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.fields.condition{ "data-object-name" => f.object_name }
%p
= link_to_remove_fields t(:remove_condition), f, options
= link_to_remove_fields t('ransack.remove_condition'), f, options
= f.attribute_fields do |a|
%span.fields{ "data-object-name" => f.object_name }
Expand Down
4 changes: 2 additions & 2 deletions app/views/ransack_ui/_grouping_fields.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
.combinator
- key = (f.object_name =~ /[0]/) ? :group_first : :group_rest
- combinator = f.combinator_select({}, :class => 'ransack_combinator')
= t(key, :combinator => combinator).html_safe
= t("ransack.#{key}", :combinator => combinator).html_safe

.filters
- f.object.build_condition unless f.object.conditions.any?
= f.condition_fields do |c|
= render 'ransack_ui/condition_fields', :f => c, :options => options

%p
= link_to_add_fields t(:add_condition), f, :condition, options
= link_to_add_fields t('ransack.add_condition'), f, :condition, options
4 changes: 2 additions & 2 deletions app/views/ransack_ui/_search.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
= render 'ransack_ui/grouping_fields', :f => g, :options => options

%p
= link_to_add_fields t(:add_group), f, :grouping, options
= link_to_add_fields t('ransack.add_group'), f, :grouping, options

%hr

Expand All @@ -22,4 +22,4 @@
.pull-right
= hidden_field_tag :distinct, '1'
= hidden_field_tag :page, '1'
= f.submit t(:submit), :class => 'btn btn-primary btn-large'
= f.submit t('ransack.submit'), :class => 'btn btn-primary btn-large'
12 changes: 6 additions & 6 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ en:
gteq_any: "is after or on any"
gteq_all: "is after or on all"

submit: Search
add_group: Add a filter group
group_first: "Show results where %{combinator} of the following match:"
group_rest: "...and where %{combinator} of the following match:"
add_condition: Add a filter
remove_condition: Remove filter
submit: Search
add_group: Add a filter group
group_first: "Show results where %{combinator} of the following match:"
group_rest: "...and where %{combinator} of the following match:"
add_condition: Add a filter
remove_condition: Remove filter
2 changes: 1 addition & 1 deletion lib/ransack_ui/view_helpers.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module RansackUI
module ViewHelpers
def ransack_ui_search(options)
def ransack_ui_search(options = {})
render 'ransack_ui/search', :options => options
end

Expand Down

0 comments on commit 9d63da7

Please sign in to comment.