diff options
| author | Marc Florisson | 2012-09-05 08:37:32 +0200 | 
|---|---|---|
| committer | Marc Florisson | 2012-09-05 08:37:32 +0200 | 
| commit | 95041fc13a7d3b40484bb50ba90666dcc58f5425 (patch) | |
| tree | c08cbb7429359f8d17997fb28f894982d37498c3 | |
| parent | d9f7f2da7a8838672681afb521bfb07a7769a96e (diff) | |
| download | chouette-core-95041fc13a7d3b40484bb50ba90666dcc58f5425.tar.bz2 | |
update ninoxe and fix objectid input on form
| -rw-r--r-- | Gemfile.lock | 3 | ||||
| -rw-r--r-- | app/controllers/application_controller.rb | 6 | ||||
| -rw-r--r-- | app/controllers/vehicle_journeys_controller.rb | 13 | ||||
| -rw-r--r-- | app/views/companies/_form.erb | 2 | ||||
| -rw-r--r-- | app/views/connection_links/_form.erb | 2 | ||||
| -rw-r--r-- | app/views/journey_patterns/_form.html.erb | 2 | ||||
| -rw-r--r-- | app/views/lines/_form.erb | 2 | ||||
| -rw-r--r-- | app/views/networks/_form.erb | 2 | ||||
| -rw-r--r-- | app/views/routes/_form.html.erb | 9 | ||||
| -rw-r--r-- | app/views/stop_areas/_form.html.erb | 2 | ||||
| -rw-r--r-- | app/views/vehicle_journeys/_form.html.erb | 6 | 
11 files changed, 17 insertions, 32 deletions
| diff --git a/Gemfile.lock b/Gemfile.lock index 8308116f8..e8929de66 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,6 +1,6 @@  GIT    remote: git://chouette.dryade.priv/ninoxe -  revision: 0f39e9d5591e5c31dee4f259a700532d9e1c882b +  revision: 55d3c3c3f8dde90dc1b30224cefbe679a4ee9786    specs:      ninoxe (0.0.8)        GeoRuby @@ -195,6 +195,7 @@ GEM      jruby-rack (1.1.9)      jruby-rack-worker (0.4-java)        jruby-rack (>= 1.1.1) +    json (1.7.5)      json (1.7.5-java)      json_pure (1.7.5)      launchy (2.1.0) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 8cde89db0..3cb217b9c 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -12,4 +12,10 @@ class ApplicationController < ActionController::Base    def begin_of_association_chain      current_organisation    end + +  # Overwriting the sign_out redirect path method +  def after_sign_out_path_for(resource_or_scope) +    new_user_session_path +  end +    end diff --git a/app/controllers/vehicle_journeys_controller.rb b/app/controllers/vehicle_journeys_controller.rb index a7794fcb2..e83c3c3ff 100644 --- a/app/controllers/vehicle_journeys_controller.rb +++ b/app/controllers/vehicle_journeys_controller.rb @@ -30,19 +30,6 @@ class VehicleJourneysController < ChouetteController      update!(:alert => t('activerecord.errors.models.vehicle_journey.invalid_times'))    end -  def edit -    vehicle_journey.update_journey_pattern( vehicle_journey.journey_pattern) - -    edit! -  end - -  def new -    @vehicle_journey = Chouette::VehicleJourney.new( :route => @route) -    @vehicle_journey.update_journey_pattern( parent.journey_patterns.first) if parent.journey_patterns.first - -    new! -  end -    protected    alias_method :vehicle_journey, :resource diff --git a/app/views/companies/_form.erb b/app/views/companies/_form.erb index 108843ed6..9b605a6a2 100644 --- a/app/views/companies/_form.erb +++ b/app/views/companies/_form.erb @@ -9,7 +9,7 @@      <%= form.input :fax, :as => :phone %>      <%= form.input :email, :as => :email %>                    <%= form.input :registration_number %> -    <%= form.input :objectid, :input_html => { :disabled => !@company.new_record? } %>   +    <%= form.input :objectid, :required => !@company.new_record?, :input_html => { :disabled => !@company.new_record? } %>      <% end %>     <%= form.actions do %> diff --git a/app/views/connection_links/_form.erb b/app/views/connection_links/_form.erb index 4b15b3d07..a0a29d954 100644 --- a/app/views/connection_links/_form.erb +++ b/app/views/connection_links/_form.erb @@ -27,7 +27,7 @@      <%= form.input :stairs_availability,:as => :boolean %>      <%= form.input :lift_availability,:as => :boolean %> -    <%= form.input :objectid, :input_html => { :disabled => !@connection_link.new_record? } %>   +    <%= form.input :objectid, :required => !@connection_link.new_record?, :input_html => { :disabled => !@connection_link.new_record? } %>      <% end %>     <%= form.actions do %> diff --git a/app/views/journey_patterns/_form.html.erb b/app/views/journey_patterns/_form.html.erb index 9d7454b72..9577edd2c 100644 --- a/app/views/journey_patterns/_form.html.erb +++ b/app/views/journey_patterns/_form.html.erb @@ -5,7 +5,7 @@      <%= form.input :registration_number %>                    <%= form.input :comment %>                    <%= form.input :stop_point_ids, :label => stop_point_ids_label(@journey_pattern), :as => :check_boxes, :collection => @route.stop_points.map { |s| [s.stop_area.name, s.id.to_s]}, :input_html => (@journey_pattern.new_record? ? { :checked => 'checked' }:{}) %>               -    <%= form.input :objectid, :input_html => { :disabled => !@journey_pattern.new_record? } %>   +    <%= form.input :objectid, :required => !@journey_pattern.new_record?, :input_html => { :disabled => !@journey_pattern.new_record? } %>      <% end %>     <%= form.actions do %> diff --git a/app/views/lines/_form.erb b/app/views/lines/_form.erb index 76b5b520b..898f04223 100644 --- a/app/views/lines/_form.erb +++ b/app/views/lines/_form.erb @@ -9,7 +9,7 @@      <%= form.input :number %>      <%= form.input :transport_mode, :as => :select, :collection => Chouette::Line.transport_modes, :include_blank => false, :member_label => Proc.new { |mode| t("transport_modes.label.#{mode}") }  %>      <%= form.input :comment %>               -    <%= form.input :objectid, :input_html => { :disabled => !@line.new_record? } %>   +    <%= form.input :objectid, :required => !@line.new_record?, :input_html => { :disabled => !@line.new_record? } %>      <% end %>     <%= form.actions do %> diff --git a/app/views/networks/_form.erb b/app/views/networks/_form.erb index 7b1098c7c..935a61efc 100644 --- a/app/views/networks/_form.erb +++ b/app/views/networks/_form.erb @@ -7,7 +7,7 @@      <%= form.input :description %>                    <%= form.input :source_name %>                    <%= form.input :source_identifier %>               -    <%= form.input :objectid, :input_html => { :disabled => !@network.new_record? } %>   +    <%= form.input :objectid, :required => !@network.new_record?, :input_html => { :disabled => !@network.new_record? } %>      <% end %>     <%= form.actions do %> diff --git a/app/views/routes/_form.html.erb b/app/views/routes/_form.html.erb index 5b383a9d9..050c6dd93 100644 --- a/app/views/routes/_form.html.erb +++ b/app/views/routes/_form.html.erb @@ -7,14 +7,7 @@      <%= form.input :opposite_route, :as => :select, :collection => Hash[@line.routes.map{|r| [r.name,r.id]}] %>      <%= form.input :direction_code, :as => :select, :collection => Chouette::Route.directions, :include_blank => false, :member_label => Proc.new { |mode| t("directions.label.#{mode}") } %>      <%= form.input :wayback_code, :as => :select, :collection => Chouette::Route.waybacks, :include_blank => false, :member_label => Proc.new { |mode| t("waybacks.label.#{mode}") } %> -    <% if @route.new_record? %> -      <%= form.input :objectid %>   -    <% else %> -      <li> -      <label><%= @route.human_attribute_name("objectid") %>: </label> -      <%= @route.objectid %> -      </li> -    <% end %> +    <%= form.input :objectid, :required => !@route.new_record?, :input_html => { :disabled => !@route.new_record? } %>      <% end %>     <%= form.actions do %> diff --git a/app/views/stop_areas/_form.html.erb b/app/views/stop_areas/_form.html.erb index a3b17c4b3..b5541cf20 100644 --- a/app/views/stop_areas/_form.html.erb +++ b/app/views/stop_areas/_form.html.erb @@ -10,7 +10,7 @@      <%= form.input :fare_code %>                    <%= form.input :nearest_topic_name %>                    <%= form.input :comment %>               -    <%= form.input :objectid, :input_html => { :disabled => !@stop_area.new_record? } %>   +    <%= form.input :objectid, :required => !@stop_area.new_record?, :input_html => { :disabled => !@stop_area.new_record? } %>        <%= form.inputs :name => t('stop_areas.show.geographic_data') do %>         <% if ! @referential.projection_type_label.empty? %>          <%= form.inputs :name => @referential.projection_type_label do %>  diff --git a/app/views/vehicle_journeys/_form.html.erb b/app/views/vehicle_journeys/_form.html.erb index d06241973..0c0ccaecc 100644 --- a/app/views/vehicle_journeys/_form.html.erb +++ b/app/views/vehicle_journeys/_form.html.erb @@ -1,6 +1,6 @@  <%= semantic_form_for [@referential, @line, @route, @vehicle_journey] do |form| %>    <%= form.inputs do %>  -    <%= form.input :journey_pattern, :as => :select, :collection => @route.journey_patterns, :include_blank => false, :member_label => Proc.new { |jp| journey_name(jp) }  %> +    <%= form.input :journey_pattern, :as => :select, :collection => @route.journey_patterns, :member_label => Proc.new { |jp| journey_name(jp) }  %>      <%= form.input :published_journey_name %>      <%= form.input :published_journey_identifier %>      <%= form.input :comment %>           @@ -8,9 +8,8 @@      <%= form.input :status_value %>                    <%= form.input :facility %>                    <%= form.input :vehicle_type_identifier%>               -    <%= form.input :objectid, :input_html => { :disabled => !@vehicle_journey.new_record? } %>   +    <%= form.input :objectid, :required => !@vehicle_journey.new_record?, :input_html => { :disabled => !@vehicle_journey.new_record? } %>   -    <% if !@vehicle_journey.new_record? %>  	    <%= form.inputs :class => "stop_times", :name => @vehicle_journey.human_attribute_name(:vehicle_journey_at_stop_ids) do %>  	      <table border="0" class="vehicle_journey_at_stops">  	        <thead> @@ -41,7 +40,6 @@  	        </tbody>  	      </table>  	    <% end %> -    <% end %>      <%= form.input :time_table_tokens, :label => t('.time_tables'), :as => :text,  :input_html => { :"data-pre" => ( @vehicle_journey.time_tables.map { |time_table| { :id => time_table.id, :name => time_table.comment } } ).to_json }  %>    <% end %> | 
