mirror of
https://github.com/wahyd4/gitlabhq.git
synced 2026-08-10 05:06:46 +10:00
* Render right layout depends on current_user * show sample git username/email when repo is empty * Show extra info when browsing public area * Fixed some tests related to public projects * show comments in read-only for public projects * Remove old public routing
27 lines
537 B
Ruby
27 lines
537 B
Ruby
class Projects::ApplicationController < ApplicationController
|
|
before_filter :project
|
|
before_filter :repository
|
|
layout :determine_layout
|
|
|
|
def authenticate_user!
|
|
# Restrict access to Projects area only
|
|
# for non-signed users
|
|
if !current_user
|
|
id = params[:project_id] || params[:id]
|
|
@project = Project.find_with_namespace(id)
|
|
|
|
return if @project && @project.public
|
|
end
|
|
|
|
super
|
|
end
|
|
|
|
def determine_layout
|
|
if current_user
|
|
'projects'
|
|
else
|
|
'public_projects'
|
|
end
|
|
end
|
|
end
|