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
end
def build
badge = Gitlab::Badge::Build.new(project, params[:ref])
......
- page_title 'Badges'
.prepend-top-10
.panel.panel-default
.panel-heading
%b Builds badge &middot;
= image_tag(build_namespace_project_badges_path(@project.namespace, @project, :master, format: :svg), alt: 'Builds badge')
.panel-body
%table.table
%tr
%td Markdown
%td= markdown("```markdown\n[![build status](url)](link)\n```")
%tr
%td HTML
%td= markdown("```html\n<a href='link'><img src='url' /></a>\n```")
......@@ -57,6 +57,9 @@
%li.missing
= link_to add_contribution_guide_path(@project) do
Add Contribution guide
- if @project.builds_enabled?
%li
= link_to 'Badges', ''
- if @repository.commit
.content-block.second-block.white
......
......@@ -749,7 +749,7 @@ Rails.application.routes.draw do
end
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
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