diff options
| author | Luc Donnet | 2012-01-09 17:57:51 +0100 |
|---|---|---|
| committer | Luc Donnet | 2012-01-09 17:57:51 +0100 |
| commit | a4eeeeaa4b7b199e5b4e41c61c33e5a56fccc823 (patch) | |
| tree | fb6d934cb44518c7b04b87e4f4886efd36fcfa58 /app/views | |
| parent | d9dd47206fe11e6b2400ed93407fc50521fa10dd (diff) | |
| download | chouette-core-a4eeeeaa4b7b199e5b4e41c61c33e5a56fccc823.tar.bz2 | |
Add locales and views for lines
Diffstat (limited to 'app/views')
| -rw-r--r-- | app/views/layouts/application.html.erb | 2 | ||||
| -rw-r--r-- | app/views/lines/_form.erb | 19 | ||||
| -rw-r--r-- | app/views/lines/index.html.erb | 10 | ||||
| -rw-r--r-- | app/views/lines/show.html.erb | 30 |
4 files changed, 47 insertions, 14 deletions
diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 048347894..7e0460ebb 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -16,7 +16,7 @@ <div class="tabs"> <ul class="main"> - <li><%= tab_link_to "Lines", lines_path %></li> + <li><%= tab_link_to t('activerecord.models.line'), lines_path %></li> </ul> </div> </div> diff --git a/app/views/lines/_form.erb b/app/views/lines/_form.erb index 4d1a049b2..76c2ec53d 100644 --- a/app/views/lines/_form.erb +++ b/app/views/lines/_form.erb @@ -1,11 +1,18 @@ -<% semantic_form_for @line do |form| %> - <% form.inputs do %> +<%= semantic_form_for @line do |form| %> + <%= form.inputs do %> + <%= 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 :registrationnumber %> <%= form.input :name %> - <%= form.input :number %> + <%= form.input :publishedname %> + <%= form.input :number %> + <%= form.input :transportmodename, :as => :select, :collection => Chouette::TransportMode.definitions, :include_blank => false, :member_label => Proc.new { |a| t("#{a[0]}") } %> + <%= form.input :comment, :as => :text %> <% end %> - <% form.buttons do %> - <%= form.commit_button %> - ou <%= link_to "revenir", @line %> + <%= form.buttons do %> + <%= form.commit_button true %> + <li><%= t('or') %></li> + <li><%= link_to t('back'), :back %></li> <% end %> <% end %> diff --git a/app/views/lines/index.html.erb b/app/views/lines/index.html.erb index d76172269..7ac2aab8c 100644 --- a/app/views/lines/index.html.erb +++ b/app/views/lines/index.html.erb @@ -1,10 +1,16 @@ -<%= title_tag "Lignes" %> +<div class="order"> + Trier par + <%= order "name" %> | + <%= order "number" %> +</div> + +<%= title_tag Chouette::Line.model_name.human.pluralize %> <%= render :partial => "line", :collection => @lines %> <% content_for :sidebar do %> <ul class="actions"> - <li><%= link_to "Créer une Ligne", new_line_path, :class => "add" %></li> + <li><%= link_to t('lines.actions.new'), new_line_path, :class => "add" %></li> <br> </ul> <% end %> diff --git a/app/views/lines/show.html.erb b/app/views/lines/show.html.erb index cf60567f1..b716705ad 100644 --- a/app/views/lines/show.html.erb +++ b/app/views/lines/show.html.erb @@ -4,16 +4,36 @@ <div class="summary"> <p> - <label>Nom :</label> + <label><%= Chouette::Line.human_attribute_name(:network) %>: </label> + <%= @line.network.name if @line.network.present? %> + </p> + <p> + <label><%= Chouette::Line.human_attribute_name("company") %>: </label> + <%= @line.company.name if @line.company.present? %> + </p> + <p> + <label><%= Chouette::Line.human_attribute_name("registrationnumber") %>: </label> + <%= @line.registrationnumber %> + </p> + <p> + <label><%= Chouette::Line.human_attribute_name("name") %>: </label> <%= @line.name %> </p> <p> - <label>Code :</label> + <label><%= Chouette::Line.human_attribute_name("publishedname") %>: </label> + <%= @line.publishedname %> + </p> + <p> + <label><%= Chouette::Line.human_attribute_name("number") %>: </label> <%= @line.number %> </p> <p> - <label>Identifiant Chouette :</label> - <%= @line.registrationnumber %> + <label><%= Chouette::Line.human_attribute_name("transportmodename") %>: </label> + <%= @line.transportmodename %> + </p> + <p> + <label><%= Chouette::Line.human_attribute_name("comment") %>: </label> + <%= @line.comment %> </p> </div> </div> @@ -21,7 +41,7 @@ <% content_for :sidebar do %> <ul class="actions"> <li><%= link_to t('lines.actions.edit'), edit_line_path(@line), :class => "edit" %></li> - <li><%= link_to t('lines.actions.destroy'), line_path(@line), :method => :delete, :confirm => "Etes vous sûr de supprimer la ligne #{@line.name} ?", :class => "remove" %></li> + <li><%= link_to t('lines.actions.destroy'), line_path(@line), :method => :delete, :confirm => t('lines.actions.destroy_confirm'), :class => "remove" %></li> <br> </ul> <% end %> |
