2014-07-23 09:03:49 +00:00
|
|
|
class Explore::ProjectsController < ApplicationController
|
|
|
|
skip_before_filter :authenticate_user!,
|
2014-10-19 08:50:23 +00:00
|
|
|
:reject_blocked
|
2014-07-23 09:03:49 +00:00
|
|
|
|
|
|
|
layout 'explore'
|
|
|
|
|
|
|
|
def index
|
|
|
|
@projects = ProjectsFinder.new.execute(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
|
|
|
|
|
|
|
|
def trending
|
|
|
|
@trending_projects = TrendingProjectsFinder.new.execute(current_user)
|
|
|
|
@trending_projects = @trending_projects.page(params[:page]).per(10)
|
|
|
|
end
|
2014-07-25 19:05:23 +00:00
|
|
|
|
|
|
|
def starred
|
|
|
|
@starred_projects = ProjectsFinder.new.execute(current_user)
|
|
|
|
@starred_projects = @starred_projects.order('star_count DESC')
|
|
|
|
@starred_projects = @starred_projects.page(params[:page]).per(10)
|
|
|
|
end
|
2014-07-23 09:03:49 +00:00
|
|
|
end
|