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
Léo-Paul Géneau
gitlab-ce
Commits
eb3e07a5
Commit
eb3e07a5
authored
Nov 30, 2012
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use project owner if no namespace. Restyled team page
parent
8bf340f5
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
96 additions
and
79 deletions
+96
-79
app/assets/stylesheets/sections/projects.scss
app/assets/stylesheets/sections/projects.scss
+1
-0
app/models/ability.rb
app/models/ability.rb
+13
-8
app/models/project.rb
app/models/project.rb
+4
-0
app/views/admin/projects/_form.html.haml
app/views/admin/projects/_form.html.haml
+0
-4
app/views/admin/projects/show.html.haml
app/views/admin/projects/show.html.haml
+10
-1
app/views/groups/people.html.haml
app/views/groups/people.html.haml
+2
-6
app/views/layouts/project_resource.html.haml
app/views/layouts/project_resource.html.haml
+2
-1
app/views/projects/empty.html.haml
app/views/projects/empty.html.haml
+25
-22
app/views/shared/_clone_panel.html.haml
app/views/shared/_clone_panel.html.haml
+1
-1
app/views/team_members/_show.html.haml
app/views/team_members/_show.html.haml
+24
-22
app/views/team_members/_team.html.haml
app/views/team_members/_team.html.haml
+5
-7
app/views/team_members/index.html.haml
app/views/team_members/index.html.haml
+8
-6
app/views/tree/_head.html.haml
app/views/tree/_head.html.haml
+1
-1
No files found.
app/assets/stylesheets/sections/projects.scss
View file @
eb3e07a5
...
@@ -94,6 +94,7 @@
...
@@ -94,6 +94,7 @@
}
}
input
[
type
=
"text"
]
{
input
[
type
=
"text"
]
{
@extend
.monospace
;
border
:
1px
solid
#BBB
;
border
:
1px
solid
#BBB
;
box-shadow
:
none
;
box-shadow
:
none
;
margin-left
:
-1px
;
margin-left
:
-1px
;
...
...
app/models/ability.rb
View file @
eb3e07a5
...
@@ -18,7 +18,7 @@ class Ability
...
@@ -18,7 +18,7 @@ class Ability
# Rules based on role in project
# Rules based on role in project
if
project
.
master_access_for?
(
user
)
if
project
.
master_access_for?
(
user
)
# TODO: replace with master rules.
# TODO: replace with master rules.
# Only allow project administration for owners
# Only allow project administration for
namespace
owners
rules
<<
project_admin_rules
rules
<<
project_admin_rules
elsif
project
.
dev_access_for?
(
user
)
elsif
project
.
dev_access_for?
(
user
)
...
@@ -31,15 +31,20 @@ class Ability
...
@@ -31,15 +31,20 @@ class Ability
rules
<<
project_guest_rules
rules
<<
project_guest_rules
end
end
# If user own project namespace (Ex. group owner or account owner)
if
project
.
namespace
if
project
.
namespace
&&
project
.
namespace
.
owner
==
user
# If user own project namespace
rules
<<
project_admin_rules
# (Ex. group owner or account owner)
if
project
.
namespace
.
owner
==
user
rules
<<
project_admin_rules
end
else
# For compatibility with global projects
# use projects.owner_id
if
project
.
owner
==
user
rules
<<
project_admin_rules
end
end
end
# If user was set as direct project owner
if
project
.
owner
==
user
rules
<<
project_admin_rules
end
rules
.
flatten
rules
.
flatten
end
end
...
...
app/models/project.rb
View file @
eb3e07a5
...
@@ -292,4 +292,8 @@ class Project < ActiveRecord::Base
...
@@ -292,4 +292,8 @@ class Project < ActiveRecord::Base
merge_requests
merge_requests
end
end
end
end
def
namespace_owner
namespace
.
try
(
:owner
)
end
end
end
app/views/admin/projects/_form.html.haml
View file @
eb3e07a5
...
@@ -24,10 +24,6 @@
...
@@ -24,10 +24,6 @@
=
f
.
label
:namespace_id
=
f
.
label
:namespace_id
.input
=
f
.
select
:namespace_id
,
namespaces_options
(
@project
.
namespace_id
),
{},
{
class:
'chosen'
}
.input
=
f
.
select
:namespace_id
,
namespaces_options
(
@project
.
namespace_id
),
{},
{
class:
'chosen'
}
.clearfix
=
f
.
label
:owner_id
.input
=
f
.
select
:owner_id
,
User
.
all
.
map
{
|
user
|
[
user
.
name
,
user
.
id
]
},
{},
{
class:
'chosen'
}
-
if
project
.
repo_exists?
-
if
project
.
repo_exists?
.clearfix
.clearfix
=
f
.
label
:default_branch
,
"Default Branch"
=
f
.
label
:default_branch
,
"Default Branch"
...
...
app/views/admin/projects/show.html.haml
View file @
eb3e07a5
...
@@ -25,6 +25,15 @@
...
@@ -25,6 +25,15 @@
Name:
Name:
%td
%td
=
@project
.
name
=
@project
.
name
%tr
%td
%b
Namespace:
%td
-
if
@project
.
namespace
=
@project
.
namespace
.
human_name
-
else
Global
%tr
%tr
%td
%td
%b
%b
...
@@ -34,7 +43,7 @@
...
@@ -34,7 +43,7 @@
%tr
%tr
%td
%td
%b
%b
Owner
:
Created by
:
%td
%td
=
@project
.
owner_name
||
'(deleted)'
=
@project
.
owner_name
||
'(deleted)'
%tr
%tr
...
...
app/views/groups/people.html.haml
View file @
eb3e07a5
...
@@ -15,10 +15,6 @@
...
@@ -15,10 +15,6 @@
=
image_tag
gravatar_icon
(
user
.
email
,
16
),
class:
"avatar s16"
=
image_tag
gravatar_icon
(
user
.
email
,
16
),
class:
"avatar s16"
%strong
=
user
.
name
%strong
=
user
.
name
%span
.cgray
=
user
.
email
%span
.cgray
=
user
.
email
-
if
@project
-
if
@group
.
owner
==
user
-
if
@project
.
owner
==
user
%span
.btn.btn-small.disabled.right
Group Owner
%span
.btn.btn-small.disabled.right
Project Owner
-
else
-
if
@group
.
owner
==
user
%span
.btn.btn-small.disabled.right
Group Owner
app/views/layouts/project_resource.html.haml
View file @
eb3e07a5
...
@@ -4,7 +4,8 @@
...
@@ -4,7 +4,8 @@
%body
{
class:
"#{app_theme} project"
}
%body
{
class:
"#{app_theme} project"
}
=
render
"layouts/flash"
=
render
"layouts/flash"
=
render
"layouts/head_panel"
,
title:
@project
.
name
=
render
"layouts/head_panel"
,
title:
@project
.
name
=
render
'shared/no_ssh'
-
if
can?
(
current_user
,
:download_code
,
@project
)
=
render
'shared/no_ssh'
.container
.container
%ul
.main_menu
%ul
.main_menu
=
nav_link
(
html_options:
{
class:
"home
#{
project_tab_class
}
"
})
do
=
nav_link
(
html_options:
{
class:
"home
#{
project_tab_class
}
"
})
do
...
...
app/views/projects/empty.html.haml
View file @
eb3e07a5
=
render
'clone_panel'
=
render
'clone_panel'
%div
.git-empty
%div
.git-empty
%h4
Git global setup:
%fieldset
%pre
.dark
%legend
Git global setup:
=
preserve
do
%pre
.dark
git config --global user.name "
#{
current_user
.
name
}
"
=
preserve
do
git config --global user.email "
#{
current_user
.
email
}
"
git config --global user.name "
#{
current_user
.
name
}
"
git config --global user.email "
#{
current_user
.
email
}
"
%h4
.prepend-top-20
Create Repository
%fieldset
%pre
.dark
%legend
Create Repository
=
preserve
do
%pre
.dark
mkdir
#{
@project
.
path
}
=
preserve
do
cd
#{
@project
.
path
}
mkdir
#{
@project
.
path
}
git init
cd
#{
@project
.
path
}
touch README
git init
git add README
touch README
git commit -m 'first commit'
git add README
git remote add origin
#{
@project
.
url_to_repo
}
git commit -m 'first commit'
git push -u origin master
git remote add origin
#{
@project
.
url_to_repo
}
git push -u origin master
%h4
.prepend-top-20
Existing Git Repo?
%fieldset
%pre
.dark
%legend
Existing Git Repo?
=
preserve
do
%pre
.dark
cd existing_git_repo
=
preserve
do
git remote add origin
#{
@project
.
url_to_repo
}
cd existing_git_repo
git push -u origin master
git remote add origin
#{
@project
.
url_to_repo
}
git push -u origin master
-
if
can?
current_user
,
:admin_project
,
@project
-
if
can?
current_user
,
:admin_project
,
@project
.prepend-top-20
.prepend-top-20
...
...
app/views/shared/_clone_panel.html.haml
View file @
eb3e07a5
.input-prepend.project_clone_holder
.input-prepend.project_clone_holder
%button
{
class:
"btn active"
,
:"data-clone"
=>
@project
.
ssh_url_to_repo
}
SSH
%button
{
class:
"btn active"
,
:"data-clone"
=>
@project
.
ssh_url_to_repo
}
SSH
%button
{
class:
"btn"
,
:"data-clone"
=>
@project
.
http_url_to_repo
}=
Gitlab
.
config
.
web_protocol
.
upcase
%button
{
class:
"btn"
,
:"data-clone"
=>
@project
.
http_url_to_repo
}=
Gitlab
.
config
.
web_protocol
.
upcase
=
text_field_tag
:project_clone
,
@project
.
url_to_repo
,
class:
"one_click_select
span5
"
=
text_field_tag
:project_clone
,
@project
.
url_to_repo
,
class:
"one_click_select
input-xxlarge
"
app/views/team_members/_show.html.haml
View file @
eb3e07a5
-
user
=
member
.
user
-
user
=
member
.
user
-
allow_admin
=
can?
current_user
,
:admin_project
,
@project
-
allow_admin
=
can?
current_user
,
:admin_project
,
@project
%tr
{
id:
dom_id
(
member
),
class:
"team_member_row user_#{user.id}"
}
%li
.wll
{
id:
dom_id
(
member
),
class:
"team_member_row user_#{user.id}"
}
%td
.span6
.row
=
link_to
project_team_member_path
(
@project
,
member
),
title:
user
.
name
,
class:
"dark"
do
.span6
=
image_tag
gravatar_icon
(
user
.
email
,
40
),
class:
"avatar s32"
=
link_to
project_team_member_path
(
@project
,
member
),
title:
user
.
name
,
class:
"dark"
do
=
link_to
project_team_member_path
(
@project
,
member
),
title:
user
.
name
,
class:
"dark"
do
=
image_tag
gravatar_icon
(
user
.
email
,
40
),
class:
"avatar s32"
%strong
=
truncate
(
user
.
name
,
lenght:
40
)
=
link_to
project_team_member_path
(
@project
,
member
),
title:
user
.
name
,
class:
"dark"
do
%br
%strong
=
truncate
(
user
.
name
,
lenght:
40
)
%small
.cgray
=
user
.
email
%br
%small
.cgray
=
user
.
email
%td
.span5
.span5.right
.right
-
if
allow_admin
-
if
current_user
==
user
.left
%span
.btn.disabled
This is you!
=
form_for
(
member
,
as: :team_member
,
url:
project_team_member_path
(
@project
,
member
))
do
|
f
|
-
if
@project
.
owner
==
user
=
f
.
select
:project_access
,
options_for_select
(
UsersProject
.
access_roles
,
member
.
project_access
),
{},
class:
"medium project-access-select span2"
%span
.btn.disabled.success
Owner
.right
-
elsif
user
.
blocked
-
if
current_user
==
user
%span
.btn.disabled.blocked
Blocked
%span
.btn.disabled
This is you!
-
elsif
allow_admin
-
if
@project
.
namespace_owner
==
user
=
link_to
project_team_member_path
(
project_id:
@project
,
id:
member
.
id
),
confirm:
remove_from_team_message
(
@project
,
member
),
method: :delete
,
class:
"very_small btn danger"
do
%span
.btn.disabled.success
Owner
%i
.icon-minus.icon-white
-
elsif
user
.
blocked
%span
.btn.disabled.blocked
Blocked
-
elsif
allow_admin
=
link_to
project_team_member_path
(
project_id:
@project
,
id:
member
.
id
),
confirm:
remove_from_team_message
(
@project
,
member
),
method: :delete
,
class:
"very_small btn danger"
do
%i
.icon-minus.icon-white
-
if
allow_admin
=
form_for
(
member
,
as: :team_member
,
url:
project_team_member_path
(
@project
,
member
))
do
|
f
|
=
f
.
select
:project_access
,
options_for_select
(
UsersProject
.
access_roles
,
member
.
project_access
),
{},
class:
"medium project-access-select span2"
app/views/team_members/_team.html.haml
View file @
eb3e07a5
-
grouper_project_members
(
@project
).
each
do
|
access
,
members
|
-
grouper_project_members
(
@project
).
each
do
|
access
,
members
|
%table
.low
%fieldset
%thead
%legend
%tr
=
Project
.
access_options
.
key
(
access
).
pluralize
%th
.span7
%small
=
members
.
size
=
Project
.
access_options
.
key
(
access
).
pluralize
%ul
.unstyled
%th
%tbody
-
members
.
each
do
|
up
|
-
members
.
each
do
|
up
|
=
render
(
partial:
'team_members/show'
,
locals:
{
member:
up
})
=
render
(
partial:
'team_members/show'
,
locals:
{
member:
up
})
...
...
app/views/team_members/index.html.haml
View file @
eb3e07a5
=
render
"projects/project_head"
=
render
"projects/project_head"
%h3
.page_title
%h3
.page_title
Team Members
Team Members
%small
(
#{
@project
.
users_projects
.
count
}
)
(
#{
@project
.
users_projects
.
count
}
)
%small
-
if
can?
current_user
,
:admin_team_member
,
@project
%p
.slead
Read more about project permissions
Read more about project permissions
%strong
=
link_to
"here"
,
help_permissions_path
,
class:
"vlink"
%strong
=
link_to
"here"
,
help_permissions_path
,
class:
"vlink"
-
if
can?
current_user
,
:admin_team_member
,
@project
%span
.right
%span
.right
=
link_to
import_project_team_members_path
(
@project
),
class:
"btn small grouped"
,
title:
"Import team from another project"
do
=
link_to
import_project_team_members_path
(
@project
),
class:
"btn small grouped"
,
title:
"Import team from another project"
do
Import team from another project
Import team from another project
=
link_to
new_project_team_member_path
(
@project
),
class:
"btn success small grouped"
,
title:
"New Team Member"
do
=
link_to
new_project_team_member_path
(
@project
),
class:
"btn success small grouped"
,
title:
"New Team Member"
do
New Team Member
New Team Member
%hr
.clearfix
.clearfix
=
render
partial:
"team_members/team"
,
locals:
{
project:
@project
}
%div
.team-table
=
render
partial:
"team_members/team"
,
locals:
{
project:
@project
}
app/views/tree/_head.html.haml
View file @
eb3e07a5
...
@@ -4,4 +4,4 @@
...
@@ -4,4 +4,4 @@
=
nav_link
(
controller: :tree
)
do
=
nav_link
(
controller: :tree
)
do
=
link_to
'Source'
,
project_tree_path
(
@project
,
@ref
)
=
link_to
'Source'
,
project_tree_path
(
@project
,
@ref
)
%li
.right
%li
.right
=
render
"shared/clone_panel"
=
render
"shared/clone_panel"
\ No newline at end of file
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