Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
122acb22
Commit
122acb22
authored
Jan 12, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix unauth for public
parent
4c6224aa
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
16 additions
and
13 deletions
+16
-13
app/controllers/public/projects_controller.rb
app/controllers/public/projects_controller.rb
+1
-1
app/models/project.rb
app/models/project.rb
+1
-0
app/views/layouts/_head.html.haml
app/views/layouts/_head.html.haml
+10
-8
app/views/layouts/public.html.haml
app/views/layouts/public.html.haml
+3
-3
app/views/public/projects/index.html.haml
app/views/public/projects/index.html.haml
+1
-1
No files found.
app/controllers/public/projects_controller.rb
View file @
122acb22
...
...
@@ -6,6 +6,6 @@ class Public::ProjectsController < ApplicationController
layout
'public'
def
index
@projects
=
Project
.
where
(
public:
true
)
@projects
=
Project
.
public
end
end
app/models/project.rb
View file @
122acb22
...
...
@@ -81,6 +81,7 @@ class Project < ActiveRecord::Base
scope
:sorted_by_activity
,
->
()
{
order
(
"(SELECT max(events.created_at) FROM events WHERE events.project_id = projects.id) DESC"
)
}
scope
:personal
,
->
(
user
)
{
where
(
namespace_id:
user
.
namespace_id
)
}
scope
:joined
,
->
(
user
)
{
where
(
"namespace_id != ?"
,
user
.
namespace_id
)
}
scope
:public
,
where
(
public:
true
)
class
<<
self
def
active
...
...
app/views/layouts/_head.html.haml
View file @
122acb22
...
...
@@ -6,7 +6,10 @@
=
favicon_link_tag
'favicon.ico'
=
stylesheet_link_tag
"application"
=
javascript_include_tag
"application"
=
csrf_meta_tags
-# Atom feed
-
if
current_user
-
if
controller_name
==
'projects'
&&
action_name
==
'index'
=
auto_discovery_link_tag
:atom
,
projects_url
(
:atom
,
private_token:
current_user
.
private_token
),
title:
"Dashboard feed"
-
if
@project
&&
!
@project
.
new_record?
...
...
@@ -14,4 +17,3 @@
=
auto_discovery_link_tag
(
:atom
,
project_commits_url
(
@project
,
@ref
,
format: :atom
,
private_token:
current_user
.
private_token
),
title:
"Recent commits to
#{
@project
.
name
}
:
#{
@ref
}
"
)
-
if
current_controller?
(
:issues
)
=
auto_discovery_link_tag
(
:atom
,
project_issues_url
(
@project
,
:atom
,
private_token:
current_user
.
private_token
),
title:
"
#{
@project
.
name
}
issues"
)
=
csrf_meta_tags
app/views/layouts/public.html.haml
View file @
122acb22
!!! 5
%html
{
lang:
"en"
}
=
render
"layouts/head"
,
title:
"
Error
"
=
render
"layouts/head"
,
title:
"
Public Area
"
%body
{
class:
"#{app_theme} application"
}
%header
.navbar.navbar-static-top.navbar-gitlab
.navbar-inner
.container
%div
.app_logo
%span
.separator
=
link_to
public_
root_path
,
class:
"home"
do
=
link_to
root_path
,
class:
"home"
do
%h1
GITLAB
%span
.separator
%h1
.project_name
Public
%h1
.project_name
Public Area
.container
.content
.prepend-top-20
...
...
app/views/public/projects/index.html.haml
View file @
122acb22
...
...
@@ -3,7 +3,7 @@
%small
Read-Only Access
%hr
%ul
.
well-list
%ul
.
unstyled
-
@projects
.
each
do
|
project
|
%li
.clearfix
%h5
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment