badges_controller.rb 454 Bytes
Newer Older
1
class Projects::BadgesController < Projects::ApplicationController
2 3
  layout 'project_settings'
  before_action :authorize_admin_project!, only: [:index]
4 5
  before_action :no_cache_headers, except: [:index]

6
  def build
7
    badge = Gitlab::Badge::Build::Status.new(project, params[:ref])
8

9 10
    respond_to do |format|
      format.html { render_404 }
11

12
      format.svg do
13
        render 'badge', locals: { badge: badge.template }
14 15 16 17
      end
    end
  end
end