Commit 50fb21a5 authored by Natalia Tepluhina's avatar Natalia Tepluhina

Merge branch '292972-refactor-disabled-buttons-with-tooltips' into 'master'

Set tooltip for disabled buttons in a wrapper

See merge request gitlab-org/gitlab!52016
parents 2a4372ae 3d7f0959
...@@ -77,8 +77,9 @@ ...@@ -77,8 +77,9 @@
= link_to resume_group_runner_path(@group, runner), method: :post, class: 'btn btn-default has-tooltip', title: _('Resume'), ref: 'tooltip', aria: { label: _('Resume') }, data: { placement: 'top', container: 'body'} do = link_to resume_group_runner_path(@group, runner), method: :post, class: 'btn btn-default has-tooltip', title: _('Resume'), ref: 'tooltip', aria: { label: _('Resume') }, data: { placement: 'top', container: 'body'} do
= sprite_icon('play') = sprite_icon('play')
- if runner.belongs_to_more_than_one_project? - if runner.belongs_to_more_than_one_project?
.btn-group - delete_runner_tooltip = _('Multi-project Runners cannot be removed')
.btn.btn-danger.has-tooltip{ 'aria-label' => 'Remove', 'data-container' => 'body', 'data-original-title' => _('Multi-project Runners cannot be removed'), 'data-placement' => 'top', disabled: 'disabled' } .btn-group.has-tooltip{ data: { container: 'body', placement: 'top' }, title: delete_runner_tooltip }
.btn.btn-danger{ 'aria-label' => delete_runner_tooltip, disabled: 'disabled' }
= sprite_icon('close') = sprite_icon('close')
- else - else
.btn-group .btn-group
......
...@@ -50,9 +50,9 @@ ...@@ -50,9 +50,9 @@
- if can?(current_user, :push_code, @project) - if can?(current_user, :push_code, @project)
- if branch.name == @project.repository.root_ref - if branch.name == @project.repository.root_ref
%button{ class: "gl-button btn btn-danger remove-row has-tooltip disabled", - delete_default_branch_tooltip = s_('Branches|The default branch cannot be deleted')
disabled: true, %span.has-tooltip{ title: delete_default_branch_tooltip }
title: s_('Branches|The default branch cannot be deleted') } %button{ class: "gl-button btn btn-danger remove-row disabled", disabled: true, 'aria-label' => delete_default_branch_tooltip }
= sprite_icon("remove") = sprite_icon("remove")
- elsif protected_branch?(@project, branch) - elsif protected_branch?(@project, branch)
- if can?(current_user, :push_to_delete_protected_branch, @project) - if can?(current_user, :push_to_delete_protected_branch, @project)
...@@ -65,9 +65,9 @@ ...@@ -65,9 +65,9 @@
is_merged: ("true" if merged) } } is_merged: ("true" if merged) } }
= sprite_icon("remove") = sprite_icon("remove")
- else - else
%button{ class: "gl-button btn btn-danger remove-row has-tooltip disabled", - delete_protected_branch_tooltip = s_('Branches|Only a project maintainer or owner can delete a protected branch')
disabled: true, %span.has-tooltip{ title: delete_protected_branch_tooltip }
title: s_('Branches|Only a project maintainer or owner can delete a protected branch') } %button{ class: "gl-button btn btn-danger remove-row disabled", disabled: true, 'aria-label' => delete_protected_branch_tooltip }
= sprite_icon("remove") = sprite_icon("remove")
- else - else
= link_to project_branch_path(@project, branch.name), = link_to project_branch_path(@project, branch.name),
......
...@@ -7,9 +7,9 @@ ...@@ -7,9 +7,9 @@
%span= s_('ProjectOverview|Fork') %span= s_('ProjectOverview|Fork')
- else - else
- can_create_fork = current_user.can?(:create_fork) - can_create_fork = current_user.can?(:create_fork)
= link_to new_project_fork_path(@project), - disabled_fork_tooltip = s_('ProjectOverview|You have reached your project limit')
class: "btn btn-default btn-xs has-tooltip count-badge-button d-flex align-items-center fork-btn #{'has-tooltip disabled' unless can_create_fork}", %span.has-tooltip{ title: (disabled_fork_tooltip unless can_create_fork) }
title: (s_('ProjectOverview|You have reached your project limit') unless can_create_fork) do = link_to new_project_fork_path(@project), class: "btn btn-default btn-xs count-badge-button d-flex align-items-center fork-btn #{' disabled' unless can_create_fork }", 'aria-label' => (disabled_fork_tooltip unless can_create_fork) do
= sprite_icon('fork', css_class: 'icon') = sprite_icon('fork', css_class: 'icon')
%span= s_('ProjectOverview|Fork') %span= s_('ProjectOverview|Fork')
%span.fork-count.count-badge-count.d-flex.align-items-center %span.fork-count.count-badge-count.d-flex.align-items-center
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment