Commit 88fc7ccd authored by Grzegorz Bizon's avatar Grzegorz Bizon

Add project badges view prototype

parent ea690378
class Projects::BadgesController < Projects::ApplicationController
before_action :no_cache_headers
before_action :no_cache_headers, except: [:index]
def index
def build
badge =, params[:ref])
- page_title 'Badges'
%b Builds badge &middot;
= image_tag(build_namespace_project_badges_path(@project.namespace, @project, :master, format: :svg), alt: 'Builds badge')
%td Markdown
%td= markdown("```markdown\n[![build status](url)](link)\n```")
%td HTML
%td= markdown("```html\n<a href='link'><img src='url' /></a>\n```")
......@@ -57,6 +57,9 @@
= link_to add_contribution_guide_path(@project) do
Add Contribution guide
- if @project.builds_enabled?
= link_to 'Badges', ''
- if @repository.commit
......@@ -749,7 +749,7 @@ Rails.application.routes.draw do
resources :runner_projects, only: [:create, :destroy]
resources :badges, only: [] do
resources :badges, only: [:index] do
collection do
scope '*ref', constraints: { ref: Gitlab::Regex.git_reference_regex } do
get :build, constraints: { format: /svg/ }
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment