diff --git a/app/controllers/gestions_controller.rb b/app/controllers/gestions_controller.rb index f2c29954e..43c7e4c08 100644 --- a/app/controllers/gestions_controller.rb +++ b/app/controllers/gestions_controller.rb @@ -28,7 +28,7 @@ def create respond_to do |format| if @gestion.save - format.html { redirect_to @gestion, notice: 'Gestion was successfully created.' } + format.html { redirect_to @gestion, notice: t(".flashes.created") } format.json { render :show, status: :created, location: @gestion } else format.html { render :new } @@ -42,7 +42,7 @@ def create def update respond_to do |format| if @gestion.update(gestion_params) - format.html { redirect_to @gestion, notice: 'Gestion was successfully updated.' } + format.html { redirect_to @gestion, notice: t(".flashes.updated") } format.json { render :show, status: :ok, location: @gestion } else format.html { render :edit } @@ -56,7 +56,7 @@ def update def destroy if @gestion.destroy respond_to do |format| - format.html { redirect_to gestions_url, notice: 'Gestion a bien été supprimé.' } + format.html { redirect_to gestions_url, notice: t(".flashes.destroyed") } format.json { head :no_content } end else diff --git a/app/views/gestions/_form.html.erb b/app/views/gestions/_form.html.erb index b8a65d927..c052fb11a 100644 --- a/app/views/gestions/_form.html.erb +++ b/app/views/gestions/_form.html.erb @@ -1,8 +1,12 @@ <%= form_for(@gestion, html: { class: "form-horizontal", role: "form" }) do |f| %> <% if @gestion.errors.any? %>
Nom | -Usage | ++ <%= Gestion.human_attribute_name(:name) %> + | ++ <%= Gestion.human_attribute_name(:usage) %> + | @@ -33,14 +42,14 @@ | <%= gestion %> | -<%= pluralize(gestion.servers.count, 'serveur', 'serveurs') %> | -<%= link_to 'Voir', gestion_path(gestion), class: 'btn btn-primary' %> | -<%= link_to 'Modifier', edit_gestion_path(gestion), class: 'btn btn-primary' %> | +<%= Gestion.human_attribute_name(:servers, count: gestion.servers.count) %> | +<%= link_to t("action.show"), gestion_path(gestion), class: 'btn btn-primary' %> | +<%= link_to t("action.edit"), edit_gestion_path(gestion), class: 'btn btn-primary' %> | - <%= link_to 'Supprimer', + <%= link_to t("action.delete"), gestion, method: :delete, - data: { confirm: 'Ce gestionnaire ne pourra pas être supprimé tant qu\'il sera associé à au moins un serveur. Voulez-vous continuer ?' }, + data: { confirm: t(".delete_confirmation") }, class: 'btn btn-danger' %> | <% end %> diff --git a/app/views/gestions/new.html.erb b/app/views/gestions/new.html.erb index d92e91ade..63949afa6 100644 --- a/app/views/gestions/new.html.erb +++ b/app/views/gestions/new.html.erb @@ -1,9 +1,11 @@
---|