diff options
| author | Alban Peignier | 2012-03-11 14:59:34 +0100 |
|---|---|---|
| committer | Alban Peignier | 2012-03-11 15:06:12 +0100 |
| commit | da9830bbeac8b124f8065ece1aebfd482b52a57b (patch) | |
| tree | 862dcd15ba1c958e1bead25a08522cc3c646ec6a /app | |
| parent | dc8a6f7f9182996ea3f39986b45c3a71927a8e4a (diff) | |
| download | chouette-core-da9830bbeac8b124f8065ece1aebfd482b52a57b.tar.bz2 | |
Complete a first i18n support
Diffstat (limited to 'app')
| -rw-r--r-- | app/views/companies/_form.erb | 2 | ||||
| -rw-r--r-- | app/views/companies/index.html.erb | 2 | ||||
| -rw-r--r-- | app/views/layouts/_user_links.erb | 12 | ||||
| -rw-r--r-- | app/views/layouts/application.html.erb | 12 | ||||
| -rw-r--r-- | app/views/lines/_form.erb | 13 | ||||
| -rw-r--r-- | app/views/lines/_line.erb | 8 | ||||
| -rw-r--r-- | app/views/lines/edit.html.erb | 2 | ||||
| -rw-r--r-- | app/views/lines/index.html.erb | 21 | ||||
| -rw-r--r-- | app/views/lines/show.html.erb | 36 | ||||
| -rw-r--r-- | app/views/networks/_form.erb | 10 | ||||
| -rw-r--r-- | app/views/networks/show.html.erb | 8 |
11 files changed, 77 insertions, 49 deletions
diff --git a/app/views/companies/_form.erb b/app/views/companies/_form.erb index 7e90e7259..5e902bcec 100644 --- a/app/views/companies/_form.erb +++ b/app/views/companies/_form.erb @@ -14,6 +14,6 @@ <%= form.buttons do %> <%= form.commit_button true %> <li><%= t('or') %></li> - <li><%= link_to t('back'), :back %></li> + <li><%= link_to t('cancel'), :back %></li> <% end %> <% end %> diff --git a/app/views/companies/index.html.erb b/app/views/companies/index.html.erb index b20804fa0..09501d5bf 100644 --- a/app/views/companies/index.html.erb +++ b/app/views/companies/index.html.erb @@ -1,4 +1,4 @@ -<%= title_tag t('companies.title.index') %> +<%= title_tag t('companies.index.title') %> <%= render :partial => "company", :collection => @companies %> diff --git a/app/views/layouts/_user_links.erb b/app/views/layouts/_user_links.erb new file mode 100644 index 000000000..41d01375c --- /dev/null +++ b/app/views/layouts/_user_links.erb @@ -0,0 +1,12 @@ +<ul class="user"> + <li class="home"><%= link_to t('layouts.home'), root_path %></li> + <li> | </li> + <li class="<%= language_class("fr") %>"><%= link_to_language :fr %></li> + <li class="<%= language_class("en") %>"><%= link_to_language :en %></li> + <li> + <li> | </li> + <%= link_to "/help/index" do %> + <span class="help"><%= t('layouts.help') %></span> + <% end %> + </li> +</ul> diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index d79351080..6da2f13ca 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -11,20 +11,18 @@ <body> <div id="header"> <div class="infos"> - <ul class="user"> - <li><%= link_to(t('layouts.home'), referentials_path) %></li> - </ul> + <%= render "layouts/user_links" %> <h1>Chouette</h1> </div> <div class="tabs"> <ul class="main"> <% if !@referential.present? || @referential.new_record? %> - <li><%= tab_link_to t('activerecord.models.referential'), referentials_path %></li> + <li><%= tab_link_to Referential, referentials_path %></li> <% else %> - <li><%= link_to "Tableau de bord", referential_path(@referential), :class => ("current" if current_page?(referential_path(@referential))) %></li> - <li><%= tab_link_to t('activerecord.models.line'), referential_lines_path(@referential) %></li> - <li><%= tab_link_to t('activerecord.models.network'), referential_networks_path(@referential) %></li> + <li><%= link_to t("layouts.tabs.dashboard"), referential_path(@referential), :class => ("current" if current_page?(referential_path(@referential))) %></li> + <li><%= tab_link_to Chouette::Line, referential_lines_path(@referential) %></li> + <li><%= tab_link_to Chouette::Network, referential_networks_path(@referential) %></li> <li><%= tab_link_to t('activerecord.models.company'), referential_companies_path(@referential) %></li> <% end %> </ul> diff --git a/app/views/lines/_form.erb b/app/views/lines/_form.erb index a3eb8f6f1..ddbffdf55 100644 --- a/app/views/lines/_form.erb +++ b/app/views/lines/_form.erb @@ -2,19 +2,26 @@ <%= semantic_form_for [@referential, @line] do |form| %> <%= form.inputs do %> <%= form.input :name %> - <%= form.input :objectid %> + <% if @line.new_record? %> + <%= form.input :objectid %> + <% else %> + <li> + <label><%= @line.human_attribute_name("objectid") %>: </label> + <%= @line.objectid %> + </li> + <% end %> <%= form.input :registration_number %> <%= form.input :network, :as => :select, :collection => Chouette::Network.all, :include_blank => false %> <%= form.input :company, :as => :select, :collection => Chouette::Company.all, :include_blank => false%> <%= form.input :published_name %> <%= form.input :number %> <%= form.input :transport_mode_name, :as => :select, :collection => Chouette::TransportMode.definitions, :include_blank => false, :member_label => Proc.new { |a| t("#{a[0]}") } %> - <%= form.input :comment, :as => :text %> + <%= form.input :comment %> <% end %> <%= form.buttons do %> <%= form.commit_button true %> <li><%= t('or') %></li> - <li><%= link_to t('back'), :back %></li> + <li><%= link_to t('cancel'), :back %></li> <% end %> <% end %> diff --git a/app/views/lines/_line.erb b/app/views/lines/_line.erb index f38bbc193..30f29b02d 100644 --- a/app/views/lines/_line.erb +++ b/app/views/lines/_line.erb @@ -8,12 +8,12 @@ <% end %> <%= link_to truncate(line.name, :length => 30), [@referential, line], :title => "Ligne #{line.name}" %> <div class="info"> - Réseau <%= link_to_if( line.network, line.network.name, referential_network_path(@referential, line.network), :title => "Réseau : #{line.network.name}" ) %> - - Transporteur <%= link_to_if( line.company, line.company.name, referential_company_path(@referential, line.company), :title => "Transporteur : #{line.company.name}" ) %> + <%= 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}" ) %> <div class="actions"> - <%= link_to "Modifier", edit_referential_line_path(@referential, line), :class => "edit" %> | - <%= link_to "Supprimer", referential_line_path(@referential, line), :method => :delete, :confirm => t('lines.actions.destroy_confirm'), :class => "remove" %> + <%= 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" %> </div> </div> <% end %> diff --git a/app/views/lines/edit.html.erb b/app/views/lines/edit.html.erb index 7f1b4bd67..d2c9880ae 100644 --- a/app/views/lines/edit.html.erb +++ b/app/views/lines/edit.html.erb @@ -1,3 +1,3 @@ -<%= title_tag t('lines.show.title', :line => @line.name ) %> +<%= title_tag t('lines.edit.title', :line => @line.name ) %> <%= render "form" %> diff --git a/app/views/lines/index.html.erb b/app/views/lines/index.html.erb index 46a41534f..bd206ea4f 100644 --- a/app/views/lines/index.html.erb +++ b/app/views/lines/index.html.erb @@ -1,29 +1,28 @@ <%= title_tag t('lines.index.title') %> <%= search_form_for @q, :url => referential_lines_path(@referential), :html => {:method => :get} do |f| %> - <%= f.label :name_or_number_cont %> + <%= f.label :name_or_number_cont, "#{t('.name_or_number')} :" %> <%= f.text_field :name_or_number_cont %> <%= f.hidden_field :company_id_eq %> <%= f.hidden_field :network_id_eq %> - <%= f.submit %> ou - <%= link_to "annuler", referential_lines_path(@referential) %> + <%= f.submit t('actions.search') %> <%= t("or") %> + <%= link_to t("cancel"), referential_lines_path(@referential) %> <% end %> -<% if @q.company_id_eq.present? %> +<% if @q.network_id_eq.present? %> <p> - Transporteur : <%= @referential.companies.find(@q.company_id_eq).name %> + <%= Chouette::Line.human_attribute_name('network') %> : <%= @referential.networks.find(@q.network_id_eq).name %> </p> <% end %> -<% if @q.network_id_eq.present? %> +<% if @q.company_id_eq.present? %> <p> - Réseau : <%= @referential.networks.find(@q.network_id_eq).name %> + <%= Chouette::Line.human_attribute_name('company') %> : <%= @referential.companies.find(@q.company_id_eq).name %> </p> <% end %> - <%#= will_paginate @lines %> <div class="lines paginated_content"> <%= render :partial => "line", :collection => @lines %> @@ -35,7 +34,7 @@ <li><%= link_to t('lines.actions.new'), new_referential_line_path(@referential), :class => "add" %></li> </ul> -<h3>Sélection</h3> +<h3><%= t(".selection") %></h3> <h4><%= Chouette::Company.model_name.human.pluralize %></h4> @@ -43,7 +42,7 @@ <% @referential.companies.each do |company| %> <li><%= link_with_search company.name, "company_id_eq" => company.id %></li> <% end %> -<li><%= link_with_search "Toutes", {"company_id_eq" => nil}, :class => "all" %></li> +<li><%= link_with_search t(".selection_all"), {"company_id_eq" => nil}, :class => "all" %></li> </ul> <h4><%= Chouette::Network.model_name.human.pluralize %></h4> @@ -52,7 +51,7 @@ <% @referential.networks.each do |network| %> <li><%= link_with_search network.name, "network_id_eq" => network.id %></li> <% end %> -<li><%= link_with_search "Tous", {"network_id_eq" => nil}, :class => "all" %></li> +<li><%= link_with_search t(".selection_all"), {"network_id_eq" => nil}, :class => "all" %></li> </ul> <% end %> diff --git a/app/views/lines/show.html.erb b/app/views/lines/show.html.erb index 4db5cff99..74ed626b0 100644 --- a/app/views/lines/show.html.erb +++ b/app/views/lines/show.html.erb @@ -4,37 +4,49 @@ <div class="summary"> <p> - <label><%= Chouette::Line.human_attribute_name(:network) %>: </label> - <%= @line.network.name if @line.network.present? %> + <label><%= @line.human_attribute_name("name") %>: </label> + <%= @line.name %> </p> <p> - <label><%= Chouette::Line.human_attribute_name("company") %>: </label> - <%= @line.company.name if @line.company.present? %> + <label><%= @line.human_attribute_name("objectid") %>: </label> + <%= @line.objectid %> </p> <p> - <label><%= Chouette::Line.human_attribute_name("registrationnumber") %>: </label> - <%= @line.registration_number %> + <label><%= @line.human_attribute_name(:network) %>: </label> + <%= link_to @line.network.name, [@referential, @line.network] %> </p> <p> - <label><%= Chouette::Line.human_attribute_name("name") %>: </label> - <%= @line.name %> + <label><%= @line.human_attribute_name("company") %>: </label> + <%= link_to @line.company.name, [@referential, @line.company] %> + </p> + <p> + <label><%= @line.human_attribute_name("registration_number") %>: </label> + <%= @line.registration_number %> </p> <p> - <label><%= Chouette::Line.human_attribute_name("publishedname") %>: </label> + <label><%= @line.human_attribute_name("published_name") %>: </label> <%= @line.publishedname %> </p> <p> - <label><%= Chouette::Line.human_attribute_name("number") %>: </label> + <label><%= @line.human_attribute_name("number") %>: </label> <%= @line.number %> </p> <p> - <label><%= Chouette::Line.human_attribute_name("transport_mode_name") %>: </label> + <label><%= @line.human_attribute_name("transport_mode_name") %>: </label> <%= @line.transport_mode_name %> </p> <p> - <label><%= Chouette::Line.human_attribute_name("comment") %>: </label> + <label><%= @line.human_attribute_name("comment") %>: </label> <%= @line.comment %> </p> + <p> + <label><%= @line.human_attribute_name("creation_time") %>: </label> + <%= @line.creation_time %> + </p> + <p> + <label><%= @line.human_attribute_name("creator_id") %>: </label> + <%= @line.creator_id %> + </p> </div> </div> diff --git a/app/views/networks/_form.erb b/app/views/networks/_form.erb index 877e238bf..e81bc7ce8 100644 --- a/app/views/networks/_form.erb +++ b/app/views/networks/_form.erb @@ -2,16 +2,16 @@ <%= form.inputs do %> <%= form.input :name %> <%= form.input :registration_number %> - <%= form.input :comment, :as => :text %> + <%= form.input :comment %> <%= form.input :version_date %> - <%= form.input :description, :as => :text %> - <%= form.input :source_name, :as => :text %> - <%= form.input :source_identifier, :as => :text %> + <%= form.input :description %> + <%= form.input :source_name %> + <%= form.input :source_identifier %> <% end %> <%= form.buttons do %> <%= form.commit_button %> <li><%= t('or') %></li> - <li><%= link_to t('back'), :back %></li> + <li><%= link_to t('cancel'), :back %></li> <% end %> <% end %> diff --git a/app/views/networks/show.html.erb b/app/views/networks/show.html.erb index 4fb8c3201..489978f49 100644 --- a/app/views/networks/show.html.erb +++ b/app/views/networks/show.html.erb @@ -4,14 +4,14 @@ <div class="summary"> <p> - <label><%= Chouette::Network.human_attribute_name("registrationnumber") %>: </label> - <%= @network.registrationnumber %> - </p> - <p> <label><%= Chouette::Network.human_attribute_name("name") %>: </label> <%= @network.name %> </p> <p> + <label><%= Chouette::Network.human_attribute_name("registration_number") %>: </label> + <%= @network.registrationnumber %> + </p> + <p> <label><%= Chouette::Network.human_attribute_name("comment") %>: </label> <%= @network.comment %> </p> |
