starrers_controller.rb 501 字节
Newer Older
C
Camil Staps 已提交
1 2 3 4
# frozen_string_literal: true

class Projects::StarrersController < Projects::ApplicationController
  include SortingHelper
5

C
Camil Staps 已提交
6 7 8
  def index
    @sort = params[:sort].presence || sort_value_name

C
Camil Staps 已提交
9
    @starrers = UsersStarProjectsFinder.new(@project, params, current_user: @current_user).execute
10 11 12 13

    @total_count = @project.starrers.size
    @public_count = @starrers.size
    @private_count = @total_count - @public_count
14 15

    @starrers = @starrers.sort_by_attribute(@sort).page(params[:page])
C
Camil Staps 已提交
16 17
  end
end