aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichel Etienne2012-08-07 16:24:03 +0200
committerMichel Etienne2012-08-07 16:24:03 +0200
commite310caf444cd57a431bb9ea75a627addae12a6e6 (patch)
treea3b85b4e6048655a4232d0eb73fe0cdc2ded1205
parentceb2b19a86135ddf964ad98fedbc44e835615a60 (diff)
downloadchouette-core-e310caf444cd57a431bb9ea75a627addae12a6e6.tar.bz2
manage lines without network or company
-rw-r--r--Gemfile.lock2
-rw-r--r--app/views/lines/_line.erb17
-rw-r--r--app/views/lines/show.html.erb10
-rw-r--r--config/locales/lines.yml2
4 files changed, 24 insertions, 7 deletions
diff --git a/Gemfile.lock b/Gemfile.lock
index 923dabadb..9839a9b64 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -1,6 +1,6 @@
GIT
remote: git://chouette.dryade.priv/ninoxe
- revision: cfe22c1b51488e52bcbd3facd501b121e075bd62
+ revision: 42fac2f75fe5486212af7a022554459e4cbad69c
specs:
ninoxe (0.0.8)
GeoRuby
diff --git a/app/views/lines/_line.erb b/app/views/lines/_line.erb
index a3b5c1b86..9fe32ce83 100644
--- a/app/views/lines/_line.erb
+++ b/app/views/lines/_line.erb
@@ -1,5 +1,5 @@
<%= div_for(line) do %>
- <%= link_to([@referential, line], :class => "preview", :title => "Ligne #{line.number}") do %>
+ <%= link_to([@referential, line], :class => "preview", :title => "#{Chouette::Line.model_name.human.capitalize} #{line.number}") do %>
<div class="color">
<% if line.number and line.number.length <= 3 %>
<div class="number"><%= line.number %></div>
@@ -8,12 +8,19 @@
<% end %>
<div class="name">
<%= check_box_tag "ids[]", line.id, false, :class => "multiple_selection", :style => "display: none;" %>
- <%= link_to truncate(line.name, :length => 30), [@referential, line], :title => "Ligne #{line.name}"%>
+ <%= link_to truncate(line.name, :length => 30), [@referential, line], :title => "#{Chouette::Line.model_name.human.capitalize} #{line.name}"%>
</div>
<div class="info">
- <%= line.human_attribute_name('network') %> <%= link_to_if line.network, line.network.name, referential_network_path(@referential, line.network), :title => "#{line.human_attribute_name('network')} #{line.network.name}" %> -
- <%= line.human_attribute_name('company') %> <%= link_to_if( line.company, line.company.name, referential_company_path(@referential, line.company), :title => "#{line.human_attribute_name('company')} #{line.company.name}" ) %>
-
+ <% if line.network.nil? %>
+ <%= line.human_attribute_name('network') %> <%= t('lines.index.unset') %>
+ <% else %>
+ <%= line.human_attribute_name('network') %> <%= link_to_if line.network, line.network.name, referential_network_path(@referential, line.network), :title => "#{line.human_attribute_name('network')} #{line.network.name}" %> -
+ <% end %>
+ <% if line.company.nil? %>
+ <%= line.human_attribute_name('company') %> <%= t('lines.index.unset') %>
+ <% else %>
+ <%= line.human_attribute_name('company') %> <%= link_to_if( line.company, line.company.name, referential_company_path(@referential, line.company), :title => "#{line.human_attribute_name('company')} #{line.company.name}" ) %>
+ <% end %>
<div class="actions">
<%= link_to t("actions.edit"), edit_referential_line_path(@referential, line), :class => "edit" %> |
<%= link_to t("actions.destroy"), referential_line_path(@referential, line), :method => :delete, :confirm => t('lines.actions.destroy_confirm'), :class => "remove" %>
diff --git a/app/views/lines/show.html.erb b/app/views/lines/show.html.erb
index 5e210ff5e..2f74ab4fa 100644
--- a/app/views/lines/show.html.erb
+++ b/app/views/lines/show.html.erb
@@ -6,11 +6,19 @@
<div class="summary">
<p>
<label><%= @line.human_attribute_name(:network) %>: </label>
+ <% if @line.network.nil? %>
+ <%= t('lines.index.unset') %>
+ <% else %>
<%= link_to @line.network.name, [@referential, @line.network] %>
+ <% end %>
</p>
<p>
- <label><%= @line.human_attribute_name("company") %>: </label>
+ <label><%= @line.human_attribute_name(:company) %>: </label>
+ <% if @line.company.nil? %>
+ <%= t('lines.index.unset') %>
+ <% else %>
<%= link_to @line.company.name, [@referential, @line.company] %>
+ <% end %>
</p>
<p>
<label><%= @line.human_attribute_name("name") %>: </label>
diff --git a/config/locales/lines.yml b/config/locales/lines.yml
index 502bab4bf..7e37501fb 100644
--- a/config/locales/lines.yml
+++ b/config/locales/lines.yml
@@ -25,6 +25,7 @@ en:
export_selected: Export lines
select_all: Select all
deselect_all: Deselect all
+ unset: undefined
activerecord:
models:
line:
@@ -78,6 +79,7 @@ fr:
export_selected: Exporter les lignes
select_all: Tout sélectionner
deselect_all: Tout désélectionner
+ unset: non défini
activerecord:
models:
line: