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 --- lib/link.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lib/link.rb') diff --git a/lib/link.rb b/lib/link.rb index 7683a808f..d34c5c59a 100644 --- a/lib/link.rb +++ b/lib/link.rb @@ -1,10 +1,11 @@ class Link - attr_reader :content, :href, :method, :data + attr_reader :content, :href, :method, :data, :extra_class - def initialize(content: nil, href:, method: nil, data: nil) + def initialize(content: nil, href:, method: nil, data: nil, extra_class: nil) @content = content @href = href @method = method @data = data + @extra_class = extra_class end end -- cgit v1.2.3 From be8afa7aa3fd1c8922a4e02e16cdfef698b3df26 Mon Sep 17 00:00:00 2001 From: Zog Date: Thu, 21 Dec 2017 15:47:29 +0100 Subject: Refs #5361 @1H; Make company optional in Lines form And handle the case when it is nil in the views --- lib/link.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lib/link.rb') diff --git a/lib/link.rb b/lib/link.rb index d34c5c59a..33995c2f7 100644 --- a/lib/link.rb +++ b/lib/link.rb @@ -1,11 +1,12 @@ class Link - attr_reader :content, :href, :method, :data, :extra_class + attr_reader :content, :href, :method, :data, :extra_class, :disabled - def initialize(content: nil, href:, method: nil, data: nil, extra_class: nil) + def initialize(content: nil, href:, method: nil, data: nil, extra_class: nil, disabled: false) @content = content @href = href @method = method @data = data @extra_class = extra_class + @disabled = disabled end end -- cgit v1.2.3