2015-04-30 13:06:18 -04:00
|
|
|
class Explore::ProjectsController < Explore::ApplicationController
|
2015-04-16 08:03:37 -04:00
|
|
|
skip_before_action :authenticate_user!,
|
2014-10-19 04:50:23 -04:00
|
|
|
:reject_blocked
|
2014-07-23 05:03:49 -04:00
|
|
|
|
|
|
|
def index
|
|
|
|
@projects = ProjectsFinder.new.execute(current_user)
|
2015-03-10 18:59:14 -04:00
|
|
|
@tags = @projects.tags_on(:tags)
|
|
|
|
@projects = @projects.tagged_with(params[:tag]) if params[:tag].present?
|
|
|
|
@projects = @projects.where(visibility_level: params[:visibility_level]) if params[:visibility_level].present?
|
2014-07-23 05:03:49 -04:00
|
|
|
@projects = @projects.search(params[:search]) if params[:search].present?
|
|
|
|
@projects = @projects.sort(@sort = params[:sort])
|
2015-03-12 18:37:00 -04:00
|
|
|
@projects = @projects.includes(:namespace).page(params[:page]).per(PER_PAGE)
|
2014-07-23 05:03:49 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
def trending
|
|
|
|
@trending_projects = TrendingProjectsFinder.new.execute(current_user)
|
2015-03-12 18:37:00 -04:00
|
|
|
@trending_projects = @trending_projects.page(params[:page]).per(PER_PAGE)
|
2014-07-23 05:03:49 -04:00
|
|
|
end
|
2014-07-25 15:05:23 -04:00
|
|
|
|
|
|
|
def starred
|
|
|
|
@starred_projects = ProjectsFinder.new.execute(current_user)
|
2015-02-18 19:40:22 -05:00
|
|
|
@starred_projects = @starred_projects.reorder('star_count DESC')
|
2015-03-12 18:37:00 -04:00
|
|
|
@starred_projects = @starred_projects.page(params[:page]).per(PER_PAGE)
|
2014-07-25 15:05:23 -04:00
|
|
|
end
|
2014-07-23 05:03:49 -04:00
|
|
|
end
|