aboutsummaryrefslogtreecommitdiffstats
path: root/app/views/stop_area_copies
diff options
context:
space:
mode:
authorMichel Etienne2014-08-27 08:59:19 +0200
committerMichel Etienne2014-08-27 08:59:19 +0200
commit7307e5b746650c332a44ecb023abb827d9d2be0a (patch)
treec69bc000c43685275f3ba077958342d5e45e0aff /app/views/stop_area_copies
parent5b2a2fa7892c661f81e097a733c621b07d441bc0 (diff)
downloadchouette-core-7307e5b746650c332a44ecb023abb827d9d2be0a.tar.bz2
clone stop_area as parent or child, Mantis 26830
Diffstat (limited to 'app/views/stop_area_copies')
-rw-r--r--app/views/stop_area_copies/_form.html.erb24
-rw-r--r--app/views/stop_area_copies/create.html.erb1
-rw-r--r--app/views/stop_area_copies/new.html.erb1
3 files changed, 26 insertions, 0 deletions
diff --git a/app/views/stop_area_copies/_form.html.erb b/app/views/stop_area_copies/_form.html.erb
new file mode 100644
index 000000000..5ac6fb345
--- /dev/null
+++ b/app/views/stop_area_copies/_form.html.erb
@@ -0,0 +1,24 @@
+<%= title_tag t("stop_area_copies.new.title."+@stop_area_copy.hierarchy) %>
+
+<%= semantic_form_for [@referential, @stop_area, @stop_area_copy] do |form| %>
+ <br>
+ <%= form.inputs do %>
+ <%= form.input :source_id , :as => :hidden%>
+ <%= form.input :hierarchy , :as => :hidden%>
+ <% if @stop_area_copy.hierarchy == "child"%>
+ <% if @stop_area.area_type.underscore == "stop_place"%>
+ <%= form.input :area_type, :as => :select, :input_html => { :disabled => true }, :collection => [@stop_area_copy.area_type], :include_blank => false, :member_label => Proc.new { |stop_area_type| t("area_types.label.#{stop_area_type}") } %>
+ <%= form.input :area_type , :as => :hidden%>
+ <% else%>
+ <%= form.input :area_type, :as => :select, :collection => ["boarding_position","quay"], :include_blank => false, :member_label => Proc.new { |stop_area_type| t("area_types.label.#{stop_area_type}") } %>
+ <% end %>
+ <% else %>
+ <%= form.input :area_type, :as => :select, :input_html => { :disabled => true }, :collection => [@stop_area_copy.area_type], :include_blank => false, :member_label => Proc.new { |stop_area_type| t("area_types.label.#{stop_area_type}") } %>
+ <%= form.input :area_type , :as => :hidden%>
+ <% end %>
+ <% end %>
+ <%= form.actions do %>
+ <%= form.action :submit, :as => :button , :label => t( 'formtastic.duplicate' ) %>
+ <%= form.action :cancel, :as => :link %>
+ <% end %>
+<% end %>
diff --git a/app/views/stop_area_copies/create.html.erb b/app/views/stop_area_copies/create.html.erb
new file mode 100644
index 000000000..3e3151812
--- /dev/null
+++ b/app/views/stop_area_copies/create.html.erb
@@ -0,0 +1 @@
+<%= render "form" %> \ No newline at end of file
diff --git a/app/views/stop_area_copies/new.html.erb b/app/views/stop_area_copies/new.html.erb
new file mode 100644
index 000000000..3e3151812
--- /dev/null
+++ b/app/views/stop_area_copies/new.html.erb
@@ -0,0 +1 @@
+<%= render "form" %> \ No newline at end of file