diff options
| author | Zog | 2017-12-19 16:10:15 +0100 | 
|---|---|---|
| committer | Zog | 2017-12-19 16:10:15 +0100 | 
| commit | 4b9eebda5bb81a214c87351c01c720c0cb0cf2e8 (patch) | |
| tree | b82f4c685bef58509b5649559d2519f8791849ba | |
| parent | 4983eca8f4be6acf00589d4d34e7dc17377bb070 (diff) | |
| download | chouette-core-4b9eebda5bb81a214c87351c01c720c0cb0cf2e8.tar.bz2 | |
Refs #5287; Uniformize actions5287-clean-links-in-stop-areas-index
| -rw-r--r-- | app/decorators/stop_area_decorator.rb | 9 | ||||
| -rw-r--r-- | config/locales/stop_areas.en.yml | 2 | ||||
| -rw-r--r-- | config/locales/stop_areas.fr.yml | 2 | ||||
| -rw-r--r-- | spec/views/stop_areas/index.html.slim_spec.rb | 4 | 
4 files changed, 4 insertions, 13 deletions
| diff --git a/app/decorators/stop_area_decorator.rb b/app/decorators/stop_area_decorator.rb index 4e777292d..8b2ebf490 100644 --- a/app/decorators/stop_area_decorator.rb +++ b/app/decorators/stop_area_decorator.rb @@ -7,15 +7,6 @@ class StopAreaDecorator < Draper::Decorator      links = []      stop_area ||= object -    if h.policy(Chouette::StopArea).new? -      links << Link.new( -        content: h.t('stop_areas.actions.new'), -        href: h.new_stop_area_referential_stop_area_path( -          stop_area.stop_area_referential -        ) -      ) -    end -      if h.policy(stop_area).update?        links << Link.new(          content: h.t('stop_areas.actions.edit'), diff --git a/config/locales/stop_areas.en.yml b/config/locales/stop_areas.en.yml index 324294892..54a5ebae5 100644 --- a/config/locales/stop_areas.en.yml +++ b/config/locales/stop_areas.en.yml @@ -15,7 +15,7 @@ en:      actions:        new: "Add a new stop"        edit: "Edit this stop" -      destroy: "Remove this stop" +      destroy: "Remove"        deleted_at: "Activated"        destroy_confirm: "Are you sure you want destroy this stop and all of his children ?"        select_parent: "Create or modify the relation child -> parent" diff --git a/config/locales/stop_areas.fr.yml b/config/locales/stop_areas.fr.yml index bf4dd832f..f96a2e564 100644 --- a/config/locales/stop_areas.fr.yml +++ b/config/locales/stop_areas.fr.yml @@ -15,7 +15,7 @@ fr:      actions:        new: "Ajouter un arrêt"        edit: "Editer cet arrêt" -      destroy: "Supprimer cet arrêt" +      destroy: "Supprimer"        deleted_at: "Activé"        destroy_confirm: "Etes vous sûr de supprimer cet arrêt ainsi que tous ses fils?"        select_parent: "Créer ou éditer la relation enfant -> parent" diff --git a/spec/views/stop_areas/index.html.slim_spec.rb b/spec/views/stop_areas/index.html.slim_spec.rb index e0c50685c..64c958879 100644 --- a/spec/views/stop_areas/index.html.slim_spec.rb +++ b/spec/views/stop_areas/index.html.slim_spec.rb @@ -40,8 +40,8 @@ describe "/stop_areas/index", :type => :view do    with_permission "stop_areas.create" do      it { should have_link_for_each_stop_area(stop_areas, "show", -> (stop_area){ view.stop_area_referential_stop_area_path(stop_area_referential, stop_area) }) } -    it { should have_link_for_each_stop_area(stop_areas, "create", -> (stop_area){ view.new_stop_area_referential_stop_area_path(stop_area_referential) }) } -    it { should have_the_right_number_of_links(stop_areas, 2) } +    it { should_not have_link_for_each_stop_area(stop_areas, "create", -> (stop_area){ view.new_stop_area_referential_stop_area_path(stop_area_referential) }) } +    it { should have_the_right_number_of_links(stop_areas, 1) }    end    with_permission "stop_areas.update" do | 
