gitlab-org--gitlab-foss/app/views/shared/projects/_project.html.haml
Jacob Schatz 146e905995 Merge branch 'add-delimiter-project-stats' into 'master'
Add delimiter to project stars and forks count

## What does this MR do?
Adds the `number_with_delimiter()`to the project stars and fork counts on the projects dashboard.

## Are there points in the code the reviewer needs to double check?
Shouldn't be any 😃  

## Why was this MR needed?
Improve readability and adhere to the [UI guide](https://gitlab.com/help/development/ui_guide.md#counts)

## What are the relevant issue numbers?
Closes #20746 

## Screenshots (if relevant)
Before:
![Screen_Shot_2016-08-09_at_1.30.44_PM](/uploads/69592ce220d64774e265cfbcfcb6864a/Screen_Shot_2016-08-09_at_1.30.44_PM.png)

After:
![Screen_Shot_2016-08-09_at_1.30.58_PM](/uploads/1470179256614c2e47cc9d0e49aeaf09/Screen_Shot_2016-08-09_at_1.30.58_PM.png)

## Does this MR meet the acceptance criteria?

- [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added
- Tests
  - [x] All builds are passing
- [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides)
- [x] Branch has no merge conflicts with `master` (if you do - rebase it please)
- [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)

See merge request !5741
2016-08-17 19:35:25 +00:00

53 lines
2.3 KiB
Text

- avatar = true unless local_assigns[:avatar] == false
- stars = true unless local_assigns[:stars] == false
- forks = false unless local_assigns[:forks] == true
- ci = false unless local_assigns[:ci] == true
- skip_namespace = false unless local_assigns[:skip_namespace] == true
- css_class = '' unless local_assigns[:css_class]
- show_last_commit_as_description = false unless local_assigns[:show_last_commit_as_description] == true && project.commit
- css_class += " no-description" if project.description.blank? && !show_last_commit_as_description
- cache_key = [project.namespace, project, controller.controller_name, controller.action_name, current_application_settings, 'v2.3']
- cache_key.push(project.commit.status) if project.commit.try(:status)
%li.project-row{ class: css_class }
= cache(cache_key) do
.controls
- if project.archived
%span.label.label-warning archived
- if project.commit.try(:status)
%span
= render_commit_status(project.commit)
- if forks
%span
= icon('code-fork')
= number_with_delimiter(project.forks_count)
- if stars
%span
= icon('star')
= number_with_delimiter(project.star_count)
%span.visibility-icon.has-tooltip{data: { container: 'body', placement: 'left' }, title: visibility_icon_description(project)}
= visibility_level_icon(project.visibility_level, fw: true)
.title
= link_to project_path(project), class: dom_class(project) do
- if avatar
.dash-project-avatar
- if use_creator_avatar
= image_tag avatar_icon(project.creator.email, 40), class: "avatar s40", alt:''
- else
= project_icon(project, alt: '', class: 'avatar project-avatar s40')
%span.project-full-name
%span.namespace-name
- if project.namespace && !skip_namespace
= project.namespace.human_name
\/
%span.project-name.filter-title
= project.name
- if show_last_commit_as_description
.description
= link_to_gfm project.commit.title, namespace_project_commit_path(project.namespace, project, project.commit),
class: "commit-row-message"
- elsif project.description.present?
.description
= markdown(project.description, pipeline: :description)