Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Francis Hwang authored and Francis Hwang committed Feb 23, 2010
1 parent 9f6bafe commit c31877e
Showing 1 changed file with 13 additions and 17 deletions.
30 changes: 13 additions & 17 deletions lib/admin_assistant/column.rb
Original file line number Diff line number Diff line change
Expand Up @@ -264,33 +264,29 @@ def datetime_input(form)
input
end

def datetime_range_input(form)
input = ''
input << "After "
input << DateTimeRangeEndPointSelector.new(
form.object.send(name)[:gt],
:prefix => "search", :field_name => 'gt',
:include_position => true, :index => name, :include_blank => true,
:datetime_separator => ' &mdash; ', :time_separator => ' : '
).select_datetime
input << @action_view.send(
:link_to_function, 'Clear',
"AdminAssistant.clear_datetime_select('search_#{name.underscore}_gt')"
)
input << "&nbsp;&nbsp;&nbsp;Before "
def datetime_range_end_point_input(form, comparator, label)
input = "#{label} "
input << DateTimeRangeEndPointSelector.new(
form.object.send(name)[:lt],
:prefix => "search", :field_name => 'lt',
form.object.send(name)[comparator],
:prefix => "search", :field_name => comparator.to_s,
:include_position => true, :index => name, :include_blank => true,
:datetime_separator => ' &mdash; ', :time_separator => ' : '
).select_datetime
input << @action_view.send(
:link_to_function, 'Clear',
"AdminAssistant.clear_datetime_select('search_#{name.underscore}_lt')"
"AdminAssistant.clear_datetime_select('search_#{name.underscore}_#{comparator}')"
)
input
end

def datetime_range_input(form)
input = ''
input << datetime_range_end_point_input(form, :gt, 'After')
input << "&nbsp;&nbsp;&nbsp;"
input << datetime_range_end_point_input(form, :lt, 'Before')
input
end

def html(form)
input = ''
if @column.field_type == :boolean
Expand Down

0 comments on commit c31877e

Please sign in to comment.