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
dac7c44a
Commit
dac7c44a
authored
12 years ago
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated readme, Roles in progress
parent
37224dc9
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
164 additions
and
66 deletions
+164
-66
app/assets/images/help_commit.png
app/assets/images/help_commit.png
+0
-0
app/assets/images/help_merge_request.png
app/assets/images/help_merge_request.png
+0
-0
app/assets/stylesheets/common.scss
app/assets/stylesheets/common.scss
+7
-0
app/controllers/protected_branches_controller.rb
app/controllers/protected_branches_controller.rb
+8
-0
app/helpers/projects_helper.rb
app/helpers/projects_helper.rb
+3
-1
app/models/users_project.rb
app/models/users_project.rb
+16
-0
app/views/help/index.html.haml
app/views/help/index.html.haml
+13
-39
app/views/help/permissions.html.haml
app/views/help/permissions.html.haml
+27
-0
app/views/help/workflow.html.haml
app/views/help/workflow.html.haml
+38
-0
app/views/projects/team.html.haml
app/views/projects/team.html.haml
+3
-3
app/views/protected_branches/index.html.haml
app/views/protected_branches/index.html.haml
+28
-12
app/views/repositories/_branches_head.html.haml
app/views/repositories/_branches_head.html.haml
+1
-1
app/views/team_members/_form.html.haml
app/views/team_members/_form.html.haml
+14
-6
app/views/team_members/_show.html.haml
app/views/team_members/_show.html.haml
+4
-4
config/routes.rb
config/routes.rb
+2
-0
No files found.
app/assets/images/help_commit.png
deleted
100644 → 0
View file @
37224dc9
95.7 KB
This diff is collapsed.
Click to expand it.
app/assets/images/help_merge_request.png
deleted
100644 → 0
View file @
37224dc9
54.5 KB
This diff is collapsed.
Click to expand it.
app/assets/stylesheets/common.scss
View file @
dac7c44a
...
@@ -6,6 +6,10 @@ a {
...
@@ -6,6 +6,10 @@ a {
}
}
}
}
.vlink
{
color
:
$link_color
!
important
;
}
.pills
.active
a
{
.pills
.active
a
{
background-color
:
#474D57
;
background-color
:
#474D57
;
}
}
...
@@ -27,6 +31,7 @@ a {
...
@@ -27,6 +31,7 @@ a {
.cgray
{
color
:gray
;
}
.cgray
{
color
:gray
;
}
.cred
{
color
:
#D12F19
;
}
.cred
{
color
:
#D12F19
;
}
.cgreen
{
color
:
#44aa22
;
}
.cgreen
{
color
:
#44aa22
;
}
.cblack
{
color
:
#111
;
}
/** COMMON STYLES **/
/** COMMON STYLES **/
.left
{
.left
{
...
@@ -259,3 +264,5 @@ img.lil_av {
...
@@ -259,3 +264,5 @@ img.lil_av {
}
}
}
}
.help
li
{
color
:
#111
}
This diff is collapsed.
Click to expand it.
app/controllers/protected_branches_controller.rb
View file @
dac7c44a
...
@@ -6,6 +6,8 @@ class ProtectedBranchesController < ApplicationController
...
@@ -6,6 +6,8 @@ class ProtectedBranchesController < ApplicationController
before_filter
:authorize_read_project!
before_filter
:authorize_read_project!
before_filter
:require_non_empty_project
before_filter
:require_non_empty_project
before_filter
:authorize_admin_project!
,
:only
=>
[
:destroy
,
:create
]
layout
"project"
layout
"project"
def
index
def
index
...
@@ -19,5 +21,11 @@ class ProtectedBranchesController < ApplicationController
...
@@ -19,5 +21,11 @@ class ProtectedBranchesController < ApplicationController
end
end
def
destroy
def
destroy
@project
.
protected_branches
.
find
(
params
[
:id
]).
destroy
respond_to
do
|
format
|
format
.
html
{
redirect_to
project_protected_branches_path
}
format
.
js
{
render
:nothing
=>
true
}
end
end
end
end
end
This diff is collapsed.
Click to expand it.
app/helpers/projects_helper.rb
View file @
dac7c44a
...
@@ -34,7 +34,9 @@ module ProjectsHelper
...
@@ -34,7 +34,9 @@ module ProjectsHelper
def
repository_tab_class
def
repository_tab_class
if
controller
.
controller_name
==
"repositories"
||
if
controller
.
controller_name
==
"repositories"
||
controller
.
controller_name
==
"hooks"
controller
.
controller_name
==
"hooks"
||
controller
.
controller_name
==
"protected_branches"
||
controller
.
controller_name
==
"deploy_keys"
"current"
"current"
end
end
end
end
...
...
This diff is collapsed.
Click to expand it.
app/models/users_project.rb
View file @
dac7c44a
class
UsersProject
<
ActiveRecord
::
Base
class
UsersProject
<
ActiveRecord
::
Base
REPORTER
=
21
DEVELOPER
=
22
MASTER
=
33
belongs_to
:user
belongs_to
:user
belongs_to
:project
belongs_to
:project
...
@@ -41,6 +45,18 @@ class UsersProject < ActiveRecord::Base
...
@@ -41,6 +45,18 @@ class UsersProject < ActiveRecord::Base
end
end
end
end
def
self
.
access_roles
{
"Reporter"
=>
REPORTER
,
"Developer"
=>
DEVELOPER
,
"Master"
=>
MASTER
}
end
def
role_access
"
#{
project_access
}#{
repo_access
}
"
end
def
update_repository
def
update_repository
Gitlabhq
::
GitHost
.
system
.
new
.
configure
do
|
c
|
Gitlabhq
::
GitHost
.
system
.
new
.
configure
do
|
c
|
c
.
update_project
(
project
.
path
,
project
)
c
.
update_project
(
project
.
path
,
project
)
...
...
This diff is collapsed.
Click to expand it.
app/views/help/index.html.haml
View file @
dac7c44a
-
bash_lexer
=
Pygments
::
Lexer
[
:bash
]
%h3
%div
.help_content
Gitlabhq
%h2
%span
.right
v2.2
Gitlabhq
%hr
%span
.right
v2.1
%h4
Self Hosted Git Management
%hr
%h4
Fast, secure and stable solution based on Ruby on Rails
&
Gitolite.
%h3
Self Hosted Git Management
%h3
Fast, secure and stable solution based on Ruby on Rails
&
Gitolite.
%hr
%hr
.menu
%h3
Help
%h3
=
link_to
"Workflow"
,
"#"
,
:class
=>
"active"
.content
%ol
%h3
Clone project
%li
.bash
=
link_to
"Workflow"
,
help_workflow_path
%pre
git clone git@example.com:project-name.git
%h3
Create branch with your feature
%li
.bash
=
link_to
"Permissions"
,
help_permissions_path
%pre
git checkout -b $feature_name
%h3
Write code. Commit changes
.bash
%pre
git commit -am "My feature is ready"
%h3
Push your branch to gitlabhq
.bash
%pre
git push origin $feature_name
%h3
Review your code
.bash
=
image_tag
"help_commit.png"
,
:width
=>
600
%h3
Open a merge request
.bash
=
image_tag
"help_merge_request.png"
,
:width
=>
600
%h3
Your team lead will review code
&
merge it to main branch
This diff is collapsed.
Click to expand it.
app/views/help/permissions.html.haml
0 → 100644
View file @
dac7c44a
%h3
Permissions
%hr
%h4
Reporter
%ul
%li
Pull project code
%li
Create new issue
%li
Create new merge request
%li
Write on project wall
%h4
Developer
%ul
%li
Pull project code
%li
Create new branches
%li
Push to non-protected branches
%li
Remove non-protected branches
%li
Add tags
%li
Create new issue
%li
Create new merge request
%li
Write on project wall
%h4
Master
%ul
%li
Full repository access
%li
Full project access
%li
Add new team members
This diff is collapsed.
Click to expand it.
app/views/help/workflow.html.haml
0 → 100644
View file @
dac7c44a
-
bash_lexer
=
Pygments
::
Lexer
[
:bash
]
%h3
Workflow
%hr
%ol
.help
%li
%p
Clone project
.bash
%pre
git clone git@example.com:project-name.git
%li
%p
Create branch with your feature
.bash
%pre
git checkout -b $feature_name
%li
%p
Write code. Commit changes
.bash
%pre
git commit -am "My feature is ready"
%li
%p
Push your branch to gitlabhq
.bash
%pre
git push origin $feature_name
%li
%p
Review your code on Commits page
%li
%p
Create a merge request
%li
%p
Your team lead will review code
&
merge it to main branch
This diff is collapsed.
Click to expand it.
app/views/projects/team.html.haml
View file @
dac7c44a
...
@@ -4,9 +4,9 @@
...
@@ -4,9 +4,9 @@
.alert-message.block-message
.alert-message.block-message
=
link_to
new_project_team_member_path
(
@project
),
:class
=>
"btn small right"
,
:title
=>
"New Team Member"
do
=
link_to
new_project_team_member_path
(
@project
),
:class
=>
"btn small right"
,
:title
=>
"New Team Member"
do
New Team Member
New Team Member
Manage project team from this page.
%p
Ream more about project permissions
#{
link_to
"here"
,
help_permissions_path
,
:class
=>
"vlink"
}
%
br
%
p
To open team member profile - click on avatar.
To open team member profile - click on avatar.
=
render
:partial
=>
"team"
,
:locals
=>
{
:project
=>
@project
}
=
render
:partial
=>
"team"
,
:locals
=>
{
:project
=>
@project
}
This diff is collapsed.
Click to expand it.
app/views/protected_branches/index.html.haml
View file @
dac7c44a
=
render
"repositories/branches_head"
=
render
"repositories/branches_head"
=
form_for
[
@project
,
@protected_branch
]
do
|
f
|
.alert-message.block-message
-
if
@protected_branch
.
errors
.
any?
%p
Protected branches designed to prevent push for all except
#{
link_to
"masters"
,
help_permissions_path
,
:class
=>
"vlink"
}
.
.alert-message.block-message.error
%p
This ability allows:
%ul
%ul
-
@protected_branch
.
errors
.
full_messages
.
each
do
|
msg
|
%li
keep stable branches secured
%li
=
msg
%li
forced code review before merge to protected branches
%p
Ream more about project permissions
#{
link_to
"here"
,
help_permissions_path
,
:class
=>
"vlink"
}
.clearfix
=
f
.
label
:name
.input
=
f
.
select
(
:name
,
@project
.
open_branches
.
map
{
|
br
|
[
br
.
name
,
br
.
name
]
}
,
{
:include_blank
=>
"Select branch"
},
{
:style
=>
"width:300px"
})
.actions
=
f
.
submit
'Add'
,
:class
=>
"primary btn"
-
unless
@branches
.
empty?
-
unless
@branches
.
empty?
%table
%table
.zebra-striped
%thead
%thead
%tr
%tr
%th
Name
%th
Name
%th
Last commit
%th
Last commit
%th
%tbody
%tbody
-
@branches
.
each
do
|
branch
|
-
@branches
.
each
do
|
branch
|
%tr
%tr
...
@@ -33,6 +30,25 @@
...
@@ -33,6 +30,25 @@
=
truncate
branch
.
commit
.
id
.
to_s
,
:length
=>
10
=
truncate
branch
.
commit
.
id
.
to_s
,
:length
=>
10
=
time_ago_in_words
(
branch
.
commit
.
committed_date
)
=
time_ago_in_words
(
branch
.
commit
.
committed_date
)
ago
ago
%td
-
if
can?
current_user
,
:admin_project
,
@project
=
link_to
'Unprotect'
,
[
@project
,
branch
],
:confirm
=>
'Are you sure?'
,
:method
=>
:delete
,
:class
=>
"danger btn small"
-
if
can?
current_user
,
:admin_project
,
@project
=
form_for
[
@project
,
@protected_branch
]
do
|
f
|
-
if
@protected_branch
.
errors
.
any?
.alert-message.block-message.error
%ul
-
@protected_branch
.
errors
.
full_messages
.
each
do
|
msg
|
%li
=
msg
.clearfix
=
f
.
label
:name
.input
=
f
.
select
(
:name
,
@project
.
open_branches
.
map
{
|
br
|
[
br
.
name
,
br
.
name
]
}
,
{
:include_blank
=>
"Select branch"
},
{
:style
=>
"width:300px"
})
.actions
=
f
.
submit
'Add'
,
:class
=>
"primary btn"
:javascript
:javascript
...
...
This diff is collapsed.
Click to expand it.
app/views/repositories/_branches_head.html.haml
View file @
dac7c44a
...
@@ -6,4 +6,4 @@
...
@@ -6,4 +6,4 @@
%li
{
:class
=>
(
"active"
if
current_page?
(
project_protected_branches_path
(
@project
)))}
%li
{
:class
=>
(
"active"
if
current_page?
(
project_protected_branches_path
(
@project
)))}
=
link_to
project_protected_branches_path
(
@project
)
do
=
link_to
project_protected_branches_path
(
@project
)
do
Protected
Protected
%hr
This diff is collapsed.
Click to expand it.
app/views/team_members/_form.html.haml
View file @
dac7c44a
...
@@ -11,13 +11,20 @@
...
@@ -11,13 +11,20 @@
=
f
.
label
:user_id
,
"Name"
=
f
.
label
:user_id
,
"Name"
.input
=
f
.
select
(
:user_id
,
User
.
not_in_project
(
@project
).
all
.
collect
{
|
p
|
[
p
.
name
,
p
.
id
]
},
{
:include_blank
=>
"Select user"
},
{
:style
=>
"width:300px"
})
.input
=
f
.
select
(
:user_id
,
User
.
not_in_project
(
@project
).
all
.
collect
{
|
p
|
[
p
.
name
,
p
.
id
]
},
{
:include_blank
=>
"Select user"
},
{
:style
=>
"width:300px"
})
.clearfix
.clearfix
=
f
.
label
:project_access
,
"Project Access"
=
f
.
label
:project_access
,
"Project Access"
.input
=
f
.
select
:project_access
,
options_for_select
(
Project
.
access_options
,
@team_member
.
project_access
),
{},
:class
=>
"project-access-select"
.input
=
f
.
select
:_project_access
,
options_for_select
(
UsersProject
.
access_roles
,
@team_member
.
role_access
),
{},
:class
=>
"project-access-select"
.clearfix
=
f
.
label
:repo_access
,
"Repository Access"
-#.clearfix
.input
=
f
.
select
:repo_access
,
options_for_select
(
Repository
.
access_options
,
@team_member
.
repo_access
),
{},
:class
=>
"repo-access-select"
-#= f.label :project_access, "Project Access"
-#.input= f.select :project_access, options_for_select(Project.access_options, @team_member.project_access), {}, :class => "project-access-select"
-#.clearfix
-#= f.label :repo_access, "Repository Access"
-#.input= f.select :repo_access, options_for_select(Repository.access_options, @team_member.repo_access), {}, :class => "repo-access-select"
.actions
.actions
=
f
.
submit
'Save'
,
:class
=>
"btn primary"
=
f
.
submit
'Save'
,
:class
=>
"btn primary"
...
@@ -30,5 +37,6 @@
...
@@ -30,5 +37,6 @@
:javascript
:javascript
$
(
'
select#team_member_user_id
'
).
chosen
();
$
(
'
select#team_member_user_id
'
).
chosen
();
$
(
'
select#team_member_repo_access
'
).
chosen
();
$
(
'
select#team_member__project_access
'
).
chosen
();
$
(
'
select#team_member_project_access
'
).
chosen
();
//$('select#team_member_repo_access').chosen();
//$('select#team_member_project_access').chosen();
This diff is collapsed.
Click to expand it.
app/views/team_members/_show.html.haml
View file @
dac7c44a
...
@@ -11,9 +11,9 @@
...
@@ -11,9 +11,9 @@
.span3
.span3
=
form_for
(
member
,
:as
=>
:team_member
,
:url
=>
project_team_member_path
(
@project
,
member
))
do
|
f
|
=
form_for
(
member
,
:as
=>
:team_member
,
:url
=>
project_team_member_path
(
@project
,
member
))
do
|
f
|
=
f
.
select
:
project_access
,
options_for_select
(
Project
.
access_options
,
member
.
project
_access
),
{},
:class
=>
"medium project-access-select"
,
:disabled
=>
!
allow_admin
=
f
.
select
:
_project_access
,
options_for_select
(
UsersProject
.
access_roles
,
member
.
role
_access
),
{},
:class
=>
"medium project-access-select"
,
:disabled
=>
!
allow_admin
.span3
-#
.span3
=
form_for
(
member
,
:as
=>
:team_member
,
:url
=>
project_team_member_path
(
@project
,
member
))
do
|
f
|
-#
= form_for(member, :as => :team_member, :url => project_team_member_path(@project, member)) do |f|
=
f
.
select
:repo_access
,
options_for_select
(
Repository
.
access_options
,
member
.
repo_access
),
{},
:class
=>
"medium repo-access-select"
,
:disabled
=>
!
allow_admin
-#
= f.select :repo_access, options_for_select(Repository.access_options, member.repo_access), {}, :class => "medium repo-access-select", :disabled => !allow_admin
-
if
@project
.
owner
==
user
-
if
@project
.
owner
==
user
%span
.label
Project Owner
%span
.label
Project Owner
This diff is collapsed.
Click to expand it.
config/routes.rb
View file @
dac7c44a
...
@@ -5,6 +5,8 @@ Gitlab::Application.routes.draw do
...
@@ -5,6 +5,8 @@ Gitlab::Application.routes.draw do
mount
Resque
::
Server
.
new
,
at:
'/info/resque'
mount
Resque
::
Server
.
new
,
at:
'/info/resque'
get
'help'
=>
'help#index'
get
'help'
=>
'help#index'
get
'help/permissions'
=>
'help#permissions'
get
'help/workflow'
=>
'help#workflow'
namespace
:admin
do
namespace
:admin
do
resources
:users
do
resources
:users
do
...
...
This diff is collapsed.
Click to expand it.
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