#921 date clear refactoring

This commit is contained in:
Alexander Machehin 2013-02-21 19:26:28 +06:00
parent 6208e32b56
commit 55da8fce6f
1 changed files with 7 additions and 10 deletions

View File

@ -44,16 +44,13 @@
html_options.merge(:id => 'mass_build')
.column
.floatleft
%h3.medium= t '_on'
-date = @filter.updated_at_start ? @filter.updated_at_start.strftime('%d/%m/%Y') : nil
=f.text_field :updated_at_start, :readonly => "readonly", :size => 10, :class => 'mediumheight min input_cleanse', :value => date
=link_to image_tag('x.png', :alt => 'x', :class => 'semi'), '#filter_updated_at_start', :id => 'updated_at_clear'
.floatright
%h3.medium= t 'until'
-date = @filter.updated_at_end ? @filter.updated_at_end.strftime('%d/%m/%Y') : nil
=f.text_field :updated_at_end, :readonly => "readonly", :size => 10, :class => 'mediumheight min input_cleanse', :value => date
=link_to image_tag('x.png', :alt => 'x', :class => 'semi'), '#filter_updated_at_end', :id => 'updated_at_clear'
-[:updated_at_start, :updated_at_end].each do |attr|
-class_name, message = attr == :updated_at_start ? %w[floatleft _on] : %w[floatright until]
%div{:class => class_name}
%h3.medium= t message
-date = @filter.send(attr) ? @filter.send(attr).strftime('%d/%m/%Y') : nil
=f.text_field attr, :readonly => "readonly", :size => 10, :class => 'mediumheight min input_cleanse', :value => date
=link_to image_tag('x.png', :alt => 'x', :class => 'semi'), "#filter_#{attr}", :id => 'updated_at_clear'
.both
%h3.medium= t 'layout.build_lists.project_name_search'
%input#filter_project_name.mediumheight.input_cleanse{:name => "filter[project_name]", :size => "30", :type => "text"}/