datetimepicker
This commit is contained in:
@@ -26,6 +26,8 @@
|
||||
//= require bootstrap/image-gallery.min
|
||||
//= require jquery-fileupload
|
||||
// require jquery.remotipart
|
||||
//= require jquery.datetimepicker
|
||||
|
||||
function insertAttachment(url,name) {
|
||||
var ext = url.split('.').pop().toLowerCase();
|
||||
var img_ext = [ "jpg", "png", "bmp" , "jpeg" ];
|
||||
|
||||
30
app/inputs/datetimepicker_input.rb
Normal file
30
app/inputs/datetimepicker_input.rb
Normal file
@@ -0,0 +1,30 @@
|
||||
class DatetimepickerInput < FormtasticBootstrap::Inputs::StringInput
|
||||
def input_html_options
|
||||
super
|
||||
super.merge(:class => "datetimepicker",:value=>builder.to_s)
|
||||
end
|
||||
|
||||
def html_options
|
||||
super
|
||||
|
||||
end
|
||||
def wrapper_html_options
|
||||
super.merge(:class=>"")
|
||||
#super.merge(:class=>"datepicker",'date-date-format'.to_sym=>"%d.%m.%Y")
|
||||
end
|
||||
def controls_wrapper_html_options
|
||||
super.merge(:class=> " date input-append", 'data-date'.to_sym =>I18n.l(Date.today()).to_s, 'data-date-format'.to_sym=>I18n.t('date.formats.default-picker'), 'data-time-format'.to_sym=>"hh:mm" ,)
|
||||
end
|
||||
def to_html
|
||||
bootstrap_wrapping do
|
||||
builder.text_field(method, input_html_options) +
|
||||
'<span class="add-on" ><i class="icon-th"></i></span>'.html_safe()
|
||||
end
|
||||
end
|
||||
def options
|
||||
super
|
||||
#d.merge(:class=>"datepicker")
|
||||
#super.merge(:append_content=>'<span class="add-on input-append"
|
||||
#super.merge(:append_content=>'<span class="add-on" ><i class="icon-th"></i></span>')
|
||||
end
|
||||
end
|
||||
@@ -35,6 +35,9 @@ class Calentry < ActiveRecord::Base
|
||||
self.public = (self.try(:object).nil?)? (self.calendar.try(:public?)) : object.try(:public?)
|
||||
true
|
||||
end
|
||||
def s_time=(s_time)
|
||||
start
|
||||
end
|
||||
def start_time
|
||||
start
|
||||
end
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
</div>
|
||||
<div class="span4">
|
||||
<%= f.input :start, :as => :datepicker %></div><div class="span4">
|
||||
<%= f.input :start, :as => :datetimepicker %></div><div class="span4">
|
||||
<%= f.input :dauer , :as => :string, :append=>"h" %></div><div class="span1">
|
||||
<% f.input :typ %></div> <div class="span1"><%= f.check_box :_destroy %> <%= I18n.t 'common.delete' %></div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user