summaryrefslogtreecommitdiff
path: root/app/controllers/public/projects_controller.rb
blob: d7297161c22963cc67aab97c52ecd0a93d7e5231 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
class Public::ProjectsController < ApplicationController
  skip_before_filter :authenticate_user!,
                     :reject_blocked, :set_current_user_for_observers,
                     :add_abilities

  layout 'public'

  def index
    @projects = Project.public_or_internal_only(current_user)
    @projects = @projects.search(params[:search]) if params[:search].present?
    @projects = @projects.sort(@sort = params[:sort])
    @projects = @projects.includes(:namespace).page(params[:page]).per(20)
  end
end