Commit e57baac0 authored by GitLab Bot's avatar GitLab Bot

Merge remote-tracking branch 'upstream/master' into ce-to-ee-2018-04-08

# Conflicts:
#	app/views/layouts/nav/sidebar/_project.html.haml
#	app/views/projects/_home_panel.html.haml

[ci skip]
parents 8deed29f 86ca1a77
...@@ -273,7 +273,11 @@ ...@@ -273,7 +273,11 @@
#{ _('Snippets') } #{ _('Snippets') }
- if project_nav_tab? :settings - if project_nav_tab? :settings
<<<<<<< HEAD
= nav_link(path: %w[projects#edit project_members#index integrations#show services#edit repository#show ci_cd#show badges#index pages#show audit_events#index]) do = nav_link(path: %w[projects#edit project_members#index integrations#show services#edit repository#show ci_cd#show badges#index pages#show audit_events#index]) do
=======
= nav_link(path: %w[projects#edit project_members#index integrations#show services#edit repository#show ci_cd#show badges#index pages#show]) do
>>>>>>> upstream/master
= link_to edit_project_path(@project), class: 'shortcuts-tree' do = link_to edit_project_path(@project), class: 'shortcuts-tree' do
.nav-icon-container .nav-icon-container
= sprite_icon('settings') = sprite_icon('settings')
...@@ -283,7 +287,11 @@ ...@@ -283,7 +287,11 @@
%ul.sidebar-sub-level-items %ul.sidebar-sub-level-items
- can_edit = can?(current_user, :admin_project, @project) - can_edit = can?(current_user, :admin_project, @project)
- if can_edit - if can_edit
<<<<<<< HEAD
= nav_link(path: %w[projects#edit project_members#index integrations#show services#edit repository#show ci_cd#show badges#index pages#show audit_events#index], html_options: { class: "fly-out-top-item" } ) do = nav_link(path: %w[projects#edit project_members#index integrations#show services#edit repository#show ci_cd#show badges#index pages#show audit_events#index], html_options: { class: "fly-out-top-item" } ) do
=======
= nav_link(path: %w[projects#edit project_members#index integrations#show services#edit repository#show ci_cd#show badges#index pages#show], html_options: { class: "fly-out-top-item" } ) do
>>>>>>> upstream/master
= link_to edit_project_path(@project) do = link_to edit_project_path(@project) do
%strong.fly-out-top-item-name %strong.fly-out-top-item-name
#{ _('Settings') } #{ _('Settings') }
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
- deleted_message = s_('ForkedFromProjectPath|Forked from %{project_name} (deleted)') - deleted_message = s_('ForkedFromProjectPath|Forked from %{project_name} (deleted)')
= deleted_message % { project_name: fork_source_name(@project) } = deleted_message % { project_name: fork_source_name(@project) }
<<<<<<< HEAD
- if @project.mirror? - if @project.mirror?
- import_url = @project.safe_import_url - import_url = @project.safe_import_url
%p %p
...@@ -30,6 +31,8 @@ ...@@ -30,6 +31,8 @@
%br %br
= render "shared/mirror_status" = render "shared/mirror_status"
=======
>>>>>>> upstream/master
.project-badges.prepend-top-default.append-bottom-default .project-badges.prepend-top-default.append-bottom-default
- @project.badges.each do |badge| - @project.badges.each do |badge|
%a.append-right-8{ href: badge.rendered_link_url(@project), %a.append-right-8{ href: badge.rendered_link_url(@project),
......
# Group badges API # Group badges API
> [Introduced](https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/17082)
in GitLab 10.6.
## Placeholder tokens ## Placeholder tokens
Badges support placeholders that will be replaced in real time in both the link and image URL. The allowed placeholders are: Badges support placeholders that will be replaced in real time in both the link and image URL. The allowed placeholders are:
...@@ -182,7 +185,7 @@ curl --header "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" https://gitlab.example.com/a ...@@ -182,7 +185,7 @@ curl --header "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" https://gitlab.example.com/a
Example response: Example response:
```json ```json
{ {
"link_url": "http://example.com/ci_status.svg?project=%{project_path}&ref=%{default_branch}", "link_url": "http://example.com/ci_status.svg?project=%{project_path}&ref=%{default_branch}",
"image_url": "https://shields.io/my/badge", "image_url": "https://shields.io/my/badge",
"rendered_link_url": "http://example.com/ci_status.svg?project=example-org/example-project&ref=master", "rendered_link_url": "http://example.com/ci_status.svg?project=example-org/example-project&ref=master",
......
# Project badges API # Project badges API
> [Introduced](https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/17082)
in GitLab 10.6.
## Placeholder tokens ## Placeholder tokens
Badges support placeholders that will be replaced in real time in both the link and image URL. The allowed placeholders are: Badges support placeholders that will be replaced in real time in both the link and image URL. The allowed placeholders are:
...@@ -179,7 +182,7 @@ curl --header "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" https://gitlab.example.com/a ...@@ -179,7 +182,7 @@ curl --header "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" https://gitlab.example.com/a
Example response: Example response:
```json ```json
{ {
"link_url": "http://example.com/ci_status.svg?project=%{project_path}&ref=%{default_branch}", "link_url": "http://example.com/ci_status.svg?project=%{project_path}&ref=%{default_branch}",
"image_url": "https://shields.io/my/badge", "image_url": "https://shields.io/my/badge",
"rendered_link_url": "http://example.com/ci_status.svg?project=example-org/example-project&ref=master", "rendered_link_url": "http://example.com/ci_status.svg?project=example-org/example-project&ref=master",
......
# Badges
> [Introduced](https://gitlab.com/gitlab-org/gitlab-ce/issues/41174)
in GitLab 10.7.
Badges are a unified way to present condensed pieces of information about your
projects. They consist of a small image and additionally a URL that the image
points to. Examples for badges can be the [pipeline status], [test coverage],
or ways to contact the project maintainers.
![Badges on Project overview page](img/project_overview_badges.png)
## Project badges
Badges can be added to a project and will then be visible on the project's overview page.
If you find that you have to add the same badges to several projects, you may want to add them at the [group level](#group-badges).
To add a new badge to a project:
1. Navigate to your project's **Settings > Badges**.
1. Under "Link", enter the URL that the badges should point to and under
"Badge image URL" the URL of the image that should be displayed.
1. Submit the badge by clicking the **Add badge** button.
After adding a badge to a project, you can see it in the list below the form.
You can edit it by clicking on the pen icon next to it or to delete it by
clicking on the trash icon.
Badges associated with a group can only be edited or deleted on the
[group level](#group-badges).
## Group badges
Badges can be added to a group and will then be visible on every project's
overview page that's under that group. In this case, they cannot be edited or
deleted on the project level. If you need to have individual badges for each
project, consider adding them on the [project level](#project-badges) or use
[placeholders](#placeholders).
To add a new badge to a group:
1. Navigate to your group's **Settings > Project Badges**.
1. Under "Link", enter the URL that the badges should point to and under
"Badge image URL" the URL of the image that should be displayed.
1. Submit the badge by clicking the **Add badge** button.
After adding a badge to a group, you can see it in the list below the form.
You can edit the badge by clicking on the pen icon next to it or to delete it
by clicking on the trash icon.
Badges directly associated with a project can be configured on the
[project level](#project-badges).
## Placeholders
The URL a badge points to, as well as the image URL, can contain placeholders
which will be evaluated when displaying the badge. The following placeholders
are available:
- `%{project_path}`: Path of a project including the parent groups
- `%{project_id}`: Database ID associated with a project
- `%{default_branch}`: Default branch name configured for a project's repository
- `%{commit_sha}`: ID of the most recent commit to the default branch of a
project's repository
## API
You can also configure badges via the GitLab API. As in the settings, there is
a distinction between endpoints for badges on the
[project level](../../api/project_badges.md) and [group level](../../api/group_badges.md).
[pipeline status]: pipelines/settings.md#pipeline-status-badge
[test coverage]: pipelines/settings.md#test-coverage-report-badge
...@@ -81,6 +81,7 @@ website with GitLab Pages ...@@ -81,6 +81,7 @@ website with GitLab Pages
- [Cycle Analytics](cycle_analytics.md): Review your development lifecycle - [Cycle Analytics](cycle_analytics.md): Review your development lifecycle
- [Syntax highlighting](highlighting.md): An alternative to customize - [Syntax highlighting](highlighting.md): An alternative to customize
your code blocks, overriding GitLab's default choice of language your code blocks, overriding GitLab's default choice of language
- [Badges](badges.md): Badges for the project overview
### Project's integrations ### Project's integrations
......
...@@ -106,7 +106,7 @@ If you want to auto-cancel all pending non-HEAD pipelines on branch, when ...@@ -106,7 +106,7 @@ If you want to auto-cancel all pending non-HEAD pipelines on branch, when
new pipeline will be created (after your git push or manually from UI), new pipeline will be created (after your git push or manually from UI),
check **Auto-cancel pending pipelines** checkbox and save the changes. check **Auto-cancel pending pipelines** checkbox and save the changes.
## Badges ## Pipeline Badges
In the pipelines settings page you can find pipeline status and test coverage In the pipelines settings page you can find pipeline status and test coverage
badges for your project. The latest successful pipeline will be used to read badges for your project. The latest successful pipeline will be used to read
......
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