aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXinhui2016-09-22 11:45:54 +0200
committerXinhui2016-09-22 11:45:54 +0200
commit6001ee74b41e962bb7a6cb68320840e02696bebd (patch)
tree5c192361949e60035923dce6881d94bf22aba7f6
parent86924e2af5a1829e0c0a2a5daecbee0de12cab98 (diff)
parent19fb16b6055dc6d76d23e7f20b30e8ef9c383f5c (diff)
downloadchouette-core-6001ee74b41e962bb7a6cb68320840e02696bebd.tar.bz2
Merge branch 'master' into staging
-rw-r--r--app/helpers/breadcrumb_helper.rb4
-rw-r--r--app/views/access_points/_access_point.html.slim10
-rw-r--r--app/views/access_points/index.html.slim6
-rw-r--r--app/views/referential_stop_areas/show.html.slim12
-rw-r--r--app/views/stop_areas/show.html.slim18
-rw-r--r--db/seeds.rb6
6 files changed, 28 insertions, 28 deletions
diff --git a/app/helpers/breadcrumb_helper.rb b/app/helpers/breadcrumb_helper.rb
index 91f3a56c0..6c29a3675 100644
--- a/app/helpers/breadcrumb_helper.rb
+++ b/app/helpers/breadcrumb_helper.rb
@@ -99,8 +99,8 @@ module BreadcrumbHelper
def stop_area_breadcrumb(action)
referential_breadcrumb
- add_breadcrumb Chouette::StopArea.model_name.human(:count => 2), referential_stop_areas_path(@stop_area.stop_area_referential) unless action == :index
- add_breadcrumb breadcrumb_label(@stop_area), referential_stop_area_path(@stop_area.stop_area_referential, @stop_area),:title => breadcrumb_tooltip(@stop_area) if action == :edit
+ add_breadcrumb Chouette::StopArea.model_name.human(:count => 2), stop_area_referential_stop_areas_path(@stop_area.stop_area_referential) unless action == :index
+ add_breadcrumb breadcrumb_label(@stop_area), stop_area_referential_stop_area_path(@stop_area.stop_area_referential, @stop_area),:title => breadcrumb_tooltip(@stop_area) if action == :edit
end
def stop_area_copy_breadcrumb(action)
diff --git a/app/views/access_points/_access_point.html.slim b/app/views/access_points/_access_point.html.slim
index b10883eba..bb627e42f 100644
--- a/app/views/access_points/_access_point.html.slim
+++ b/app/views/access_points/_access_point.html.slim
@@ -2,19 +2,19 @@
.panel-heading
.panel-title.clearfix
span.pull-right
- = link_to edit_referential_stop_area_access_point_path(@referential, @stop_area, access_point), class: 'btn btn-default btn-sm' do
+ = link_to edit_referential_stop_area_access_point_path(referential, @stop_area, access_point), class: 'btn btn-default btn-sm' do
span.fa.fa-pencil
- = link_to referential_stop_area_access_point_path(@referential, @stop_area, access_point), method: :delete, data: {:confirm => t('access_points.actions.destroy_confirm')}, class: 'btn btn-danger btn-sm' do
+ = link_to referential_stop_area_access_point_path(referential, @stop_area, access_point), method: :delete, data: {:confirm => t('access_points.actions.destroy_confirm')}, class: 'btn btn-danger btn-sm' do
span.fa.fa-trash-o
h5
- = link_to [@referential, @stop_area, access_point], class: 'preview', title: "#{Chouette::StopArea.model_name.human.capitalize} #{access_point.name}" do
+ = link_to referential_stop_area_access_point_path(referential, @stop_area, access_point), class: 'preview', title: "#{Chouette::StopArea.model_name.human.capitalize} #{access_point.name}" do
span.name
= image_tag "map/access_#{access_point.access_point_type}.png"
= truncate(access_point.name, :length => 20)
-
+
.panel-body
- unless access_point.geometry
p
span.warning = t('.no_position')
= " -"
- p = t("access_types.label.#{access_point.access_point_type}") \ No newline at end of file
+ p = t("access_types.label.#{access_point.access_point_type}")
diff --git a/app/views/access_points/index.html.slim b/app/views/access_points/index.html.slim
index b48abc970..638ca22f5 100644
--- a/app/views/access_points/index.html.slim
+++ b/app/views/access_points/index.html.slim
@@ -14,12 +14,12 @@
= page_entries_info @access_points
.access_points.paginated_content
- = render partial: 'access_point', collection: @access_points
+ = render partial: 'access_point', collection: @access_points, locals: {referential: @referential}
.pagination
= will_paginate @access_points, container: false
- content_for :sidebar do
ul.actions
- li
- = link_to t('access_points.actions.new'), new_referential_stop_area_access_point_path(@referential,@stop_area), class: 'add' \ No newline at end of file
+ li
+ = link_to t('access_points.actions.new'), new_referential_stop_area_access_point_path(@referential,@stop_area), class: 'add'
diff --git a/app/views/referential_stop_areas/show.html.slim b/app/views/referential_stop_areas/show.html.slim
index 2224728e9..76414edf0 100644
--- a/app/views/referential_stop_areas/show.html.slim
+++ b/app/views/referential_stop_areas/show.html.slim
@@ -61,7 +61,7 @@
p
label = "#{@stop_area.human_attribute_name('stairs_availability')} : "
-
+
- if !@stop_area.stairs_availability.nil?
= t((@stop_area.stairs_availability == true).to_s)
- else
@@ -115,7 +115,7 @@ p.after_map
div
h3 = t('.access_points')
.access_points.paginated_content
- = paginated_content @access_points, "access_points/access_point"
+ = paginated_content @access_points, "access_points/access_point", {referential: @referential}
- content_for :sidebar do
table
@@ -146,11 +146,11 @@ p.after_map
ul.actions
li
= link_to t('stop_areas.actions.select_parent'), select_parent_referential_stop_area_path(@referential, @stop_area), class: 'parent'
-
+
- if @stop_area.parent == nil
li
= link_to t('stop_areas.actions.clone_as_parent'), new_referential_stop_area_stop_area_copy_path(@referential, @stop_area, hierarchy: 'parent'), class: 'clone'
-
+
- if manage_children
li
= link_to t('stop_areas.actions.add_children'), add_children_referential_stop_area_path(@referential, @stop_area), class: 'children'
@@ -168,5 +168,5 @@ p.after_map
= link_to t('stop_areas.actions.manage_access_links'), access_links_referential_stop_area_path(@referential,@stop_area), class: 'access_link'
br
-
- = creation_tag(@stop_area) \ No newline at end of file
+
+ = creation_tag(@stop_area)
diff --git a/app/views/stop_areas/show.html.slim b/app/views/stop_areas/show.html.slim
index 06ca09dd5..c9d0b67a3 100644
--- a/app/views/stop_areas/show.html.slim
+++ b/app/views/stop_areas/show.html.slim
@@ -116,8 +116,7 @@ p.after_map
h3 = t('.access_points')
.access_points.paginated_content
- / FIXME #821
- = paginated_content @access_points, "access_points/access_point"
+ = paginated_content @access_points, "access_points/access_point", {referential: @stop_area_referential}
- content_for :sidebar do
table
@@ -128,13 +127,14 @@ p.after_map
li = link_to t('stop_areas.actions.edit'), edit_stop_area_referential_stop_area_path(@stop_area_referential, @stop_area), class: 'edit'
li = link_to t('stop_areas.actions.destroy'), stop_area_referential_stop_area_path(@stop_area_referential, @stop_area), method: :delete, :data => {:confirm => t('stop_areas.actions.destroy_confirm')}, class: 'remove'
- - if manage_itl
- tr
- td
- h4 = t(".itl_managment")
- ul.actions
- li = link_to t('stop_areas.actions.add_routing_lines'), add_routing_lines_stop_area_referential_stop_area_path(@stop_area_referential, @stop_area), class: 'add_routing_lines'
- li = link_to t('stop_areas.actions.add_routing_stops'), add_routing_stops_stop_area_referential_stop_area_path(@stop_area_referential, @stop_area), class: 'add_routing_stops'
+ - if manage_itl #Fixme
+
+ / tr
+ / td
+ / h4 = t(".itl_managment")
+ / ul.actions
+ / li = link_to t('stop_areas.actions.add_routing_lines'), add_routing_lines_stop_area_referential_stop_area_path(@stop_area_referential, @stop_area), class: 'add_routing_lines'
+ / li = link_to t('stop_areas.actions.add_routing_stops'), add_routing_stops_stop_area_referential_stop_area_path(@stop_area_referential, @stop_area), class: 'add_routing_stops'
- else
tr
diff --git a/db/seeds.rb b/db/seeds.rb
index 956b9562c..9d91a9e85 100644
--- a/db/seeds.rb
+++ b/db/seeds.rb
@@ -19,8 +19,8 @@ end
OfferWorkbench.find_or_create_by(name: "Gestion de l'offre", organisation: stif)
-operator = Organisation.find_or_create_by(code: 'transporteur-a') do |organisation|
- operator.name = "Transporteur A"
+operator = Organisation.find_or_create_by!(name: 'Transporteur A') do |organisation|
+ organisation.code = "transporteur-a"
end
operator.users.find_or_create_by!(username: "transporteur") do |user|
@@ -35,7 +35,7 @@ stop_area_referential = StopAreaReferential.find_or_create_by(name: "Reflex") do
end
10.times do |n|
- stop_area_referential.stop_areas.find_or_create_by name: "Test #{n}", area_type: "Quay"
+ stop_area_referential.stop_areas.find_or_create_by name: "Test #{n}", area_type: "Quay", objectid: "StopArea: #{n}"
end
line_referential = LineReferential.find_or_create_by(name: "CodifLigne") do |referential|