Commit 8d19955c authored by Annabel Dunstone's avatar Annabel Dunstone

Revert counter parentheses back to badges

parent 3a3f0bf4
......@@ -316,7 +316,8 @@ module ApplicationHelper
html = content_tag :span, entity_title
if count.present?
html += content_tag :span, " (#{number_with_delimiter(count)})"
html += " "
html += content_tag :span, number_with_delimiter(count), class: 'badge'
end
html.html_safe
......
......@@ -13,26 +13,26 @@
%li{ class: ("active" unless params[:scope]) }
= link_to dashboard_snippets_path do
All
%span
(#{current_user.snippets.count})
%span.badge
= current_user.snippets.count
%li{ class: ("active" if params[:scope] == "are_private") }
= link_to dashboard_snippets_path(scope: 'are_private') do
Private
%span
(#{current_user.snippets.are_private.count})
%span.badge
= current_user.snippets.are_private.count
%li{ class: ("active" if params[:scope] == "are_internal") }
= link_to dashboard_snippets_path(scope: 'are_internal') do
Internal
%span
(#{current_user.snippets.are_internal.count})
%span.badge
= current_user.snippets.are_internal.count
%li{ class: ("active" if params[:scope] == "are_public") }
= link_to dashboard_snippets_path(scope: 'are_public') do
Public
%span
(#{current_user.snippets.are_public.count})
%span.badge
= current_user.snippets.are_public.count
= render 'snippets/snippets'
......@@ -8,15 +8,15 @@
= link_to todos_filter_path(state: 'pending') do
%span
To do
%span
(#{todos_pending_count})
%span.badge
= todos_pending_count
- todo_done_active = ('active' if params[:state] == 'done')
%li{class: "todos-done #{todo_done_active}"}
= link_to todos_filter_path(state: 'done') do
%span
Done
%span
(#{todos_done_count})
%span.badge
= todos_done_count
.nav-controls
- if @todos.any?(&:pending?)
......
......@@ -6,21 +6,21 @@
%li{class: ('active' if @scope.nil?)}
= link_to project_builds_path(@project) do
All
%span.js-totalbuilds-count
(#{number_with_delimiter(@all_builds.count(:id))})
%span.badge.js-totalbuilds-count
= number_with_delimiter(@all_builds.count(:id))
%li{class: ('active' if @scope == 'running')}
= link_to project_builds_path(@project, scope: :running) do
Running
%span.js-running-count
(#{number_with_delimiter(@all_builds.running_or_pending.count(:id))})
%span.badge.js-running-count
= number_with_delimiter(@all_builds.running_or_pending.count(:id))
%li{class: ('active' if @scope == 'finished')}
= link_to project_builds_path(@project, scope: :finished) do
Finished
%span.js-running-count
(#{number_with_delimiter(@all_builds.finished.count(:id))})
%span.badge.js-running-count
= number_with_delimiter(@all_builds.finished.count(:id))
.nav-controls
- if can?(current_user, :update_build, @project)
......
......@@ -2,8 +2,8 @@
= nav_link(path: 'commit#show') do
= link_to namespace_project_commit_path(@project.namespace, @project, @commit.id) do
Changes
%span (#{@diffs.count})
%span.badge= @diffs.count
= nav_link(path: 'commit#builds') do
= link_to builds_namespace_project_commit_path(@project.namespace, @project, @commit.id) do
Builds
%span (#{@statuses.count})
%span.badge= @statuses.count
......@@ -2,8 +2,8 @@
= nav_link(controller: [:commit, :commits]) do
= link_to namespace_project_commits_path(@project.namespace, @project, current_ref) do
Commits
%span
(#{number_with_delimiter(@repository.commit_count)})
%span.badge
= number_with_delimiter(@repository.commit_count)
= nav_link(controller: %w(network)) do
= link_to namespace_project_network_path(@project.namespace, @project, current_ref) do
......@@ -16,11 +16,9 @@
= nav_link(html_options: {class: branches_tab_class}) do
= link_to namespace_project_branches_path(@project.namespace, @project) do
Branches
%span.js-totalbranch-count
(#{@repository.branch_count})
%span.badge.js-totalbranch-count= @repository.branch_count
= nav_link(controller: [:tags, :releases]) do
= link_to namespace_project_tags_path(@project.namespace, @project) do
Tags
%span.js-totaltags-count
(#{@repository.tag_count})
%span.badge.js-totaltags-count= @repository.tag_count
......@@ -50,24 +50,20 @@
%li.notes-tab
= link_to namespace_project_merge_request_path(@project.namespace, @project, @merge_request), data: {target: 'div#notes', action: 'notes', toggle: 'tab'} do
Discussion
%span
(#{@merge_request.mr_and_commit_notes.user.nonawards.count})
%span.badge= @merge_request.mr_and_commit_notes.user.nonawards.count
%li.commits-tab
= link_to commits_namespace_project_merge_request_path(@project.namespace, @project, @merge_request), data: {target: 'div#commits', action: 'commits', toggle: 'tab'} do
Commits
%span
(#{@commits.size})
%span.badge= @commits.size
- if @ci_commit
%li.builds-tab
= link_to builds_namespace_project_merge_request_path(@project.namespace, @project, @merge_request), data: {target: '#builds', action: 'builds', toggle: 'tab'} do
Builds
%span
(#{@statuses.size})
%span.badge= @statuses.size
%li.diffs-tab
= link_to diffs_namespace_project_merge_request_path(@project.namespace, @project, @merge_request), data: {target: 'div#diffs', action: 'diffs', toggle: 'tab'} do
Changes
%span
(#{@merge_request.diff_size})
%span.badge= @merge_request.diff_size
.tab-content
#notes.notes.tab-pane.voting_notes
......
......@@ -24,7 +24,7 @@
- else
= link_to 'Reopen Milestone', group_milestone_path(group, milestone.safe_title, title: milestone.title, milestone: {state_event: :activate }), method: :put, class: "btn btn-grouped btn-reopen"
.detail-page-description.milestone-detailrow-content-block.second-block
.detail-page-description.milestone-detail
%h2.title
= markdown escape_once(milestone.title), pipeline: :single_line
......
......@@ -135,7 +135,7 @@ Feature: Project Merge Requests
And I leave a comment like "Line is wrong" on diff
And I switch to the merge request's comments tab
Then I should see a discussion has started on diff
And I should see a badge of "(1)" next to the discussion link
And I should see a badge of "1" next to the discussion link
@javascript
Scenario: I see a new comment on merge request diff from another user in the discussion tab
......@@ -143,7 +143,7 @@ Feature: Project Merge Requests
And I visit merge request page "Bug NS-05"
And user "John Doe" leaves a comment like "Line is wrong" on diff
Then I should see a discussion by user "John Doe" has started on diff
And I should see a badge of "(1)" next to the discussion link
And I should see a badge of "1" next to the discussion link
@javascript
Scenario: I edit a comment on a merge request diff
......@@ -161,11 +161,11 @@ Feature: Project Merge Requests
And I visit merge request page "Bug NS-05"
And I click on the Changes tab
And I leave a comment like "Line is wrong" on diff
And I should see a badge of "(1)" next to the discussion link
And I should see a badge of "1" next to the discussion link
And I delete the comment "Line is wrong" on diff
And I click on the Discussion tab
Then I should not see any discussion
And I should see a badge of "(0)" next to the discussion link
And I should see a badge of "0" next to the discussion link
@javascript
Scenario: I comment on a line of a commit in merge request
......
......@@ -27,8 +27,8 @@ class Spinach::Features::DashboardTodos < Spinach::FeatureSteps
step 'I should see todos assigned to me' do
page.within('.nav-sidebar') { expect(page).to have_content 'Todos 4' }
expect(page).to have_content 'To do (4)'
expect(page).to have_content 'Done (0)'
expect(page).to have_content 'To do 4'
expect(page).to have_content 'Done 0'
expect(page).to have_link project.name_with_namespace
should_see_todo(1, "John Doe assigned you merge request #{merge_request.to_reference}", merge_request.title)
......@@ -43,8 +43,8 @@ class Spinach::Features::DashboardTodos < Spinach::FeatureSteps
end
page.within('.nav-sidebar') { expect(page).to have_content 'Todos 3' }
expect(page).to have_content 'To do (3)'
expect(page).to have_content 'Done (1)'
expect(page).to have_content 'To do 3'
expect(page).to have_content 'Done 1'
should_not_see_todo "John Doe assigned you merge request #{merge_request.to_reference}"
end
......
......@@ -344,12 +344,12 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps
end
end
step 'I should see a badge of "(1)" next to the discussion link' do
expect_discussion_badge_to_have_counter("(1)")
step 'I should see a badge of "1" next to the discussion link' do
expect_discussion_badge_to_have_counter("1")
end
step 'I should see a badge of "(0)" next to the discussion link' do
expect_discussion_badge_to_have_counter("(0)")
step 'I should see a badge of "0" next to the discussion link' do
expect_discussion_badge_to_have_counter("0")
end
step 'I should see a discussion has started on commit diff' do
......@@ -572,7 +572,7 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps
end
def expect_discussion_badge_to_have_counter(value)
page.within(".notes-tab span") do
page.within(".notes-tab .badge") do
page.should have_content value
end
end
......
......@@ -151,7 +151,7 @@ describe 'Comments', feature: true do
visit namespace_project_merge_request_path(project.namespace, project, merge_request)
expect(merge_request.mr_and_commit_notes.count).to eq 2
expect(find('.notes-tab span').text).to eq "(1)"
expect(find('.notes-tab span.badge').text).to eq "1"
end
end
end
......
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