From 0449133dc118c1859511b23c02743bcf08dc7359 Mon Sep 17 00:00:00 2001
From: Luc Donnet
Date: Wed, 25 Jun 2014 16:34:19 +0200
Subject: Refactoring layout 2nd part Refs #0026847
---
app/views/access_points/_form.html.erb | 89 ++++++------
app/views/access_points/edit.html.erb | 2 -
.../_compliance_check_task.erb | 2 +-
app/views/connection_links/_form.erb | 8 +-
app/views/exports/_export.erb | 27 ++--
app/views/import_tasks/_import_task.erb | 2 +-
app/views/layouts/application.html.erb | 151 ++++++++++++++-------
app/views/layouts/without_sidebar.html.erb | 126 +++++++++++++++++
app/views/referentials/index.html.erb | 1 -
app/views/routes/_route.html.erb | 53 ++++----
app/views/routes/show.html.erb | 12 +-
app/views/shared/_footer.erb | 42 ++++++
app/views/stop_areas/_form.html.erb | 5 +-
app/views/stop_areas/show.html.erb | 5 +-
app/views/vehicle_journey_imports/new.html.erb | 15 +-
app/views/vehicle_journeys/_form.html.erb | 62 ++++-----
.../_vehicle_journey_at_stop_fields.html.erb | 24 ++--
app/views/vehicle_journeys/edit.html.erb | 4 +-
app/views/vehicle_journeys/index.html.erb | 21 +--
19 files changed, 434 insertions(+), 217 deletions(-)
create mode 100644 app/views/layouts/without_sidebar.html.erb
create mode 100644 app/views/shared/_footer.erb
(limited to 'app/views')
diff --git a/app/views/access_points/_form.html.erb b/app/views/access_points/_form.html.erb
index 8e546a878..f65fd7431 100644
--- a/app/views/access_points/_form.html.erb
+++ b/app/views/access_points/_form.html.erb
@@ -1,44 +1,51 @@
-<%= semantic_form_for [@referential, @stop_area, @access_point] do |form| %>
- <%= form.inputs do %>
- <%= form.input :id, :as => :hidden %>
- <%= form.input :name %>
- <%= form.input :access_point_type, :as => :select, :input_html => { :disabled => !@access_point.new_record? },
- :collection => Chouette::AccessPoint.access_point_types, :include_blank => false, :member_label => Proc.new { |access_point_type| t("access_types.label.#{access_point_type}") } %>
- <%= form.input :street_name %>
- <%= form.input :country_code %>
- <%= form.input :comment %>
- <%= form.inputs do %>
- <%= form.input "openning_time(1i)", :as => :hidden ,:input_html => { :value => "2000" } %>
- <%= form.input "openning_time(2i)", :as => :hidden ,:input_html => { :value => "1" } %>
- <%= form.input "openning_time(3i)", :as => :hidden ,:input_html => { :value => "1" } %>
- <%= form.input "openning_time(6i)", :as => :hidden ,:input_html => { :value => "0" } %>
- <%= form.input :openning_time, :ignore_date=>true, :label => @access_point.human_attribute_name("openning_time")%>
- <%= form.input "closing_time(1i)", :as => :hidden ,:input_html => { :value => "2000" } %>
- <%= form.input "closing_time(2i)", :as => :hidden ,:input_html => { :value => "1" } %>
- <%= form.input "closing_time(3i)", :as => :hidden ,:input_html => { :value => "1" } %>
- <%= form.input "closing_time(6i)", :as => :hidden ,:input_html => { :value => "0" } %>
- <%= form.input :closing_time, :ignore_date=>true, :label => @access_point.human_attribute_name("closing_time")%>
- <% end %>
- <%= form.input :mobility_restricted_suitability,:as => :boolean %>
- <%= form.input :stairs_availability,:as => :boolean %>
- <%= form.input :lift_availability,:as => :boolean %>
- <%= form.input :objectid, :required => !@access_point.new_record?, :input_html => { :disabled => !@access_point.new_record? } %>
- <%= form.inputs :name => t('access_points.show.geographic_data') do %>
- <% if ! @referential.projection_type_label.empty? %>
- <%= form.inputs :name => @referential.projection_type_label do %>
- <%= form.input :projection_x %>
- <%= form.input :projection_y %>
+
+
+
+ <%= semantic_form_for [@referential, @stop_area, @access_point] do |form| %>
+ <%= form.inputs do %>
+ <%= form.input :id, :as => :hidden %>
+ <%= form.input :name %>
+ <%= form.input :access_point_type, :as => :select, :input_html => { :disabled => !@access_point.new_record? },
+ :collection => Chouette::AccessPoint.access_point_types, :include_blank => false, :member_label => Proc.new { |access_point_type| t("access_types.label.#{access_point_type}") } %>
+ <%= form.input :street_name %>
+ <%= form.input :country_code %>
+ <%= form.input :comment %>
+ <%= form.input :openning_time, :as => :time_select %>
+ <%= form.input :closing_time, :as => :time_select %>
+ <%= form.input :mobility_restricted_suitability,:as => :boolean %>
+ <%= form.input :stairs_availability,:as => :boolean %>
+ <%= form.input :lift_availability,:as => :boolean %>
+ <%= form.input :objectid, :required => !@access_point.new_record?, :input_html => { :disabled => !@access_point.new_record? } %>
+
+ <%= form.inputs :name => t('access_points.show.geographic_data') do %>
+ <% if ! @referential.projection_type_label.empty? %>
+
+
@referential.projection_type_label
+
+ <%= form.input :projection_x %>
+ <%= form.input :projection_y %>
+
+
+ <% end %>
+
+
WGS84
+
+ <%= form.input :longitude %>
+ <%= form.input :latitude %>
+
+
<% end %>
- <% end %>
- <%= form.inputs :name => "WGS84" do %>
- <%= form.input :longitude %>
- <%= form.input :latitude %>
- <% end %>
<% end %>
- <% end %>
- <%= form.actions do %>
- <%= form.action :submit, :as => :button %>
- <%= form.action :cancel, :as => :link %>
- <% end %>
-<% end %>
+ <%= form.actions do %>
+ <%= form.action :submit, :as => :button %>
+ <%= form.action :cancel, :as => :link %>
+ <% end %>
+ <% end %>
+
+
+ <% if @map %>
+ <%= @map.to_html %>
+ <% end %>
+
+
diff --git a/app/views/access_points/edit.html.erb b/app/views/access_points/edit.html.erb
index e2e8636b3..cc5dc217f 100644
--- a/app/views/access_points/edit.html.erb
+++ b/app/views/access_points/edit.html.erb
@@ -1,5 +1,3 @@
<%= title_tag t('access_points.edit.title', :access_point => @access_point.name ) %>
-<%= @map.to_html %>
-
<%= render "form" %>
diff --git a/app/views/compliance_check_tasks/_compliance_check_task.erb b/app/views/compliance_check_tasks/_compliance_check_task.erb
index 3c5388b00..b3b62e1f5 100644
--- a/app/views/compliance_check_tasks/_compliance_check_task.erb
+++ b/app/views/compliance_check_tasks/_compliance_check_task.erb
@@ -1,4 +1,4 @@
-<%= div_for(compliance_check_task, :class => :compliance_check_task) do %>
+<%= div_for(compliance_check_task, :class => "compliance_check_task clearfix") do %>
<%= link_to image_tag("compliance_check_task-#{compliance_check_task.status}.png"), referential_compliance_check_task_path(@referential, compliance_check_task) %>
diff --git a/app/views/connection_links/_form.erb b/app/views/connection_links/_form.erb
index 72d3b2046..e14c06f50 100644
--- a/app/views/connection_links/_form.erb
+++ b/app/views/connection_links/_form.erb
@@ -12,10 +12,10 @@
<%= form.input :objectid, :required => !@connection_link.new_record?, :input_html => { :disabled => !@connection_link.new_record? } %>
<% end %>
<%= form.inputs :name => t('connection_links.show.durations') do %>
- <%= form.input :default_duration, :as => :time_picker, :ignore_date=>true,:include_seconds=>true, :label => @connection_link.human_attribute_name("default_duration"), :input_html => { :placeholder => "HH:MM" } %>
- <%= form.input :frequent_traveller_duration, :as => :time_picker, :ignore_date=>true,:include_seconds=>true, :label => @connection_link.human_attribute_name("frequent_traveller_duration"), :input_html => { :placeholder => "HH:MM" } %>
- <%= form.input :occasional_traveller_duration, :as => :time_picker, :ignore_date=>true,:include_seconds=>true, :label => @connection_link.human_attribute_name("occasional_traveller_duration"), :input_html => { :placeholder => "HH:MM" } %>
- <%= form.input :mobility_restricted_traveller_duration, :as => :time_picker, :ignore_date=>true,:include_seconds=>true, :label => @connection_link.human_attribute_name("mobility_restricted_traveller_duration"), :input_html => { :placeholder => "HH:MM" } %>
+ <%= form.input :default_duration, :as => :time_select, :size => 8, :include_seconds=>true, :label => @connection_link.human_attribute_name("default_duration"), :input_html => { :placeholder => "HH:MM" } %>
+ <%= form.input :frequent_traveller_duration, :as => :time_select, :size => 8, :include_seconds=>true, :label => @connection_link.human_attribute_name("frequent_traveller_duration"), :input_html => { :placeholder => "HH:MM:SS" } %>
+ <%= form.input :occasional_traveller_duration, :as => :time_select, :size => 8, :include_seconds=>true, :label => @connection_link.human_attribute_name("occasional_traveller_duration"), :input_html => { :placeholder => "HH:MM:SS" } %>
+ <%= form.input :mobility_restricted_traveller_duration, :as => :time_select, :include_seconds=>true, :label => @connection_link.human_attribute_name("mobility_restricted_traveller_duration"), :input_html => { :placeholder => "HH:MM:SS" } %>
<% end %>
<%= form.actions do %>
diff --git a/app/views/exports/_export.erb b/app/views/exports/_export.erb
index e8e5d4656..3d312c266 100644
--- a/app/views/exports/_export.erb
+++ b/app/views/exports/_export.erb
@@ -1,16 +1,21 @@
-<%= div_for(export, :class => :export) do %>
- <%= link_to(referential_export_path(@referential, export), :class => "preview") do %>
- <%= image_tag "export-#{export.status}.png" %>
- <% end %>
- <%= link_to(export.name, referential_export_path(@referential, export)) %>
-
- <%= l export.created_at %>
-
-
+<%= div_for(export, :class => "export clearfix") do %>
+
+ <%= link_to image_tag("export-#{export.status}.png"), referential_export_path(@referential, export) %>
+
+
+
+
<% if export.status == 'completed' %>
- <%= link_to t("exports.actions.download"), referential_export_path(@referential, export, :format => :zip), :class => "download" %>
+ <%= link_to t("exports.actions.download"), referential_export_path(@referential, export, :format => :zip), :class => "download" %>
<% end %>
- <%= link_to t("actions.destroy"), referential_export_path(@referential, export), :method => :delete, :data => {:confirm => t('exports.actions.destroy_confirm')}, :class => "remove" %>
+
+
+ <%= l export.created_at, :format => "%d/%m/%Y %H:%M" %>
<% end %>
diff --git a/app/views/import_tasks/_import_task.erb b/app/views/import_tasks/_import_task.erb
index 5f2326209..7b4302d58 100644
--- a/app/views/import_tasks/_import_task.erb
+++ b/app/views/import_tasks/_import_task.erb
@@ -1,4 +1,4 @@
-<%= div_for import_task do %>
+<%= div_for import_task, :class => "clearfix" do %>
<%= link_to image_tag("import_task-#{import_task.status}.png"), referential_import_task_path(@referential, import_task) %>
diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb
index d0428dd9f..2e4f98c0b 100644
--- a/app/views/layouts/application.html.erb
+++ b/app/views/layouts/application.html.erb
@@ -18,60 +18,113 @@