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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
062c9a08
Commit
062c9a08
authored
Nov 11, 2016
by
tiagonbotelho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change empty project view to annonymous user from activity to empty partial
parent
0527ea09
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
11 deletions
+11
-11
app/helpers/preferences_helper.rb
app/helpers/preferences_helper.rb
+5
-3
app/models/repository.rb
app/models/repository.rb
+0
-2
app/views/projects/_empty.html.haml
app/views/projects/_empty.html.haml
+3
-0
spec/helpers/preferences_helper_spec.rb
spec/helpers/preferences_helper_spec.rb
+3
-6
No files found.
app/helpers/preferences_helper.rb
View file @
062c9a08
...
...
@@ -50,9 +50,7 @@ module PreferencesHelper
end
def
default_project_view
unless
current_user
return
@repository
.
head_commit
?
'readme'
:
'activity'
end
return
annonymous_project_view
unless
current_user
user_view
=
current_user
.
project_view
...
...
@@ -68,4 +66,8 @@ module PreferencesHelper
"customize_workflow"
end
end
def
annonymous_project_view
@project
.
empty_repo?
?
'empty'
:
'readme'
end
end
app/models/repository.rb
View file @
062c9a08
...
...
@@ -554,8 +554,6 @@ class Repository
end
def
readme
return
unless
head_commit
cache
.
fetch
(
:readme
)
{
tree
(
:head
).
readme
}
end
...
...
app/views/projects/_empty.html.haml
0 → 100644
View file @
062c9a08
.row-content-block.second-block.center
%h3
.page-title
The repository for this project is empty
spec/helpers/preferences_helper_spec.rb
View file @
062c9a08
...
...
@@ -90,19 +90,16 @@ describe PreferencesHelper do
let
(
:project
)
{
create
(
:project
)
}
context
'user not signed in'
do
before
do
stub_user
@repository
=
project
.
repository
end
before
{
stub_user
}
it
'returns readme view if repository is not empty'
do
expect
(
helper
.
default_project_view
).
to
eq
(
'readme'
)
end
it
'returns activity if repository is empty'
do
expect
(
@repository
).
to
receive
(
:head_commit
).
and_return
(
nil
)
expect
(
project
).
to
receive
(
:empty_repo?
).
and_return
(
true
)
expect
(
helper
.
default_project_view
).
to
eq
(
'
activi
ty'
)
expect
(
helper
.
default_project_view
).
to
eq
(
'
emp
ty'
)
end
end
end
...
...
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