summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnnabel Dunstone <annabel.dunstone@gmail.com>2016-05-04 16:25:10 -0500
committerAnnabel Dunstone <annabel.dunstone@gmail.com>2016-05-04 17:07:47 -0500
commit8d19955c05f18675fc16dee6ca0f4da24013e816 (patch)
treef4a132c7d4ff458d307b96c786dd7cebf909997d
parent3a3f0bf436007b3eecc0b85d0fc696951245ab6a (diff)
downloadgitlab-ce-8d19955c05f18675fc16dee6ca0f4da24013e816.tar.gz
Revert counter parentheses back to badges15179-builds-redesign
-rw-r--r--app/helpers/application_helper.rb3
-rw-r--r--app/views/dashboard/snippets/index.html.haml16
-rw-r--r--app/views/dashboard/todos/index.html.haml8
-rw-r--r--app/views/projects/builds/index.html.haml12
-rw-r--r--app/views/projects/commit/_ci_menu.html.haml4
-rw-r--r--app/views/projects/commits/_head.html.haml10
-rw-r--r--app/views/projects/merge_requests/_show.html.haml12
-rw-r--r--app/views/shared/milestones/_top.html.haml2
-rw-r--r--features/project/merge_requests.feature8
-rw-r--r--features/steps/dashboard/todos.rb8
-rw-r--r--features/steps/project/merge_requests.rb10
-rw-r--r--spec/features/notes_on_merge_requests_spec.rb2
12 files changed, 45 insertions, 50 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index 313a8fd56c5..3e0074da394 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -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
diff --git a/app/views/dashboard/snippets/index.html.haml b/app/views/dashboard/snippets/index.html.haml
index 53f1094ec07..d4e7862981c 100644
--- a/app/views/dashboard/snippets/index.html.haml
+++ b/app/views/dashboard/snippets/index.html.haml
@@ -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'
diff --git a/app/views/dashboard/todos/index.html.haml b/app/views/dashboard/todos/index.html.haml
index a87b796c6f3..fc42e5dcc66 100644
--- a/app/views/dashboard/todos/index.html.haml
+++ b/app/views/dashboard/todos/index.html.haml
@@ -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?)
diff --git a/app/views/projects/builds/index.html.haml b/app/views/projects/builds/index.html.haml
index fcb1e656d72..2e8015d119b 100644
--- a/app/views/projects/builds/index.html.haml
+++ b/app/views/projects/builds/index.html.haml
@@ -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)
diff --git a/app/views/projects/commit/_ci_menu.html.haml b/app/views/projects/commit/_ci_menu.html.haml
index b2d3db0bdc6..ea33aa472a6 100644
--- a/app/views/projects/commit/_ci_menu.html.haml
+++ b/app/views/projects/commit/_ci_menu.html.haml
@@ -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
diff --git a/app/views/projects/commits/_head.html.haml b/app/views/projects/commits/_head.html.haml
index 2c8fecae760..d1bd76ab529 100644
--- a/app/views/projects/commits/_head.html.haml
+++ b/app/views/projects/commits/_head.html.haml
@@ -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
diff --git a/app/views/projects/merge_requests/_show.html.haml b/app/views/projects/merge_requests/_show.html.haml
index 0c97a29847d..290753d57c6 100644
--- a/app/views/projects/merge_requests/_show.html.haml
+++ b/app/views/projects/merge_requests/_show.html.haml
@@ -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
diff --git a/app/views/shared/milestones/_top.html.haml b/app/views/shared/milestones/_top.html.haml
index 8bca971bcf2..7ff947a51db 100644
--- a/app/views/shared/milestones/_top.html.haml
+++ b/app/views/shared/milestones/_top.html.haml
@@ -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
diff --git a/features/project/merge_requests.feature b/features/project/merge_requests.feature
index aec590f7d9e..ecda4ea8240 100644
--- a/features/project/merge_requests.feature
+++ b/features/project/merge_requests.feature
@@ -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
diff --git a/features/steps/dashboard/todos.rb b/features/steps/dashboard/todos.rb
index da380250cd7..2b23df6764b 100644
--- a/features/steps/dashboard/todos.rb
+++ b/features/steps/dashboard/todos.rb
@@ -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
diff --git a/features/steps/project/merge_requests.rb b/features/steps/project/merge_requests.rb
index 463235742fb..3b1a00f628a 100644
--- a/features/steps/project/merge_requests.rb
+++ b/features/steps/project/merge_requests.rb
@@ -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
diff --git a/spec/features/notes_on_merge_requests_spec.rb b/spec/features/notes_on_merge_requests_spec.rb
index 0aef4cba238..389812ff7e1 100644
--- a/spec/features/notes_on_merge_requests_spec.rb
+++ b/spec/features/notes_on_merge_requests_spec.rb
@@ -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