aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeddy Wing2018-01-25 11:57:30 +0100
committerZog2018-01-25 17:18:02 +0100
commita636969d6e588f0fb7d155bbc22582f742da8e48 (patch)
tree38964771ca4cf2bf0a416694de3277a086b33cc7
parent5fb1450194882c9d1169d3e1f64a24e54a5f1813 (diff)
downloadchouette-core-a636969d6e588f0fb7d155bbc22582f742da8e48.tar.bz2
AF83::Decorator::Link: Delete `#default_class`
This method was overriding classes that were added by `#add_class` in addition to those added by `#class`. Obviously, the argument to `#add_class` should be appended to the default. That seemed like a pain to do, so instead I'm getting rid of the concept of a default class. Instead, we're going to force all links to use the template-defined styles for now. That goes in line with Luc's desire to be more consistent in the links, as he stated yesterday. Refs #5586
-rw-r--r--app/decorators/import_decorator.rb1
-rw-r--r--app/decorators/network_decorator.rb1
-rw-r--r--app/decorators/routing_constraint_zone_decorator.rb1
-rw-r--r--app/views/layouts/navigation/_page_header.html.slim4
-rw-r--r--lib/af83/decorator/link.rb7
5 files changed, 2 insertions, 12 deletions
diff --git a/app/decorators/import_decorator.rb b/app/decorators/import_decorator.rb
index 58298b7a0..a9192e8f9 100644
--- a/app/decorators/import_decorator.rb
+++ b/app/decorators/import_decorator.rb
@@ -12,7 +12,6 @@ class ImportDecorator < AF83::Decorator
create_action_link do |l|
l.content t('imports.actions.new')
l.href { h.new_workbench_import_path(workbench_id: context[:workbench]) }
- l.class 'btn btn-primary'
end
with_instance_decorator do |instance_decorator|
diff --git a/app/decorators/network_decorator.rb b/app/decorators/network_decorator.rb
index cfa19dca5..90f0d0e82 100644
--- a/app/decorators/network_decorator.rb
+++ b/app/decorators/network_decorator.rb
@@ -9,7 +9,6 @@ class NetworkDecorator < AF83::Decorator
create_action_link do |l|
l.content t('networks.actions.new')
l.href { h.new_line_referential_network_path(context[:line_referential]) }
- l.class 'btn btn-primary'
end
with_instance_decorator do |instance_decorator|
diff --git a/app/decorators/routing_constraint_zone_decorator.rb b/app/decorators/routing_constraint_zone_decorator.rb
index 657065310..962625fa7 100644
--- a/app/decorators/routing_constraint_zone_decorator.rb
+++ b/app/decorators/routing_constraint_zone_decorator.rb
@@ -19,7 +19,6 @@ class RoutingConstraintZoneDecorator < AF83::Decorator
context[:line]
)
end
- l.class 'btn btn-primary'
end
with_instance_decorator do |instance_decorator|
diff --git a/app/views/layouts/navigation/_page_header.html.slim b/app/views/layouts/navigation/_page_header.html.slim
index cd4d41793..e407e53da 100644
--- a/app/views/layouts/navigation/_page_header.html.slim
+++ b/app/views/layouts/navigation/_page_header.html.slim
@@ -24,13 +24,13 @@
- if action_links&.primary&.any?
- action_links.primary.each do |link|
= link.to_html do |l|
- - l.default_class "btn btn-default #{l.disabled ? "disabled" : ""}"
+ - l.class "btn btn-default #{l.disabled ? "disabled" : ""}"
- if action_links&.secondary&.any?
.row.mb-sm
.col-lg-12.text-right
- action_links.secondary.each do |link|
= link.to_html do |l|
- - l.default_class "btn btn-primary #{l.disabled ? "disabled" : ""}"
+ - l.class "btn btn-primary #{l.disabled ? "disabled" : ""}"
- if content_for? :page_header_content
= yield :page_header_content
diff --git a/lib/af83/decorator/link.rb b/lib/af83/decorator/link.rb
index fd50069fe..55db3f5bb 100644
--- a/lib/af83/decorator/link.rb
+++ b/lib/af83/decorator/link.rb
@@ -25,13 +25,6 @@ class AF83::Decorator::Link
link_class args
end
- def default_class *args
- has_class = @options[:link_class] && !@options[:link_class].empty?
- return if has_class
-
- self.class args
- end
-
def method_missing name, *args, &block
if block_given?
@options[name] = block