aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/helpers/newapplication_helper.rb10
-rw-r--r--app/views/calendars/_calendars.html.slim2
-rw-r--r--app/views/companies/index.html.slim2
-rw-r--r--app/views/lines/index.html.slim9
-rw-r--r--app/views/networks/index.html.slim3
-rw-r--r--app/views/referential_companies/index.html.slim2
-rw-r--r--app/views/referential_lines/_lines.html.slim4
-rw-r--r--app/views/referential_lines/show.html.slim9
-rw-r--r--app/views/referential_networks/index.html.slim2
-rw-r--r--app/views/referential_stop_areas/_stop_areas.html.slim2
-rw-r--r--app/views/referentials/show.html.slim12
-rw-r--r--app/views/routes/show.html.slim12
-rw-r--r--app/views/routing_constraint_zones/index.html.slim2
-rw-r--r--app/views/stop_areas/_stop_areas.html.slim4
-rw-r--r--app/views/stop_areas/index.html.slim5
-rw-r--r--app/views/workbenches/show.html.slim12
-rw-r--r--config/locales/lines.fr.yml3
-rw-r--r--config/locales/referentials.fr.yml1
-rw-r--r--config/locales/routes.fr.yml2
-rw-r--r--config/locales/routing_constraint_zones.fr.yml14
-rw-r--r--config/locales/stop_points.fr.yml5
21 files changed, 70 insertions, 47 deletions
diff --git a/app/helpers/newapplication_helper.rb b/app/helpers/newapplication_helper.rb
index 11c794ea3..e52f0320f 100644
--- a/app/helpers/newapplication_helper.rb
+++ b/app/helpers/newapplication_helper.rb
@@ -16,7 +16,11 @@ module NewapplicationHelper
end
columns.map do |k, v|
- hcont << content_tag(:th, sortable_columns(collection, k))
+ if k.is_a? Symbol
+ hcont << content_tag(:th, sortable_columns(collection, k))
+ else
+ hcont << content_tag(:th, k)
+ end
end
hcont << content_tag(:th, '') if actions.any?
@@ -166,7 +170,9 @@ module NewapplicationHelper
pic2 = content_tag :span, '', class: "fa fa-sort-desc #{(direction == 'asc') ? 'active' : ''}"
pics = content_tag :span, pic1 + pic2, class: 'orderers'
- (key.to_s + pics).html_safe
+ obj = collection.model.to_s.gsub('Chouette::', '').scan(/[A-Z][a-z]+/).join('_').downcase
+
+ (I18n.t("activerecord.attributes.#{obj}.#{key}") + pics).html_safe
end
end
diff --git a/app/views/calendars/_calendars.html.slim b/app/views/calendars/_calendars.html.slim
index 6544fc76c..d579c8f7a 100644
--- a/app/views/calendars/_calendars.html.slim
+++ b/app/views/calendars/_calendars.html.slim
@@ -1,6 +1,6 @@
- if @calendars.any?
= table_builder @calendars,
- { @calendars.human_attribute_name(:name) => 'name', @calendars.human_attribute_name(:short_name) => 'short_name', @calendars.human_attribute_name(:shared) => 'shared' },
+ { :name => 'name', :short_name => 'short_name', :shared => 'shared' },
[:show, :edit, :delete],
[],
'table table-bordered'
diff --git a/app/views/companies/index.html.slim b/app/views/companies/index.html.slim
index b07696a79..e3a2ce6c5 100644
--- a/app/views/companies/index.html.slim
+++ b/app/views/companies/index.html.slim
@@ -27,7 +27,7 @@
.row
.col-lg-12
= table_builder @companies,
- { 'Oid' => Proc.new { |n| n.try(:objectid).try(:local_id) }, @companies.human_attribute_name(:name) => 'name' },
+ { 'Oid' => Proc.new { |n| n.try(:objectid).try(:local_id) }, :name => 'name' },
[:show, :edit, :delete],
[],
'table has-search'
diff --git a/app/views/lines/index.html.slim b/app/views/lines/index.html.slim
index 39dd4f194..9575150d8 100644
--- a/app/views/lines/index.html.slim
+++ b/app/views/lines/index.html.slim
@@ -22,10 +22,11 @@
.col-lg-12
= table_builder @lines,
{ 'Oid' => Proc.new { |n| n.objectid.local_id },
- @lines.human_attribute_name(:name) => 'name', @lines.human_attribute_name(:network) => Proc.new { |n| n.try(:network).try(:name) },
- @lines.human_attribute_name(:company) => Proc.new { |n| n.try(:company).try(:name) },
- @lines.human_attribute_name(:transport_mode) => Proc.new { |n| n.transport_mode.nil? ? '-' : t("enumerize.line.transport_mode.#{n.try(:transport_mode)}") },
- @lines.human_attribute_name(:transport_submode) => Proc.new { |n| n.transport_submode.nil? ? '-' : t("enumerize.line.transport_submode.#{n.try(:transport_submode)}") } },
+ :name => 'name',
+ :network => Proc.new { |n| n.try(:network).try(:name) },
+ :company => Proc.new { |n| n.try(:company).try(:name) },
+ :transport_mode => Proc.new { |n| n.transport_mode.nil? ? '-' : t("enumerize.line.transport_mode.#{n.try(:transport_mode)}") },
+ :transport_submode => Proc.new { |n| n.transport_submode.nil? ? '-' : t("enumerize.line.transport_submode.#{n.try(:transport_submode)}") } },
[:show, :delete],
[],
'table has-filter has-search'
diff --git a/app/views/networks/index.html.slim b/app/views/networks/index.html.slim
index d99f612bc..a10eea707 100644
--- a/app/views/networks/index.html.slim
+++ b/app/views/networks/index.html.slim
@@ -27,7 +27,8 @@
.row
.col-lg-12
= table_builder @networks,
- { 'Oid' => Proc.new { |n| n.try(:objectid).try(:local_id) }, @networks.human_attribute_name(:name) => 'name' },
+ { 'Oid' => Proc.new { |n| n.try(:objectid).try(:local_id) },
+ :name => 'name' },
[:show, :edit, :delete],
[],
'table has-search'
diff --git a/app/views/referential_companies/index.html.slim b/app/views/referential_companies/index.html.slim
index 3b9f3bb06..8fe8f9415 100644
--- a/app/views/referential_companies/index.html.slim
+++ b/app/views/referential_companies/index.html.slim
@@ -28,7 +28,7 @@
.col-lg-12
= table_builder @companies,
{ 'ID Codif' => Proc.new { |n| n.try(:objectid).try(:local_id) },
- @companies.human_attribute_name(:name) => 'name', @companies.human_attribute_name(:phone) => 'phone', @companies.human_attribute_name(:email) => 'email', @companies.human_attribute_name(:url) => 'url' },
+ :name => 'name', :phone => 'phone', :email => 'email', :url => 'url' },
[:show, :edit, :delete],
[],
'table has-search'
diff --git a/app/views/referential_lines/_lines.html.slim b/app/views/referential_lines/_lines.html.slim
index b2e9a77d8..54f22c978 100644
--- a/app/views/referential_lines/_lines.html.slim
+++ b/app/views/referential_lines/_lines.html.slim
@@ -1,7 +1,7 @@
- if @lines.any?
= table_builder @lines,
- { 'Oid' => Proc.new { |n| n.objectid.local_id }, @lines.human_attribute_name(:id) => 'id',
- @lines.human_attribute_name(:number) => 'number', @lines.human_attribute_name(:name) => 'name', @lines.human_attribute_name(:network) => Proc.new { |n| n.try(:network).try(:name) }, @lines.human_attribute_name(:company) => Proc.new { |n| n.try(:company).try(:name) } },
+ { 'Oid' => Proc.new { |n| n.objectid.local_id }, :id => 'id',
+ :number => 'number', :name => 'name', :network => Proc.new { |n| n.try(:network).try(:name) }, :company => Proc.new { |n| n.try(:company).try(:name) } },
[:show],
[],
'table table-bordered'
diff --git a/app/views/referential_lines/show.html.slim b/app/views/referential_lines/show.html.slim
index 5f95463c4..d5c11d456 100644
--- a/app/views/referential_lines/show.html.slim
+++ b/app/views/referential_lines/show.html.slim
@@ -66,12 +66,13 @@
.col-lg-12
= table_builder @routes,
{ 'OiD' => Proc.new { |n| n.objectid.local_id },
- @routes.human_attribute_name(:name) => 'name',
- @routes.human_attribute_name(:published_name) => 'published_name',
- @routes.human_attribute_name(:wayback) => 'wayback_text',
+ :name => 'name',
+ :published_name => 'published_name',
+ :wayback => 'wayback_text',
'Arrêt de départ' => Proc.new{|r| r.try(:stop_points).first.try(:stop_area).try(:name)},
"Arrêt d'arrivée" => Proc.new{|r| r.try(:stop_points).last.try(:stop_area).try(:name)},
- 'Nb arrêts' => Proc.new{|r| r.try(:stop_points).count}, 'Nb missions' => Proc.new{|r| r.try(:journey_patterns).count} },
+ :stop_points => Proc.new{|r| r.try(:stop_points).count},
+ :journey_patterns => Proc.new{|r| r.try(:journey_patterns).count} },
[:show, :edit, :delete],
[],
'table has-search'
diff --git a/app/views/referential_networks/index.html.slim b/app/views/referential_networks/index.html.slim
index ba2c5b2c1..c0a4c526c 100644
--- a/app/views/referential_networks/index.html.slim
+++ b/app/views/referential_networks/index.html.slim
@@ -27,7 +27,7 @@
.row
.col-lg-12
= table_builder @networks,
- { 'ID Codif' => Proc.new { |n| n.try(:objectid).try(:local_id) }, @networks.human_attribute_name(:name) => 'name' },
+ { 'ID Codif' => Proc.new { |n| n.try(:objectid).try(:local_id) }, :name => 'name' },
[:show, :edit, :delete],
[],
'table has-search'
diff --git a/app/views/referential_stop_areas/_stop_areas.html.slim b/app/views/referential_stop_areas/_stop_areas.html.slim
index 331383218..081518abf 100644
--- a/app/views/referential_stop_areas/_stop_areas.html.slim
+++ b/app/views/referential_stop_areas/_stop_areas.html.slim
@@ -1,6 +1,6 @@
- if @stop_areas.any?
= table_builder @stop_areas,
- { 'Object_id' => 'objectid', @stop_areas.human_attribute_name(:name) => 'name', @stop_areas.human_attribute_name(:registration_number) => 'registration_number', @stop_areas.human_attribute_name(:city_name) => 'city_name', @stop_areas.human_attribute_name(:zip_code) => 'zip_code' },
+ { 'Object_id' => 'objectid', :name => 'name', :registration_number => 'registration_number', :city_name => 'city_name', :zip_code => 'zip_code' },
[:show, :edit, :delete],
[],
'table table-bordered'
diff --git a/app/views/referentials/show.html.slim b/app/views/referentials/show.html.slim
index e9f58b48f..5c267769a 100644
--- a/app/views/referentials/show.html.slim
+++ b/app/views/referentials/show.html.slim
@@ -48,12 +48,12 @@
/ ID Codif, nom court, nom de la ligne, réseau, mode, transporteur principal, actions = [show, edit_notes]
= table_builder @reflines,
{ 'ID Codif' => Proc.new { |n| n.objectid.local_id },
- 'Nom court' => 'number',
- @reflines.human_attribute_name(:name) => 'name',
- 'Activé' => Proc.new{|n| n.deactivated? ? t('false') : t('true')},
- @reflines.human_attribute_name(:transport_mode) => 'transport_mode',
- @reflines.human_attribute_name(:network) => Proc.new { |n| n.try(:network).try(:name) },
- @reflines.human_attribute_name(:company) => Proc.new { |n| n.try(:company).try(:name) } },
+ :number => 'number',
+ :name => 'name',
+ :deactivated => Proc.new{|n| n.deactivated? ? t('false') : t('true')},
+ :transport_mode => 'transport_mode',
+ :network => Proc.new { |n| n.try(:network).try(:name) },
+ :company => Proc.new { |n| n.try(:company).try(:name) } },
[:show],
[],
'table has-filter has-search'
diff --git a/app/views/routes/show.html.slim b/app/views/routes/show.html.slim
index 88b93bb06..39d4521f5 100644
--- a/app/views/routes/show.html.slim
+++ b/app/views/routes/show.html.slim
@@ -35,12 +35,14 @@
- if @route_sp.any?
= table_builder @route_sp,
{ 'ID Reflex' => Proc.new {|s| s.try(:stop_area).try(:user_objectid)},
- Chouette::StopArea.human_attribute_name(:name) => Proc.new {|s| s.try(:stop_area).try(:name)},
+ :name => Proc.new {|s| s.try(:stop_area).try(:name)},
'Activé' => Proc.new{|s| s.try(:stop_area).deleted_at ? t('false') : t('true')},
- Chouette::StopArea.human_attribute_name(:zip_code) => Proc.new {|s| s.try(:stop_area).try(:zip_code)},
- Chouette::StopArea.human_attribute_name(:city_name) => Proc.new {|s| s.try(:stop_area).try(:city_name)},
- Chouette::StopArea.human_attribute_name(:area_type) => Proc.new {|s| t("area_types.label.#{s.try(:stop_area).try(:area_type)}")},
- Chouette::StopPoint.human_attribute_name(:for_boarding) => Proc.new {|s| t("stop_points.stop_point.for_boarding.#{s.for_boarding}")}, Chouette::StopPoint.human_attribute_name(:for_alighting) => Proc.new {|s| t("stop_points.stop_point.for_alighting.#{s.for_alighting}")}, 'Position' => 'position' },
+ :zip_code => Proc.new {|s| s.try(:stop_area).try(:zip_code)},
+ :city_name => Proc.new {|s| s.try(:stop_area).try(:city_name)},
+ :area_type => Proc.new {|s| t("area_types.label.#{s.try(:stop_area).try(:area_type)}")},
+ :for_boarding => Proc.new {|s| t("stop_points.stop_point.for_boarding.#{s.for_boarding}")},
+ :for_alighting => Proc.new {|s| t("stop_points.stop_point.for_alighting.#{s.for_alighting}")},
+ :position => 'position' },
[:show],
[],
'table'
diff --git a/app/views/routing_constraint_zones/index.html.slim b/app/views/routing_constraint_zones/index.html.slim
index 75094a04f..9061fbdfd 100644
--- a/app/views/routing_constraint_zones/index.html.slim
+++ b/app/views/routing_constraint_zones/index.html.slim
@@ -5,7 +5,7 @@
- if @routing_constraint_zones.any?
= table_builder @routing_constraint_zones,
- { @routing_constraint_zones.human_attribute_name(:name) => 'name' },
+ { :name => 'name' },
[:show, :edit, :delete],
[],
'table table-bordered'
diff --git a/app/views/stop_areas/_stop_areas.html.slim b/app/views/stop_areas/_stop_areas.html.slim
index 331383218..2155e341a 100644
--- a/app/views/stop_areas/_stop_areas.html.slim
+++ b/app/views/stop_areas/_stop_areas.html.slim
@@ -1,6 +1,8 @@
- if @stop_areas.any?
= table_builder @stop_areas,
- { 'Object_id' => 'objectid', @stop_areas.human_attribute_name(:name) => 'name', @stop_areas.human_attribute_name(:registration_number) => 'registration_number', @stop_areas.human_attribute_name(:city_name) => 'city_name', @stop_areas.human_attribute_name(:zip_code) => 'zip_code' },
+ { 'Object_id' => 'objectid',
+ :name => 'name', :registration_number => 'registration_number',
+ :city_name => 'city_name', :zip_code => 'zip_code' },
[:show, :edit, :delete],
[],
'table table-bordered'
diff --git a/app/views/stop_areas/index.html.slim b/app/views/stop_areas/index.html.slim
index 830f96270..4d062e6c8 100644
--- a/app/views/stop_areas/index.html.slim
+++ b/app/views/stop_areas/index.html.slim
@@ -21,8 +21,9 @@
.row
.col-lg-12
= table_builder @stop_areas,
- { 'Oid' => Proc.new { |n| n.try(:objectid).try(:local_id) }, @stop_areas.human_attribute_name(:name) => 'name', @stop_areas.human_attribute_name(:registration_number) => 'registration_number', @stop_areas.human_attribute_name(:zip_code) => 'zip_code',
- @stop_areas.human_attribute_name(:city_name) => 'city_name', @stop_areas.human_attribute_name(:area_type) => Proc.new{|s| (s.area_type.nil? ? '-' : t("enumerize.stop_area.area_type.#{s.try(:area_type)}"))} },
+ { 'Oid' => Proc.new { |n| n.try(:objectid).try(:local_id) },
+ :name => 'name', :registration_number => 'registration_number', :zip_code => 'zip_code',
+ :city_name => 'city_name', :area_type => Proc.new{|s| (s.area_type.nil? ? '-' : t("enumerize.stop_area.area_type.#{s.try(:area_type)}"))} },
[:show, :edit, :delete],
[],
'table has-filter has-search'
diff --git a/app/views/workbenches/show.html.slim b/app/views/workbenches/show.html.slim
index e55a69a1f..5d60863c3 100644
--- a/app/views/workbenches/show.html.slim
+++ b/app/views/workbenches/show.html.slim
@@ -26,12 +26,12 @@
.col-lg-12
/ actions for table: controler+integrer, consulter, modifier, controler, dupliquer, conserver, purger, supprimer
= table_builder @wbench_refs,
- { @wbench_refs.human_attribute_name(:name) => 'name', @wbench_refs.human_attribute_name(:status) => Proc.new {|w| w.archived? ? ("<span class='fa fa-archive'></span> Conservé").html_safe : '-'},
- 'Organisation' => Proc.new {|w| w.organisation.name},
- @wbench_refs.human_attribute_name(:validity_period) => Proc.new {|w| w.validity_period.nil? ? '-' : t('validity_range', debut: l(w.try(:validity_period).try(:begin), format: :short), end: l(w.try(:validity_period).try(:end), format: :short))},
- 'Nb lignes' => Proc.new {|w| w.lines.count},
- @wbench_refs.human_attribute_name(:updated_at) => Proc.new {|w| l(w.updated_at, format: :short)},
- @wbench_refs.human_attribute_name(:published_at) => ''},
+ { :name => 'name', :status => Proc.new {|w| w.archived? ? ("<span class='fa fa-archive'></span> Conservé").html_safe : '-'},
+ :organisation => Proc.new {|w| w.organisation.name},
+ :validity_period => Proc.new {|w| w.validity_period.nil? ? '-' : t('validity_range', debut: l(w.try(:validity_period).try(:begin), format: :short), end: l(w.try(:validity_period).try(:end), format: :short))},
+ :lines => Proc.new {|w| w.lines.count},
+ :updated_at => Proc.new {|w| l(w.updated_at, format: :short)},
+ :published_at => ''},
[:show, :edit, :archive, :unarchive, :delete],
[:delete],
'table has-filter has-search'
diff --git a/config/locales/lines.fr.yml b/config/locales/lines.fr.yml
index c12b233cd..387a05c06 100644
--- a/config/locales/lines.fr.yml
+++ b/config/locales/lines.fr.yml
@@ -63,9 +63,10 @@ fr:
network: "Réseau"
company: "Transporteur principal"
registration_number: "Nom court"
+ deactivated: "Activé"
name: "Nom de la ligne"
published_name: "Nom public"
- number: "Indice"
+ number: "Nom court"
transport_mode: "Mode"
transport_submode: "Sous mode de transport"
url: "Page web associée"
diff --git a/config/locales/referentials.fr.yml b/config/locales/referentials.fr.yml
index 17ea64a56..a01859cef 100644
--- a/config/locales/referentials.fr.yml
+++ b/config/locales/referentials.fr.yml
@@ -87,6 +87,7 @@ fr:
published_at: "Intégré"
archived_at: "Conservé"
created_from: 'Créé à partir de'
+ organisation: 'Organisation'
formtastic:
titles:
referential:
diff --git a/config/locales/routes.fr.yml b/config/locales/routes.fr.yml
index b026891b9..fbab1ce4a 100644
--- a/config/locales/routes.fr.yml
+++ b/config/locales/routes.fr.yml
@@ -59,6 +59,8 @@ fr:
comment: "Commentaire"
direction: "Direction"
wayback: "Sens"
+ stop_points: "Nb arrêts"
+ journey_patterns: "Nb missions"
opposite_route: "Itinéraire associé en sens opposé"
opposite_route_id: "Itinéraire associé en sens opposé"
objectid: "Identifiant Neptune"
diff --git a/config/locales/routing_constraint_zones.fr.yml b/config/locales/routing_constraint_zones.fr.yml
index 276da2ce0..61e7e6f0d 100644
--- a/config/locales/routing_constraint_zones.fr.yml
+++ b/config/locales/routing_constraint_zones.fr.yml
@@ -2,13 +2,13 @@ fr:
activerecord:
models:
routing_constraint_zone: Zone de contrainte
- attributes:
- routing_constraint_zone:
- name: Nom
- stop_areas: Arrêts
- line: Ligne
- created_at: "Créé le"
- updated_at: "Modifié le"
+ attributes:
+ routing_constraint_zone:
+ name: Nom
+ stop_areas: Arrêts
+ line: Ligne
+ created_at: "Créé le"
+ updated_at: "Modifié le"
routing_constraint_zones:
actions:
new: Ajouter une zone de contrainte
diff --git a/config/locales/stop_points.fr.yml b/config/locales/stop_points.fr.yml
index 217bd9825..19787abea 100644
--- a/config/locales/stop_points.fr.yml
+++ b/config/locales/stop_points.fr.yml
@@ -38,11 +38,16 @@ fr:
other: "arrêts sur séquence d'arrêts"
attributes:
stop_point:
+ name: "Nom"
lines: "Lignes"
created_at: "Créé le"
updated_at: "Modifié le"
for_boarding: "Montée"
for_alighting: "Descente"
+ area_type: "Type d'arrêt"
+ city_name: "Commune"
+ zip_code: "Code postal"
+ position: "Position"
simple_form:
labels:
stop_point: