afimb/chouette2

View on GitHub
app/views/access_links/_form.html.erb

Summary

Maintainability
Test Coverage
<%= semantic_form_for [@referential,@access_point,@access_link] do |form| %>
  <%= form.inputs do %> 
    <%= form.input :access_point_id , :as => :hidden %>
    <%= form.input :stop_area_id , :as => :hidden %>
    <%= form.input :link_orientation_type , :as => :hidden%>
    <%= form.input :name %>
    <%= form.input :access_link_type, :as => :select, :collection => Chouette::AccessLink.access_link_types, :include_blank => true, :member_label => Proc.new { |type| t("connection_link_types.label.#{type}") }  %>
    <%= form.input :comment %>
    <%= form.input :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 => !@access_link.new_record?, :input_html => { :title => t("formtastic.titles.access_link.objectid")} %>  
    <%= form.inputs :name => t('access_links.show.durations') do %> 
      <%= form.input :default_duration, :as => :extended_time_picker, :size => 8, :step => :seconds, :label => @access_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 => @access_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 => @access_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 => @access_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 %>
   <% end %>
   <%= form.actions do %>
     <%= form.action :submit, :as => :button %>
     <%= form.action :cancel, :as => :link %>
   <% end %>
<% end %>