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
Tatuya Kamada
gitlab-ce
Commits
6c416aaa
Commit
6c416aaa
authored
Feb 06, 2012
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issues, MR, Wall can be enabled/disabled per project
parent
da3e34c0
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
116 additions
and
26 deletions
+116
-26
app/controllers/issues_controller.rb
app/controllers/issues_controller.rb
+5
-0
app/controllers/merge_requests_controller.rb
app/controllers/merge_requests_controller.rb
+5
-0
app/controllers/projects_controller.rb
app/controllers/projects_controller.rb
+2
-0
app/views/layouts/_project_side.html.haml
app/views/layouts/_project_side.html.haml
+12
-8
app/views/projects/_form.html.haml
app/views/projects/_form.html.haml
+15
-1
app/views/projects/info.html.haml
app/views/projects/info.html.haml
+42
-5
app/views/widgets/_project_member.html.haml
app/views/widgets/_project_member.html.haml
+10
-9
db/migrate/20120206170141_add_modularity_fields_to_project.rb
...igrate/20120206170141_add_modularity_fields_to_project.rb
+7
-0
db/schema.rb
db/schema.rb
+18
-3
No files found.
app/controllers/issues_controller.rb
View file @
6c416aaa
class
IssuesController
<
ApplicationController
class
IssuesController
<
ApplicationController
before_filter
:authenticate_user!
before_filter
:authenticate_user!
before_filter
:project
before_filter
:project
before_filter
:module_enabled
before_filter
:issue
,
:only
=>
[
:edit
,
:update
,
:destroy
,
:show
]
before_filter
:issue
,
:only
=>
[
:edit
,
:update
,
:destroy
,
:show
]
layout
"project"
layout
"project"
...
@@ -132,4 +133,8 @@ class IssuesController < ApplicationController
...
@@ -132,4 +133,8 @@ class IssuesController < ApplicationController
def
authorize_admin_issue!
def
authorize_admin_issue!
can?
(
current_user
,
:admin_issue
,
@issue
)
can?
(
current_user
,
:admin_issue
,
@issue
)
end
end
def
module_enabled
return
render_404
unless
@project
.
issues_enabled
end
end
end
app/controllers/merge_requests_controller.rb
View file @
6c416aaa
class
MergeRequestsController
<
ApplicationController
class
MergeRequestsController
<
ApplicationController
before_filter
:authenticate_user!
before_filter
:authenticate_user!
before_filter
:project
before_filter
:project
before_filter
:module_enabled
before_filter
:merge_request
,
:only
=>
[
:edit
,
:update
,
:destroy
,
:show
,
:commits
,
:diffs
]
before_filter
:merge_request
,
:only
=>
[
:edit
,
:update
,
:destroy
,
:show
,
:commits
,
:diffs
]
layout
"project"
layout
"project"
...
@@ -114,4 +115,8 @@ class MergeRequestsController < ApplicationController
...
@@ -114,4 +115,8 @@ class MergeRequestsController < ApplicationController
def
authorize_admin_merge_request!
def
authorize_admin_merge_request!
can?
(
current_user
,
:admin_merge_request
,
@merge_request
)
can?
(
current_user
,
:admin_merge_request
,
@merge_request
)
end
end
def
module_enabled
return
render_404
unless
@project
.
merge_requests_enabled
end
end
end
app/controllers/projects_controller.rb
View file @
6c416aaa
...
@@ -85,6 +85,8 @@ class ProjectsController < ApplicationController
...
@@ -85,6 +85,8 @@ class ProjectsController < ApplicationController
#
#
def
wall
def
wall
return
render_404
unless
@project
.
wall_enabled
@note
=
Note
.
new
@note
=
Note
.
new
@notes
=
@project
.
common_notes
.
order
(
"created_at DESC"
)
@notes
=
@project
.
common_notes
.
order
(
"created_at DESC"
)
@notes
=
@notes
.
fresh
.
limit
(
20
)
@notes
=
@notes
.
fresh
.
limit
(
20
)
...
...
app/views/layouts/_project_side.html.haml
View file @
6c416aaa
...
@@ -9,10 +9,14 @@
...
@@ -9,10 +9,14 @@
=
link_to
"Code"
,
tree_project_ref_path
(
@project
,
@project
.
root_ref
),
:class
=>
tree_tab_class
=
link_to
"Code"
,
tree_project_ref_path
(
@project
,
@project
.
root_ref
),
:class
=>
tree_tab_class
=
link_to
"Commits"
,
project_commits_path
(
@project
),
:class
=>
(
controller
.
controller_name
==
"commits"
)
?
"current"
:
nil
=
link_to
"Commits"
,
project_commits_path
(
@project
),
:class
=>
(
controller
.
controller_name
==
"commits"
)
?
"current"
:
nil
=
link_to
"Network"
,
graph_project_path
(
@project
),
:class
=>
current_page?
(
:controller
=>
"projects"
,
:action
=>
"graph"
,
:id
=>
@project
)
?
"current"
:
nil
=
link_to
"Network"
,
graph_project_path
(
@project
),
:class
=>
current_page?
(
:controller
=>
"projects"
,
:action
=>
"graph"
,
:id
=>
@project
)
?
"current"
:
nil
-
if
@project
.
issues_enabled
=
link_to
project_issues_filter_path
(
@project
),
:class
=>
(
controller
.
controller_name
==
"issues"
)
?
"current"
:
nil
do
=
link_to
project_issues_filter_path
(
@project
),
:class
=>
(
controller
.
controller_name
==
"issues"
)
?
"current"
:
nil
do
Issues
Issues
-
if
@project
.
merge_requests_enabled
=
link_to
project_merge_requests_path
(
@project
),
:class
=>
(
controller
.
controller_name
==
"merge_requests"
)
?
"current"
:
nil
do
=
link_to
project_merge_requests_path
(
@project
),
:class
=>
(
controller
.
controller_name
==
"merge_requests"
)
?
"current"
:
nil
do
Merge Requests
Merge Requests
-
if
@project
.
wall_enabled
=
link_to
wall_project_path
(
@project
),
:class
=>
current_page?
(
:controller
=>
"projects"
,
:action
=>
"wall"
,
:id
=>
@project
)
?
"current"
:
nil
do
=
link_to
wall_project_path
(
@project
),
:class
=>
current_page?
(
:controller
=>
"projects"
,
:action
=>
"wall"
,
:id
=>
@project
)
?
"current"
:
nil
do
@Wall
@Wall
-
if
@project
.
common_notes
.
today
.
count
>
0
-
if
@project
.
common_notes
.
today
.
count
>
0
...
...
app/views/projects/_form.html.haml
View file @
6c416aaa
...
@@ -23,10 +23,24 @@
...
@@ -23,10 +23,24 @@
=
f
.
label
:default_branch
,
"Default Branch"
=
f
.
label
:default_branch
,
"Default Branch"
.input
=
f
.
select
(
:default_branch
,
@project
.
heads
.
map
(
&
:name
),
{},
:style
=>
"width:210px;"
)
.input
=
f
.
select
(
:default_branch
,
@project
.
heads
.
map
(
&
:name
),
{},
:style
=>
"width:210px;"
)
.well
%h5
Features
.clearfix
=
f
.
label
:issues_enabled
,
"Issues"
.input
=
f
.
check_box
:issues_enabled
.clearfix
=
f
.
label
:merge_requests_enabled
,
"Merge Requests"
.input
=
f
.
check_box
:merge_requests_enabled
.clearfix
=
f
.
label
:wall_enabled
,
"Wall"
.input
=
f
.
check_box
:wall_enabled
.clearfix
.clearfix
=
f
.
label
:description
=
f
.
label
:description
.input
=
f
.
text_area
:description
,
:placeholder
=>
"project description"
,
:
style
=>
"height:50px"
.input
=
f
.
text_area
:description
,
:placeholder
=>
"project description"
,
:
class
=>
"xlarge"
,
:rows
=>
4
%br
%br
...
...
app/views/projects/info.html.haml
View file @
6c416aaa
=
render
"project_head"
=
render
"project_head"
%h3
=
@project
.
name
%br
.entry
%h3
=
@project
.
name
%br
%pre
%pre
=
"git clone
#{
@project
.
url_to_repo
}
"
=
"git clone
#{
@project
.
url_to_repo
}
"
%h4
Details:
%table
%table
%tr
%tr
%td
Name
%td
Name
...
@@ -54,6 +59,38 @@
...
@@ -54,6 +59,38 @@
%tr
%tr
%td
{
:colspan
=>
2
}=
simple_format
@project
.
description
%td
{
:colspan
=>
2
}=
simple_format
@project
.
description
%h4
Features:
%table
%tr
%td
Issues
%td
-
if
@project
.
issues_enabled
.alert-message.success
Enabled
-
else
.alert-message.error
Disabled
%tr
%td
Merge Requests
%td
-
if
@project
.
merge_requests_enabled
.alert-message.success
Enabled
-
else
.alert-message.error
Disabled
%tr
%td
Wall
%td
-
if
@project
.
wall_enabled
.alert-message.success
Enabled
-
else
.alert-message.error
Disabled
.actions
.actions
=
link_to
"Edit"
,
edit_project_path
(
@project
),
:class
=>
"btn"
=
link_to
"Edit"
,
edit_project_path
(
@project
),
:class
=>
"btn"
app/views/widgets/_project_member.html.haml
View file @
6c416aaa
...
@@ -16,6 +16,7 @@
...
@@ -16,6 +16,7 @@
%span
.label
=
member
.
repo_access_human
%span
.label
=
member
.
repo_access_human
-
if
can?
current_user
,
:write_project
,
@project
-
if
can?
current_user
,
:write_project
,
@project
-
if
@project
.
issues_enabled
&&
@project
.
merge_requests_enabled
%hr
%hr
.span3
.span3
%p
You have access to create new issue or merge request.
%p
You have access to create new issue or merge request.
...
...
db/migrate/20120206170141_add_modularity_fields_to_project.rb
0 → 100644
View file @
6c416aaa
class
AddModularityFieldsToProject
<
ActiveRecord
::
Migration
def
change
add_column
:projects
,
:issues_enabled
,
:boolean
,
:null
=>
false
,
:default
=>
true
add_column
:projects
,
:wall_enabled
,
:boolean
,
:null
=>
false
,
:default
=>
true
add_column
:projects
,
:merge_requests_enabled
,
:boolean
,
:null
=>
false
,
:default
=>
true
end
end
db/schema.rb
View file @
6c416aaa
...
@@ -11,7 +11,19 @@
...
@@ -11,7 +11,19 @@
#
#
# It's strongly recommended to check this file into your version control system.
# It's strongly recommended to check this file into your version control system.
ActiveRecord
::
Schema
.
define
(
:version
=>
20120121122616
)
do
ActiveRecord
::
Schema
.
define
(
:version
=>
20120206170141
)
do
create_table
"features"
,
:force
=>
true
do
|
t
|
t
.
string
"name"
t
.
string
"branch_name"
t
.
integer
"assignee_id"
t
.
integer
"author_id"
t
.
integer
"project_id"
t
.
datetime
"created_at"
t
.
datetime
"updated_at"
t
.
string
"version"
t
.
integer
"status"
,
:default
=>
0
,
:null
=>
false
end
create_table
"issues"
,
:force
=>
true
do
|
t
|
create_table
"issues"
,
:force
=>
true
do
|
t
|
t
.
string
"title"
t
.
string
"title"
...
@@ -77,6 +89,9 @@ ActiveRecord::Schema.define(:version => 20120121122616) do
...
@@ -77,6 +89,9 @@ ActiveRecord::Schema.define(:version => 20120121122616) do
t
.
string
"code"
t
.
string
"code"
t
.
integer
"owner_id"
t
.
integer
"owner_id"
t
.
string
"default_branch"
,
:default
=>
"master"
,
:null
=>
false
t
.
string
"default_branch"
,
:default
=>
"master"
,
:null
=>
false
t
.
boolean
"issues_enabled"
,
:default
=>
true
,
:null
=>
false
t
.
boolean
"wall_enabled"
,
:default
=>
true
,
:null
=>
false
t
.
boolean
"merge_requests_enabled"
,
:default
=>
true
,
:null
=>
false
end
end
create_table
"snippets"
,
:force
=>
true
do
|
t
|
create_table
"snippets"
,
:force
=>
true
do
|
t
|
...
...
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