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
Jérome Perrin
gitlab-ce
Commits
de12eba2
Commit
de12eba2
authored
May 08, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Dont show fork button in personal projects. Point to fork if already forked project
parent
7b6f2fb1
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
5 deletions
+26
-5
app/models/ability.rb
app/models/ability.rb
+0
-1
app/models/user.rb
app/models/user.rb
+14
-0
app/views/projects/_clone_panel.html.haml
app/views/projects/_clone_panel.html.haml
+8
-4
app/views/projects/show.html.haml
app/views/projects/show.html.haml
+4
-0
No files found.
app/models/ability.rb
View file @
de12eba2
...
...
@@ -69,7 +69,6 @@ class Ability
:download_code
,
:write_snippet
,
:fork_project
]
end
...
...
app/models/user.rb
View file @
de12eba2
...
...
@@ -326,4 +326,18 @@ class User < ActiveRecord::Base
def
tm_of
(
project
)
project
.
team_member_by_id
(
self
.
id
)
end
def
already_forked?
project
!!
fork_of
(
project
)
end
def
fork_of
project
links
=
ForkedProjectLink
.
where
(
forked_from_project_id:
project
,
forked_to_project_id:
personal_projects
)
if
links
.
any?
links
.
first
.
forked_to_project
else
nil
end
end
end
app/views/projects/_clone_panel.html.haml
View file @
de12eba2
...
...
@@ -5,10 +5,14 @@
.span3.pull-right
.pull-right
-
unless
@project
.
empty_repo?
-
if
can?
current_user
,
:fork_project
,
@project
=
link_to
fork_project_path
(
@project
),
title:
"Fork"
,
class:
"btn grouped"
,
method:
"POST"
do
%i
.icon-copy
Fork
-
if
can?
(
current_user
,
:fork_project
,
@project
)
&&
@project
.
namespace
!=
current_user
.
namespace
-
if
current_user
.
already_forked?
(
@project
)
=
link_to
project_path
(
current_user
.
fork_of
(
@project
)),
class:
'btn grouped success'
do
Forked
-
else
=
link_to
fork_project_path
(
@project
),
title:
"Fork"
,
class:
"btn grouped"
,
method:
"POST"
do
%i
.icon-copy
Fork
-
if
can?
current_user
,
:download_code
,
@project
=
link_to
archive_project_repository_path
(
@project
),
class:
"btn grouped"
do
%i
.icon-download-alt
...
...
app/views/projects/show.html.haml
View file @
de12eba2
...
...
@@ -40,3 +40,7 @@
%p
Repo Size:
#{
@project
.
repository
.
size
}
MB
%p
Created at:
#{
@project
.
created_at
.
stamp
(
'Aug 22, 2013'
)
}
%p
Owner:
#{
link_to
@project
.
owner_name
,
@project
.
owner
}
-
if
@project
.
forked_from_project
%p
Forked from:
=
link_to
@project
.
forked_from_project
.
name_with_namespace
,
project_path
(
@project
.
forked_from_project
)
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