[refs #921] remove timepicker addon && some fixes

This commit is contained in:
Alexander Machehin 2013-02-21 00:43:00 +06:00
parent e5db61197e
commit ec25a2f275
8 changed files with 47 additions and 1957 deletions

View File

@ -79,4 +79,20 @@ $(document).ready(function() {
perpage_btn[0].click(); perpage_btn[0].click();
return false; return false;
}); });
$('.mediumheight.min').datepicker({
dateFormat: 'dd/mm/yy',
showButtonPanel: true
});
$(".switch").toggle(
function () {
$(".filter").hide("slow");
$(".switch a").text("#{t 'layout.show'}");
},
function () {
$(".filter").show("slow");
$(".switch a").text("#{t 'layout.hide'}");
}
);
}); });

View File

@ -671,7 +671,6 @@ input.mediumheight {
input.mediumheight.min { input.mediumheight.min {
width: 85px; width: 85px;
font-size: 12px; font-size: 12px;
padding-left: 5px;
} }
article .all .top form .butgrp { article .all .top form .butgrp {
margin-top: 20px; margin-top: 20px;

View File

@ -72,10 +72,9 @@ class BuildList::Filter
def build_date_from_params(field_name, params) def build_date_from_params(field_name, params)
return nil if params[field_name].blank? return nil if params[field_name].blank?
return Date.parse(params[field_name]) if params[field_name].strip =~ /\A\d{2}.\d{2}\.\d{4}\z/ params[field_name].strip!
return Date.parse(params[field_name]) if params[field_name] =~ /\A\d{2}\/\d{2}\/\d{4}\z/
time = params[field_name].to_i return Time.at(params[field_name].to_i) if params[field_name] =~ /\A\d+\z/
return Time.at(time) if time != 0 nil
Date.parse params[field_name].trim
end end
end end

View File

@ -48,12 +48,12 @@
.column .column
.floatleft .floatleft
%h3.medium= t '_on' %h3.medium= t '_on'
-date = @filter.updated_at_start ? @filter.updated_at_start.strftime('%d.%m.%Y') : nil -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 =f.text_field :updated_at_start, :readonly => "readonly", :size => 10, :class => 'mediumheight min input_cleanse', :value => date
=link_to image_tag('x-pale.png', :alt => 'x'), '#filter_updated_at_start', :id => 'updated_at_clear' =link_to image_tag('x-pale.png', :alt => 'x'), '#filter_updated_at_start', :id => 'updated_at_clear'
.floatright .floatright
%h3.medium= t 'until' %h3.medium= t 'until'
-date = @filter.updated_at_end ? @filter.updated_at_end.strftime('%d.%m.%Y') : nil -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 =f.text_field :updated_at_end, :readonly => "readonly", :size => 10, :class => 'mediumheight min input_cleanse', :value => date
=link_to image_tag('x-pale.png', :alt => 'x'), '#filter_updated_at_end', :id => 'updated_at_clear' =link_to image_tag('x-pale.png', :alt => 'x'), '#filter_updated_at_end', :id => 'updated_at_clear'
.both .both
@ -73,20 +73,27 @@
.switch .switch
%a{:href => "#"}= t 'layout.hide' %a{:href => "#"}= t 'layout.hide'
:javascript :javascript
$(".switch").toggle( #{if I18n.locale == :ru
function () { "$.datepicker.regional['ru'] = {
$(".filter").hide("slow"); closeText: 'Закрыть',
$(".switch a").text("#{t 'layout.show'}"); prevText: '<Пред',
}, nextText: 'След>',
function () { currentText: 'Сейчас',
$(".filter").show("slow"); monthNames: ['Январь','Февраль','Март','Апрель','Май','Июнь',
$(".switch a").text("#{t 'layout.hide'}"); 'Июль','Август','Сентябрь','Октябрь','Ноябрь','Декабрь'],
} monthNamesShort: ['Янв','Фев','Мар','Апр','Май','Июн',
); 'Июл','Авг','Сен','Окт','Ноя','Дек'],
$('.mediumheight.min').datetimepicker({ dayNames: ['воскресенье','понедельник','вторник','среда','четверг','пятница','суббота'],
dateFormat: 'dd.mm.yy', dayNamesShort: ['вск','пнд','втр','срд','чтв','птн','сбт'],
timeFormat: '', dayNamesMin: ['Вс','Пн','Вт','Ср','Чт','Пт','Сб'],
showTime: false, weekHeader: 'Не',
showHour: false, dateFormat: 'dd/mm/yy',
showMinute: false firstDay: 1,
}); isRTL: false,
showMonthAfterYear: false,
yearSuffix: '',
//showTimezone: true
};
$.datepicker.setDefaults($.datepicker.regional['ru']);"
end
}

File diff suppressed because it is too large Load Diff

View File

@ -18,4 +18,3 @@
//= require chosen.jquery //= require chosen.jquery
// require html5shiv // require html5shiv
// require_tree . // require_tree .
//= require jquery-ui-timepicker-addon

View File

@ -1,10 +0,0 @@
.ui-timepicker-div .ui-widget-header { margin-bottom: 8px; }
.ui-timepicker-div dl { text-align: left; }
.ui-timepicker-div dl dt { height: 25px; margin-bottom: -25px; }
.ui-timepicker-div dl dd { margin: 0 10px 10px 65px; }
.ui-timepicker-div td { font-size: 90%; }
.ui-tpicker-grid-label { background: none; border: none; margin: 0; padding: 0; }
.ui-timepicker-rtl{ direction: rtl; }
.ui-timepicker-rtl dl { text-align: right; }
.ui-timepicker-rtl dl dd { margin: 0 65px 10px 10px; }

View File

@ -14,5 +14,4 @@
@import "codemirror/modes/tiddlywiki"; @import "codemirror/modes/tiddlywiki";
@import "bootstrap"; @import "bootstrap";
@import "chosen.scss"; @import "chosen.scss";
@import "jquery-ui-timepicker-addon.css";