[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();
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 {
width: 85px;
font-size: 12px;
padding-left: 5px;
}
article .all .top form .butgrp {
margin-top: 20px;

View File

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

View File

@ -48,12 +48,12 @@
.column
.floatleft
%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
=link_to image_tag('x-pale.png', :alt => 'x'), '#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
-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-pale.png', :alt => 'x'), '#filter_updated_at_end', :id => 'updated_at_clear'
.both
@ -73,20 +73,27 @@
.switch
%a{:href => "#"}= t 'layout.hide'
:javascript
$(".switch").toggle(
function () {
$(".filter").hide("slow");
$(".switch a").text("#{t 'layout.show'}");
},
function () {
$(".filter").show("slow");
$(".switch a").text("#{t 'layout.hide'}");
}
);
$('.mediumheight.min').datetimepicker({
dateFormat: 'dd.mm.yy',
timeFormat: '',
showTime: false,
showHour: false,
showMinute: false
});
#{if I18n.locale == :ru
"$.datepicker.regional['ru'] = {
closeText: 'Закрыть',
prevText: '<Пред',
nextText: 'След>',
currentText: 'Сейчас',
monthNames: ['Январь','Февраль','Март','Апрель','Май','Июнь',
'Июль','Август','Сентябрь','Октябрь','Ноябрь','Декабрь'],
monthNamesShort: ['Янв','Фев','Мар','Апр','Май','Июн',
'Июл','Авг','Сен','Окт','Ноя','Дек'],
dayNames: ['воскресенье','понедельник','вторник','среда','четверг','пятница','суббота'],
dayNamesShort: ['вск','пнд','втр','срд','чтв','птн','сбт'],
dayNamesMin: ['Вс','Пн','Вт','Ср','Чт','Пт','Сб'],
weekHeader: 'Не',
dateFormat: 'dd/mm/yy',
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 html5shiv
// 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

@ -15,4 +15,3 @@
@import "bootstrap";
@import "chosen.scss";
@import "jquery-ui-timepicker-addon.css";