aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEdouard Maffert2016-09-09 10:50:13 +0200
committerEdouard Maffert2016-09-09 10:50:20 +0200
commita40c2468c762f039061e71f2e2ba03358e5183ec (patch)
tree04663389aa0707f7ee228c7619b20ef4baa2c758
parent5e18276c5a01359f5b1e76146283e7b528aeed50 (diff)
downloadchouette-core-a40c2468c762f039061e71f2e2ba03358e5183ec.tar.bz2
dedicated view for LineReferential edit #1604
-rw-r--r--app/views/line_referentials/_form.html.slim7
-rw-r--r--app/views/line_referentials/edit.html.slim3
-rw-r--r--app/views/line_referentials/show.html.slim14
-rw-r--r--config/locales/line_referentials.en.yml8
-rw-r--r--config/locales/line_referentials.fr.yml8
-rw-r--r--config/routes.rb4
6 files changed, 32 insertions, 12 deletions
diff --git a/app/views/line_referentials/_form.html.slim b/app/views/line_referentials/_form.html.slim
new file mode 100644
index 000000000..0a58a70ae
--- /dev/null
+++ b/app/views/line_referentials/_form.html.slim
@@ -0,0 +1,7 @@
+= semantic_form_for @line_referential, :url => line_referential_path do |form|
+ = form.inputs do
+ = form.input :sync_interval
+
+ = form.actions do
+ = form.action :submit, as: :button
+ = form.action :cancel, as: :link \ No newline at end of file
diff --git a/app/views/line_referentials/edit.html.slim b/app/views/line_referentials/edit.html.slim
new file mode 100644
index 000000000..820b788e5
--- /dev/null
+++ b/app/views/line_referentials/edit.html.slim
@@ -0,0 +1,3 @@
+= title_tag t('line_referentials.edit.title', line_referential: @line_referential.name)
+
+= render 'form' \ No newline at end of file
diff --git a/app/views/line_referentials/show.html.slim b/app/views/line_referentials/show.html.slim
index 5d35d84b4..072877c62 100644
--- a/app/views/line_referentials/show.html.slim
+++ b/app/views/line_referentials/show.html.slim
@@ -8,24 +8,18 @@
li.list-group-item
span.badge = @line_referential.group_of_lines.size
= link_to Referential.human_attribute_name("group_of_lines"), line_referential_group_of_lines_path(@line_referential)
-
+
li.list-group-item
span.badge = @line_referential.operating_lines.size
= link_to Referential.human_attribute_name("lines"), line_referential_lines_path(@line_referential)
- unless @line_referential.line_referential_sync.line_sync_operations.empty?
- = title_tag "Historique des synchronisations"
+ h3 Historique des synchronisations
ul.list-group width="75%"
- @line_referential.line_referential_sync.line_sync_operations.each do |sync|
li = "#{sync.created_at.to_formatted_s(:short)} - #{sync.message}"
-= semantic_form_for @line_referential, :url => line_referential_path do |form|
- = form.inputs do
- = form.input :sync_interval
-
- = form.actions do
- = form.action :submit, as: :button
-
- content_for :sidebar do
- ul.actions \ No newline at end of file
+ ul.actions
+ = link_to t('line_referentials.actions.edit'), edit_line_referential_path(@line_referential), class: 'edit' \ No newline at end of file
diff --git a/config/locales/line_referentials.en.yml b/config/locales/line_referentials.en.yml
index ad4cfa45c..d7cd6c519 100644
--- a/config/locales/line_referentials.en.yml
+++ b/config/locales/line_referentials.en.yml
@@ -1,8 +1,16 @@
en:
+ line_referentials:
+ actions:
+ edit: "Edit this referential"
+ edit:
+ title: "Edit %{line_referential} referential"
synchronization:
message: "Synchronization successful in %{time} seconds with %{imported} objects from Codifligne. %{deleted} objects were deleted."
failure: "Synchronization interrupted after %{time} seconds."
activerecord:
+ models:
+ line_referential:
+ one: "referential"
attributes:
line_referential:
sync_interval: "Synchronisation frequency" \ No newline at end of file
diff --git a/config/locales/line_referentials.fr.yml b/config/locales/line_referentials.fr.yml
index 6378087d7..b18a53d5b 100644
--- a/config/locales/line_referentials.fr.yml
+++ b/config/locales/line_referentials.fr.yml
@@ -1,9 +1,17 @@
fr:
+ line_referentials:
+ actions:
+ edit: "Modifier ce référentiel"
+ edit:
+ title: "Modifier le référentiel %{line_referential}"
synchronization:
message:
success: "Synchronisation réussie après %{time} secondes avec %{imported} éléments importés de Codifligne. %{deleted} éléments ont été supprimés."
failure: "Synchronisation interrompue après %{time} secondes."
activerecord:
+ models:
+ line_referential:
+ one: "référentiel"
attributes:
line_referential:
sync_interval: "Fréquence de synchronisation" \ No newline at end of file
diff --git a/config/routes.rb b/config/routes.rb
index af466f640..25c3d4838 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -10,7 +10,7 @@ ChouetteIhm::Application.routes.draw do
authenticated :user do
root :to => 'referentials#index', as: :authenticated_root
end
-
+
unauthenticated :user do
target = 'devise/sessions#new'
@@ -55,7 +55,7 @@ ChouetteIhm::Application.routes.draw do
resources :stop_areas
end
- resources :line_referentials, :only => [:show, :update] do
+ resources :line_referentials, :only => [:show, :edit, :update] do
resources :lines
resources :group_of_lines
end