# Class IssuesController < ProjectResourceController

- app/controllers/issues_controller.rb

Methods

A
  - authorize_admin_issue!,
  - authorize_modify_issue!
B
  - bulk_update
C
  - create
E
  - edit
I
  - index,
  - issue,
  - issues_filtered
M
  - module_enabled
N
  - new
S
  - search,
  - show,
  - sort
U
  - update

Instance Public methods
bulk_update() Link

Source: show

    # File app/controllers/issues_controller.rb, line 99
    def bulk_update
      result = IssuesBulkUpdateContext.new(project, current_user, params).execute
      redirect_to :back, notice: "#{result[:count]} issues updated"
    end

create() Link

Source: show

    # File app/controllers/issues_controller.rb, line 45
    def create
      @issue = @project.issues.new(params[:issue])
      @issue.author = current_user
      @issue.save

      respond_to do |format|
        format.html do
          if @issue.valid?
            redirect_to project_issue_path(@project, @issue)
          else
            render :new
          end
        end
        format.js
      end
    end

edit() Link

Source: show

    # File app/controllers/issues_controller.rb, line 32
    def edit
      respond_with(@issue)
    end

index() Link

Source: show

    # File app/controllers/issues_controller.rb, line 16
    def index
      @issues = issues_filtered
      @issues = @issues.page(params[:page]).per(20)

      respond_to do |format|
        format.html # index.html.erb
        format.js
        format.atom { render layout: false }
      end
    end

new() Link

Source: show

    # File app/controllers/issues_controller.rb, line 27
    def new
      @issue = @project.issues.new(params[:issue])
      respond_with(@issue)
    end

search() Link

Source: show

    # File app/controllers/issues_controller.rb, line 89
    def search
      terms = params['terms']

      @issues = issues_filtered
      @issues = @issues.where("title LIKE ?", "%#{terms}%") unless terms.blank?
      @issues = @issues.page(params[:page]).per(100)

      render partial: 'issues'
    end

show() Link

Source: show

    # File app/controllers/issues_controller.rb, line 36
    def show
      @note = @project.notes.new(noteable: @issue)

      respond_to do |format|
        format.html
        format.js
      end
    end

sort() Link

Source: show

    # File app/controllers/issues_controller.rb, line 77
    def sort
      return render_404 unless can?(current_user, :admin_issue, @project)

      @issues = @project.issues.where(id: params['issue'])
      @issues.each do |issue|
        issue.position = params['issue'].index(issue.id.to_s) + 1
        issue.save
      end

      render nothing: true
    end

update() Link

Source: show

    # File app/controllers/issues_controller.rb, line 62
    def update
      @issue.update_attributes(params[:issue].merge(author_id_of_changes: current_user.id))

      respond_to do |format|
        format.js
        format.html do
          if @issue.valid?
            redirect_to [@project, @issue]
          else
            render :edit
          end
        end
      end
    end

Instance Protected methods
authorize_admin_issue!() Link

Source: show

    # File app/controllers/issues_controller.rb, line 114
    def authorize_admin_issue!
      return render_404 unless can?(current_user, :admin_issue, @issue)
    end

authorize_modify_issue!() Link

Source: show

    # File app/controllers/issues_controller.rb, line 110
    def authorize_modify_issue!
      return render_404 unless can?(current_user, :modify_issue, @issue)
    end

issue() Link

Source: show

    # File app/controllers/issues_controller.rb, line 106
    def issue
      @issue ||= @project.issues.find(params[:id])
    end

issues_filtered() Link

Source: show

    # File app/controllers/issues_controller.rb, line 122
    def issues_filtered
      @issues = IssuesListContext.new(project, current_user, params).execute
    end

module_enabled() Link

Source: show

    # File app/controllers/issues_controller.rb, line 118
    def module_enabled
      return render_404 unless @project.issues_enabled
    end