From 9a34cb48f49df574ae1e7c599713ed246e2938cf Mon Sep 17 00:00:00 2001 From: Zog Date: Wed, 20 Dec 2017 12:58:20 +0100 Subject: Refs #5430 @2h; Deactivate lines instead of destroying them - Add `activate` and `deactivate` actions in `LinesController`, as well as corresponding routes - Add `activate!` and `deactivate!` methods in `Chouette::Line`, as well as `activated?` - Add `activate?` and `deactivate?` permissions in `LinePolicy` - Add corresponding `action_links`in the Decorator - Create helper for these actions - Add an optional `'extra_class` to the Links - Update styles for ".delete-action" to handle the case where there are several - Add I18n keys accordingly --- app/helpers/table_builder_helper.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'app/helpers/table_builder_helper.rb') diff --git a/app/helpers/table_builder_helper.rb b/app/helpers/table_builder_helper.rb index de78e903d..96b2889da 100644 --- a/app/helpers/table_builder_helper.rb +++ b/app/helpers/table_builder_helper.rb @@ -368,6 +368,10 @@ module TableBuilderHelper end def gear_menu_link(link) + klass = [link.extra_class] + klass << 'delete-action' if link.method == :delete + klass = klass.compact.join(' ') + klass = nil unless klass.present? content_tag( :li, link_to( @@ -377,7 +381,7 @@ module TableBuilderHelper ) do link.content end, - class: ('delete-action' if link.method == :delete) + class: klass ) end -- cgit v1.2.3