labels_controller.rb 456 Bytes
Newer Older
1
class Projects::LabelsController < Projects::ApplicationController
randx's avatar
randx committed
2 3 4 5 6 7 8 9
  before_filter :module_enabled

  # Allow read any issue
  before_filter :authorize_read_issue!

  respond_to :js, :html

  def index
10
    @labels = @project.issues_labels
randx's avatar
randx committed
11 12
  end

13
  def generate
14
    Gitlab::IssuesLabels.generate(@project)
15

16
    redirect_to project_issues_path(@project)
17 18
  end

randx's avatar
randx committed
19 20 21 22 23 24
  protected

  def module_enabled
    return render_404 unless @project.issues_enabled
  end
end