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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
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
Hide 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
before_filter
:authenticate_user!
before_filter
:project
before_filter
:module_enabled
before_filter
:issue
,
:only
=>
[
:edit
,
:update
,
:destroy
,
:show
]
layout
"project"
...
...
@@ -132,4 +133,8 @@ class IssuesController < ApplicationController
def
authorize_admin_issue!
can?
(
current_user
,
:admin_issue
,
@issue
)
end
def
module_enabled
return
render_404
unless
@project
.
issues_enabled
end
end
app/controllers/merge_requests_controller.rb
View file @
6c416aaa
class
MergeRequestsController
<
ApplicationController
before_filter
:authenticate_user!
before_filter
:project
before_filter
:module_enabled
before_filter
:merge_request
,
:only
=>
[
:edit
,
:update
,
:destroy
,
:show
,
:commits
,
:diffs
]
layout
"project"
...
...
@@ -114,4 +115,8 @@ class MergeRequestsController < ApplicationController
def
authorize_admin_merge_request!
can?
(
current_user
,
:admin_merge_request
,
@merge_request
)
end
def
module_enabled
return
render_404
unless
@project
.
merge_requests_enabled
end
end
app/controllers/projects_controller.rb
View file @
6c416aaa
...
...
@@ -85,6 +85,8 @@ class ProjectsController < ApplicationController
#
def
wall
return
render_404
unless
@project
.
wall_enabled
@note
=
Note
.
new
@notes
=
@project
.
common_notes
.
order
(
"created_at DESC"
)
@notes
=
@notes
.
fresh
.
limit
(
20
)
...
...
app/views/layouts/_project_side.html.haml
View file @
6c416aaa
...
...
@@ -9,11 +9,15 @@
=
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
"Network"
,
graph_project_path
(
@project
),
:class
=>
current_page?
(
:controller
=>
"projects"
,
:action
=>
"graph"
,
:id
=>
@project
)
?
"current"
:
nil
=
link_to
project_issues_filter_path
(
@project
),
:class
=>
(
controller
.
controller_name
==
"issues"
)
?
"current"
:
nil
do
Issues
=
link_to
project_merge_requests_path
(
@project
),
:class
=>
(
controller
.
controller_name
==
"merge_requests"
)
?
"current"
:
nil
do
Merge Requests
=
link_to
wall_project_path
(
@project
),
:class
=>
current_page?
(
:controller
=>
"projects"
,
:action
=>
"wall"
,
:id
=>
@project
)
?
"current"
:
nil
do
@Wall
-
if
@project
.
common_notes
.
today
.
count
>
0
%span
.label
=
@project
.
common_notes
.
today
.
count
-
if
@project
.
issues_enabled
=
link_to
project_issues_filter_path
(
@project
),
:class
=>
(
controller
.
controller_name
==
"issues"
)
?
"current"
:
nil
do
Issues
-
if
@project
.
merge_requests_enabled
=
link_to
project_merge_requests_path
(
@project
),
:class
=>
(
controller
.
controller_name
==
"merge_requests"
)
?
"current"
:
nil
do
Merge Requests
-
if
@project
.
wall_enabled
=
link_to
wall_project_path
(
@project
),
:class
=>
current_page?
(
:controller
=>
"projects"
,
:action
=>
"wall"
,
:id
=>
@project
)
?
"current"
:
nil
do
@Wall
-
if
@project
.
common_notes
.
today
.
count
>
0
%span
.label
=
@project
.
common_notes
.
today
.
count
app/views/projects/_form.html.haml
View file @
6c416aaa
...
...
@@ -23,10 +23,24 @@
=
f
.
label
:default_branch
,
"Default Branch"
.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
=
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
...
...
app/views/projects/info.html.haml
View file @
6c416aaa
=
render
"project_head"
%h3
=
@project
.
name
%br
.entry
%h3
=
@project
.
name
%br
%pre
=
"git clone
#{
@project
.
url_to_repo
}
"
%pre
=
"git clone
#{
@project
.
url_to_repo
}
"
%h4
Details:
%table
%tr
...
...
@@ -54,6 +59,38 @@
%tr
%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
=
link_to
"Edit"
,
edit_project_path
(
@project
),
:class
=>
"btn"
app/views/widgets/_project_member.html.haml
View file @
6c416aaa
...
...
@@ -16,13 +16,14 @@
%span
.label
=
member
.
repo_access_human
-
if
can?
current_user
,
:write_project
,
@project
%hr
.span3
%p
You have access to create new issue or merge request.
%div
=
link_to
new_project_issue_path
(
@project
),
:title
=>
"New Issue"
,
:class
=>
""
do
New Issue »
%div
=
link_to
new_project_merge_request_path
(
@project
),
:title
=>
"New Merge Request"
,
:class
=>
""
do
New Merge Request »
-
if
@project
.
issues_enabled
&&
@project
.
merge_requests_enabled
%hr
.span3
%p
You have access to create new issue or merge request.
%div
=
link_to
new_project_issue_path
(
@project
),
:title
=>
"New Issue"
,
:class
=>
""
do
New Issue »
%div
=
link_to
new_project_merge_request_path
(
@project
),
:title
=>
"New Merge Request"
,
:class
=>
""
do
New 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 @@
#
# 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
|
t
.
string
"title"
...
...
@@ -73,10 +85,13 @@ ActiveRecord::Schema.define(:version => 20120121122616) do
t
.
text
"description"
t
.
datetime
"created_at"
t
.
datetime
"updated_at"
t
.
boolean
"private_flag"
,
:default
=>
true
,
:null
=>
false
t
.
boolean
"private_flag"
,
:default
=>
true
,
:null
=>
false
t
.
string
"code"
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
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