datepicker tryout

This commit is contained in:
Andreas Stephanides
2013-08-28 16:47:33 +02:00
parent 23c1f50325
commit 3c755d09db
7 changed files with 48 additions and 18 deletions

View File

@@ -1,6 +1,24 @@
class DatepickerInput < FormtasticBootstrap::Inputs::StringInput
def input_html_options
super.merge(:class => "datepicker")
super.merge(:class => "input-append date")
end
def html_options
super.merge(:default => Date.today)
end
def wrapper_html_options
super.merge(:class=>"datepicker",'date-date-format'.to_sym=>"%d.%m.%Y")
end
def controls_wrapper_html_options
super.merge(:class=> "controls", 'date-date'.to_sym =>Time.now.to_date.to_s)
end
#def to_html
# bootstrap_wrapping do
# builder.text_field(method, input_html_options)
# 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

View File

@@ -17,14 +17,14 @@
<ul class="list-group">
<% @calendar.calentries.each do |entry| %>
<li class="list-group-item">
<%= link_to entry.summary+ " - " + I18n.l(entry.start1), entry %>
<%= link_to entry.summary.to_s+ " - " + I18n.l(entry.start1), entry %>
</li>
<% end %>
</ul>
</div>
<div class="row-fluid">
<%= calendar @calendar.calentries do |entry| %>
<div><%= link_to entry.name, entry %></div>
<div><%= link_to entry.name.to_s, entry %></div>
<% end %>
</div>
<div class="row-fluid">

View File

@@ -3,7 +3,7 @@
<%= f.inputs do %>
<div class="row-fluid">
<div class="span6">
<%= f.input :start , :as => :date_string %>
<%= f.input :start , :as => :date_string, :append=>'sadf' %>
</div>
<div class="span6">
<%= f.input :ende , :as => :datepicker %>
@@ -11,7 +11,7 @@
</div>
<div class="row-fluid">
<div class="span12">
<%= f.input :summary %>
<%= f.input :summary, :append=>'g' %>
</div>
</div>
<div class="row-fluid">
@@ -23,7 +23,9 @@
</div>
</div>
<% end %>
<div class="row-fluid"><script>$('.datepicker').datepicker()</script>
<div class="row-fluid">
<script>$('.datepicker').datepicker()</script>
<div class="span12">
<%= f.actions do %>
<%= f.action :submit, :as => :input %>
@@ -32,4 +34,4 @@
</div>
<% end %>
</div>
<script>$('.datepicker').datepicker()</script>

View File

@@ -13,12 +13,12 @@
<% if can?(:verwalten,Gremium) %>
<% if request.fullpath == gremien_path %>
<% if request.fullpath == verwalten_gremien_path %>
<li class="active pull-right">
<% else %>
<li class="pull-right">
<% end %>
<%= link_to "Verwaltung", gremien_path %>
<%= link_to "Verwaltung", verwalten_gremien_path %>
</li>
<% end %>
</ul>