afimb/chouette2

View on GitHub
app/views/connection_links/_form.erb

Summary

Maintainability
Test Coverage
<%= semantic_form_for [@referential, @connection_link] do |form| %>
  <%= form.inputs do %> 
    <%= form.input :name %>
    <%= form.input :connection_link_type, :as => :select, :collection => Chouette::ConnectionLink.connection_link_types, :include_blank => true, :member_label => Proc.new { |type| t("connection_link_types.label.#{type}") }  %>
    <%= form.input :comment %>  
    <%= form.input :link_distance, :input_html => {  :title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.connection_link.link_distance") } %>
    <%= form.input :mobility_restricted_suitability, :as => :select, :collection => [[t("true"), true], [t("false"), false]], :include_blank => true %>
    <%= form.input :stairs_availability, :as => :select, :collection => [[t("true"), true], [t("false"), false]], :include_blank => true %>
    <%= form.input :lift_availability, :as => :select, :collection => [[t("true"), true], [t("false"), false]], :include_blank => true %>

    <%= form.input :objectid, :required => !@connection_link.new_record?, :input_html => { :title => t("formtastic.titles.connection_link.objectid")} %>  
  <% end %>
  <%= form.inputs :name => t('connection_links.show.durations') do %> 
    <%= form.input :default_duration, :as => :extended_time_picker, :size => 8, :step => :seconds, :label => @connection_link.human_attribute_name("default_duration"), :input_html => { :class => "form-control input-sm timepicker_seconds", :step => 1}, :wrapper_html => { :class => "input-append bootstrap-timepicker" } %>       
    <%= form.input :frequent_traveller_duration, :as => :extended_time_picker, :size => 8, :step => :seconds, :include_seconds => true, :label => @connection_link.human_attribute_name("frequent_traveller_duration"), :input_html => { :class => "form-control input-sm timepicker_seconds", :step => 1}, :wrapper_html => { :class => "input-append bootstrap-timepicker" } %>      
    <%= form.input :occasional_traveller_duration, :as => :extended_time_picker, :size => 8, :include_seconds => true, :label => @connection_link.human_attribute_name("occasional_traveller_duration"), :input_html => { :class => "form-control input-sm timepicker_seconds", :step => 1}, :wrapper_html => { :class => "input-append bootstrap-timepicker" } %>        
    <%= form.input :mobility_restricted_traveller_duration, :as => :extended_time_picker,:size => 8, :include_seconds => true, :label => @connection_link.human_attribute_name("mobility_restricted_traveller_duration"), :input_html => { :class => "form-control input-sm timepicker_seconds", :step => 1}, :wrapper_html => { :class => "input-append bootstrap-timepicker" } %>
  <% end %>  

   <%= form.actions do %>
     <%= form.action :submit, :as => :button %>
     <%= form.action :cancel, :as => :link %>
   <% end %>
<% end %>