diff --git a/app/assets/stylesheets/framework/wells.scss b/app/assets/stylesheets/framework/wells.scss index d550a1faa181b2c70369930501ad685fa7119f0f..b796f04750b150ff74d61131f0ff76778a9d754b 100644 --- a/app/assets/stylesheets/framework/wells.scss +++ b/app/assets/stylesheets/framework/wells.scss @@ -65,33 +65,6 @@ display: inline; } - .branch-link { - margin-bottom: 2px; - } - - .limit-box { - cursor: pointer; - display: inline-flex; - align-items: center; - background-color: $red-100; - border-radius: $border-radius-default; - text-align: center; - - &:hover { - background-color: $red-200; - } - - .limit-icon { - margin: 0 4px; - } - - .limit-message { - line-height: 16px; - margin-right: 8px; - font-size: 12px; - } - } - svg { vertical-align: text-top; } diff --git a/app/helpers/commits_helper.rb b/app/helpers/commits_helper.rb index ee5f4bb364aa1126faf96d8bb7cb91d49b5885ff..4256a24bc161dfe55c033781a649751339595ac7 100644 --- a/app/helpers/commits_helper.rb +++ b/app/helpers/commits_helper.rb @@ -73,9 +73,7 @@ def commit_default_branch(project, branches) # Returns a link formatted as a commit branch link def commit_branch_link(url, text) - link_to(url, class: 'badge badge-gray ref-name branch-link') do - sprite_icon('branch', size: 12, css_class: 'fork-svg') + "#{text}" - end + gl_badge_tag(text, { variant: :info, icon: 'branch' }, { href: url, class: 'gl-font-monospace gl-mb-1' }) end # Returns the sorted alphabetically links to branches, separated by a comma @@ -87,9 +85,7 @@ def commit_branches_links(project, branches) # Returns a link formatted as a commit tag link def commit_tag_link(url, text) - link_to(url, class: 'badge badge-gray ref-name') do - sprite_icon('tag', size: 12, css_class: 'gl-mr-2 vertical-align-middle') + "#{text}" - end + gl_badge_tag(text, { variant: :info, icon: 'tag' }, { href: url, class: 'gl-font-monospace' }) end # Returns the sorted links to tags, separated by a comma diff --git a/app/views/projects/commit/_limit_exceeded_message.html.haml b/app/views/projects/commit/_limit_exceeded_message.html.haml index 236418ecd0ef95b1bac28a4215389e6a5cfd0398..444e7d209f1d2159ab66861a43c859f155b97205 100644 --- a/app/views/projects/commit/_limit_exceeded_message.html.haml +++ b/app/views/projects/commit/_limit_exceeded_message.html.haml @@ -1,8 +1,5 @@ -.has-tooltip{ class: "limit-box limit-box-#{objects} gl-ml-2", data: { title: _('Project has too many %{label_for_message} to search') % { label_for_message: label_for_message } } } - .limit-icon - - if objects == :branch - = sprite_icon('fork', size: 12) - - else - = sprite_icon('tag') - .limit-message - %span= _('%{label_for_message} unavailable') % { label_for_message: label_for_message.capitalize } +- icon = objects == :branch ? 'fork' : 'tag' +- text = _('%{label_for_message} unavailable') % { label_for_message: label_for_message.capitalize } +- tooltip_title = _('Project has too many %{label_for_message} to search') % { label_for_message: label_for_message } + += gl_badge_tag(text, { variant: :danger, icon: icon }, { class: 'has-tooltip gl-ml-2', data: { title: tooltip_title } }) diff --git a/app/views/projects/commit/branches.html.haml b/app/views/projects/commit/branches.html.haml index 0b8e5105bc003380f5fd7588c50b097eaf9eace3..d08ace98408d49b497a36746cef9f72b32257e11 100644 --- a/app/views/projects/commit/branches.html.haml +++ b/app/views/projects/commit/branches.html.haml @@ -6,8 +6,9 @@ - if @branches.any? || @tags.any? || @tags_limit_exceeded %span - = link_to "#", class: "js-details-expand badge badge-gray ref-name" do - = sprite_icon('ellipsis_h', size: 12, css_class: 'vertical-align-middle') + = gl_badge_tag(_("Expand"), + { variant: :info, icon: 'ellipsis_h', icon_only: true }, + { href: '#', class: 'js-details-expand gl-font-monospace' }) %span.js-details-content.hide = commit_branches_links(@project, @branches) - if @tags_limit_exceeded