BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
e4cf99db
Commit
e4cf99db
authored
Oct 30, 2012
by
randx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor milestones related functionality. Added seeds for Milestine and MR
parent
53a3be03
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
39 additions
and
10 deletions
+39
-10
issue.rb
app/models/issue.rb
+0
-2
merge_request.rb
app/models/merge_request.rb
+0
-2
issue_commonality.rb
app/roles/issue_commonality.rb
+1
-0
_merge_request.html.haml
app/views/merge_requests/_merge_request.html.haml
+1
-1
_milestone.html.haml
app/views/milestones/_milestone.html.haml
+5
-5
007_milestones.rb
db/fixtures/development/007_milestones.rb
+13
-0
008_merge_requests.rb
db/fixtures/development/008_merge_requests.rb
+19
-0
No files found.
app/models/issue.rb
View file @
e4cf99db
...
...
@@ -7,8 +7,6 @@ class Issue < ActiveRecord::Base
acts_as_taggable_on
:labels
belongs_to
:milestone
validates
:description
,
length:
{
within:
0
..
2000
}
def
self
.
open_for
(
user
)
...
...
app/models/merge_request.rb
View file @
e4cf99db
...
...
@@ -10,8 +10,6 @@ class MergeRequest < ActiveRecord::Base
attr_accessor
:should_remove_source_branch
belongs_to
:milestone
BROKEN_DIFF
=
"--broken-diff"
UNCHECKED
=
1
...
...
app/roles/issue_commonality.rb
View file @
e4cf99db
...
...
@@ -6,6 +6,7 @@ module IssueCommonality
belongs_to
:project
belongs_to
:author
,
class_name:
"User"
belongs_to
:assignee
,
class_name:
"User"
belongs_to
:milestone
has_many
:notes
,
as: :noteable
,
dependent: :destroy
validates
:project
,
presence:
true
...
...
app/views/merge_requests/_merge_request.html.haml
View file @
e4cf99db
...
...
@@ -13,7 +13,7 @@
-
if
merge_request
.
milestone_id?
%span
.btn.small.disabled.grouped
%i
.icon-time
=
merge_request
.
project
.
milestones
.
find
(
merge_request
.
milestone_id
)
.
title
=
merge_request
.
milestone
.
title
%span
.btn.small.disabled.grouped
=
merge_request
.
source_branch
→
...
...
app/views/milestones/_milestone.html.haml
View file @
e4cf99db
...
...
@@ -13,9 +13,9 @@
.bar
{
style:
"width: #{milestone.percent_complete}%;"
}
.span6
-
if
milestone
.
issues
.
any?
=
link_to
project_issues_path
(
milestone
.
project
,
milestone_id:
milestone
.
id
)
,
class:
"btn very_small"
do
%strong
=
pluralize
milestone
.
issues
.
count
,
'Issue'
=
link_to
project_issues_path
(
milestone
.
project
,
milestone_id:
milestone
.
id
)
do
=
pluralize
milestone
.
issues
.
count
,
'Issue'
-
if
milestone
.
merge_requests
.
any?
=
link_to
project_merge_requests_path
(
milestone
.
project
,
milestone_id:
milestone
.
id
)
,
class:
"btn very_small"
do
%strong
=
pluralize
milestone
.
merge_requests
.
count
,
'Merge Request'
=
link_to
project_merge_requests_path
(
milestone
.
project
,
milestone_id:
milestone
.
id
)
do
=
pluralize
milestone
.
merge_requests
.
count
,
'Merge Request'
db/fixtures/development/007_milestones.rb
0 → 100644
View file @
e4cf99db
Milestone
.
seed
(
:id
,
[
{
:id
=>
1
,
:project_id
=>
1
,
:title
=>
'v'
+
Faker
::
Address
.
zip_code
},
{
:id
=>
2
,
:project_id
=>
1
,
:title
=>
'v'
+
Faker
::
Address
.
zip_code
},
{
:id
=>
3
,
:project_id
=>
1
,
:title
=>
'v'
+
Faker
::
Address
.
zip_code
},
{
:id
=>
4
,
:project_id
=>
2
,
:title
=>
'v'
+
Faker
::
Address
.
zip_code
},
{
:id
=>
5
,
:project_id
=>
2
,
:title
=>
'v'
+
Faker
::
Address
.
zip_code
},
{
:id
=>
6
,
:project_id
=>
2
,
:title
=>
'v'
+
Faker
::
Address
.
zip_code
},
{
:id
=>
7
,
:project_id
=>
2
,
:title
=>
'v'
+
Faker
::
Address
.
zip_code
},
{
:id
=>
8
,
:project_id
=>
3
,
:title
=>
'v'
+
Faker
::
Address
.
zip_code
},
{
:id
=>
9
,
:project_id
=>
3
,
:title
=>
'v'
+
Faker
::
Address
.
zip_code
},
{
:id
=>
11
,
:project_id
=>
3
,
:title
=>
'v'
+
Faker
::
Address
.
zip_code
},
])
db/fixtures/development/008_merge_requests.rb
0 → 100644
View file @
e4cf99db
MergeRequest
.
seed
(
:id
,
[
{
:id
=>
1
,
milestone_id:
1
,
project_id:
1
,
source_branch:
'master'
,
target_branch:
'feature'
,
author_id:
1
,
assignee_id:
1
,
title:
Faker
::
Lorem
.
sentence
(
6
)
},
{
:id
=>
2
,
milestone_id:
1
,
project_id:
1
,
source_branch:
'master'
,
target_branch:
'feature'
,
author_id:
2
,
assignee_id:
2
,
title:
Faker
::
Lorem
.
sentence
(
6
)
},
{
:id
=>
3
,
milestone_id:
1
,
project_id:
1
,
source_branch:
'master'
,
target_branch:
'feature'
,
author_id:
3
,
assignee_id:
3
,
title:
Faker
::
Lorem
.
sentence
(
6
)
},
{
:id
=>
4
,
milestone_id:
1
,
project_id:
1
,
source_branch:
'master'
,
target_branch:
'feature'
,
author_id:
4
,
assignee_id:
4
,
title:
Faker
::
Lorem
.
sentence
(
6
)
},
{
:id
=>
5
,
milestone_id:
1
,
project_id:
1
,
source_branch:
'master'
,
target_branch:
'feature'
,
author_id:
5
,
assignee_id:
5
,
title:
Faker
::
Lorem
.
sentence
(
6
)
},
{
:id
=>
6
,
milestone_id:
5
,
project_id:
2
,
source_branch:
'master'
,
target_branch:
'feature'
,
author_id:
1
,
assignee_id:
1
,
title:
Faker
::
Lorem
.
sentence
(
6
)
},
{
:id
=>
7
,
milestone_id:
6
,
project_id:
2
,
source_branch:
'master'
,
target_branch:
'feature'
,
author_id:
2
,
assignee_id:
2
,
title:
Faker
::
Lorem
.
sentence
(
6
)
},
{
:id
=>
8
,
milestone_id:
6
,
project_id:
2
,
source_branch:
'master'
,
target_branch:
'feature'
,
author_id:
3
,
assignee_id:
3
,
title:
Faker
::
Lorem
.
sentence
(
6
)
},
{
:id
=>
9
,
milestone_id:
6
,
project_id:
2
,
source_branch:
'master'
,
target_branch:
'feature'
,
author_id:
4
,
assignee_id:
4
,
title:
Faker
::
Lorem
.
sentence
(
6
)
},
{
:id
=>
11
,
milestone_id:
5
,
project_id:
2
,
source_branch:
'master'
,
target_branch:
'feature'
,
author_id:
5
,
assignee_id:
5
,
title:
Faker
::
Lorem
.
sentence
(
6
)
},
{
:id
=>
12
,
milestone_id:
9
,
project_id:
3
,
source_branch:
'master'
,
target_branch:
'feature'
,
author_id:
1
,
assignee_id:
1
,
title:
Faker
::
Lorem
.
sentence
(
6
)},
{
:id
=>
13
,
milestone_id:
9
,
project_id:
3
,
source_branch:
'master'
,
target_branch:
'feature'
,
author_id:
2
,
assignee_id:
2
,
title:
Faker
::
Lorem
.
sentence
(
6
)},
{
:id
=>
14
,
milestone_id:
9
,
project_id:
3
,
source_branch:
'master'
,
target_branch:
'feature'
,
author_id:
3
,
assignee_id:
3
,
title:
Faker
::
Lorem
.
sentence
(
6
)},
{
:id
=>
15
,
milestone_id:
9
,
project_id:
3
,
source_branch:
'master'
,
target_branch:
'feature'
,
author_id:
4
,
assignee_id:
4
,
title:
Faker
::
Lorem
.
sentence
(
6
)},
{
:id
=>
16
,
milestone_id:
9
,
project_id:
3
,
source_branch:
'master'
,
target_branch:
'feature'
,
author_id:
5
,
assignee_id:
5
,
title:
Faker
::
Lorem
.
sentence
(
6
)},
])
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