diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-08-19 15:11:58 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-08-19 15:11:58 +0000 |
commit | 4c083c816333ef903fe7c32f412eaa53d7b959d3 (patch) | |
tree | 199c0a0034a2620374a92a47762bf4a4c07be7ca /app/components | |
parent | 35d5ae4e3de6444c02725b965ef59774d6256d8e (diff) | |
download | gitlab-ce-4c083c816333ef903fe7c32f412eaa53d7b959d3.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/components')
-rw-r--r-- | app/components/layouts/horizontal_section_component.haml | 10 | ||||
-rw-r--r-- | app/components/layouts/horizontal_section_component.rb | 22 | ||||
-rw-r--r-- | app/components/pajamas/button_component.rb | 2 |
3 files changed, 33 insertions, 1 deletions
diff --git a/app/components/layouts/horizontal_section_component.haml b/app/components/layouts/horizontal_section_component.haml new file mode 100644 index 00000000000..4b5b4f1d0df --- /dev/null +++ b/app/components/layouts/horizontal_section_component.haml @@ -0,0 +1,10 @@ +%div{ formatted_options } + .row + .col-lg-4 + %h4.gl-mt-0 + = title + - if description? + %p + = description + .col-lg-8 + = body diff --git a/app/components/layouts/horizontal_section_component.rb b/app/components/layouts/horizontal_section_component.rb new file mode 100644 index 00000000000..48c960f17d9 --- /dev/null +++ b/app/components/layouts/horizontal_section_component.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +module Layouts + class HorizontalSectionComponent < ViewComponent::Base + # @param [Boolean] border + # @param [Hash] options + def initialize(border: true, options: {}) + @border = border + @options = options + end + + private + + renders_one :title + renders_one :description + renders_one :body + + def formatted_options + @options.merge({ class: [('gl-border-b' if @border), @options[:class]].flatten.compact }) + end + end +end diff --git a/app/components/pajamas/button_component.rb b/app/components/pajamas/button_component.rb index 4233e446d5b..b2dd798b718 100644 --- a/app/components/pajamas/button_component.rb +++ b/app/components/pajamas/button_component.rb @@ -112,7 +112,7 @@ module Pajamas def base_attributes attributes = {} - attributes['disabled'] = '' if @disabled || @loading + attributes['disabled'] = 'disabled' if @disabled || @loading attributes['aria-disabled'] = true if @disabled || @loading attributes['type'] = @type unless @href |