aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorTeddy Wing2018-01-23 11:42:15 +0100
committerZog2018-01-25 17:18:01 +0100
commit759699cec33a06b931c50f4473460fb79290e356 (patch)
tree12492d1a95491c6f619a07e638451e78ca7f307a /lib
parent9f4584ef7427575fce4b8294b79f2368b130d8b6 (diff)
downloadchouette-core-759699cec33a06b931c50f4473460fb79290e356.tar.bz2
Imports#index: Move 'New import' button to action links
Begin the process of converting the `ImportDecorator` to the new action links interface. For now, only the "New import" button on the top right of the index page is converted. The rest of the links are commented out for now and will be treated in a subsequent commit. Add a new `#class?` method to `AF83::Decorator::Link` that tells callers whether a CSS class has been defined on the link. This allows us to determine whether we should force a class or use the one provided in `_page_header.html.slim`. We need a way to specify the class of the link in the header because the "New import" button is supposed to be blue (`.btn-primary`), but the default for primary action links is white. Refs #5586
Diffstat (limited to 'lib')
-rw-r--r--lib/af83/decorator/link.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/af83/decorator/link.rb b/lib/af83/decorator/link.rb
index 55db3f5bb..10e6091aa 100644
--- a/lib/af83/decorator/link.rb
+++ b/lib/af83/decorator/link.rb
@@ -25,6 +25,10 @@ class AF83::Decorator::Link
link_class args
end
+ def class?
+ @options[:link_class] && !@options[:link_class].empty?
+ end
+
def method_missing name, *args, &block
if block_given?
@options[name] = block