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
88c625e3
Commit
88c625e3
authored
Jun 26, 2012
by
randx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issues can be unassigned now
parent
6abc6495
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
29 additions
and
17 deletions
+29
-17
app/assets/images/no_avatar.png
app/assets/images/no_avatar.png
+0
-0
app/models/issue.rb
app/models/issue.rb
+5
-1
app/observers/issue_observer.rb
app/observers/issue_observer.rb
+4
-2
app/views/issues/_form.html.haml
app/views/issues/_form.html.haml
+1
-1
app/views/issues/_show.html.haml
app/views/issues/_show.html.haml
+15
-7
app/views/issues/show.html.haml
app/views/issues/show.html.haml
+4
-3
app/views/milestones/show.html.haml
app/views/milestones/show.html.haml
+0
-2
spec/models/issue_spec.rb
spec/models/issue_spec.rb
+0
-1
No files found.
app/assets/images/no_avatar.png
View replaced file @
6abc6495
View file @
88c625e3
1.3 KB
|
W:
|
H:
1.31 KB
|
W:
|
H:
2-up
Swipe
Onion skin
app/models/issue.rb
View file @
88c625e3
...
@@ -11,7 +11,6 @@ class Issue < ActiveRecord::Base
...
@@ -11,7 +11,6 @@ class Issue < ActiveRecord::Base
attr_accessor
:author_id_of_changes
attr_accessor
:author_id_of_changes
validates_presence_of
:project_id
validates_presence_of
:project_id
validates_presence_of
:assignee_id
validates_presence_of
:author_id
validates_presence_of
:author_id
delegate
:name
,
delegate
:name
,
...
@@ -22,6 +21,7 @@ class Issue < ActiveRecord::Base
...
@@ -22,6 +21,7 @@ class Issue < ActiveRecord::Base
delegate
:name
,
delegate
:name
,
:email
,
:email
,
:to
=>
:assignee
,
:to
=>
:assignee
,
:allow_nil
=>
true
,
:prefix
=>
true
:prefix
=>
true
validates
:title
,
validates
:title
,
...
@@ -56,6 +56,10 @@ class Issue < ActiveRecord::Base
...
@@ -56,6 +56,10 @@ class Issue < ActiveRecord::Base
today?
&&
created_at
==
updated_at
today?
&&
created_at
==
updated_at
end
end
def
is_assigned?
!!
assignee_id
end
def
is_being_reassigned?
def
is_being_reassigned?
assignee_id_changed?
assignee_id_changed?
end
end
...
...
app/observers/issue_observer.rb
View file @
88c625e3
...
@@ -2,7 +2,9 @@ class IssueObserver < ActiveRecord::Observer
...
@@ -2,7 +2,9 @@ class IssueObserver < ActiveRecord::Observer
cattr_accessor
:current_user
cattr_accessor
:current_user
def
after_create
(
issue
)
def
after_create
(
issue
)
Notify
.
new_issue_email
(
issue
.
id
).
deliver
if
issue
.
assignee
!=
current_user
if
issue
.
assignee
&&
issue
.
assignee
!=
current_user
Notify
.
new_issue_email
(
issue
.
id
).
deliver
end
end
end
def
after_update
(
issue
)
def
after_update
(
issue
)
...
@@ -14,7 +16,7 @@ class IssueObserver < ActiveRecord::Observer
...
@@ -14,7 +16,7 @@ class IssueObserver < ActiveRecord::Observer
protected
protected
def
send_reassigned_email
(
issue
)
def
send_reassigned_email
(
issue
)
recipient_ids
=
[
issue
.
assignee_id
,
issue
.
assignee_id_was
].
keep_if
{
|
id
|
id
!=
current_user
.
id
}
recipient_ids
=
[
issue
.
assignee_id
,
issue
.
assignee_id_was
].
keep_if
{
|
id
|
id
&&
id
!=
current_user
.
id
}
recipient_ids
.
each
do
|
recipient_id
|
recipient_ids
.
each
do
|
recipient_id
|
Notify
.
reassigned_issue_email
(
recipient_id
,
issue
.
id
,
issue
.
assignee_id_was
).
deliver
Notify
.
reassigned_issue_email
(
recipient_id
,
issue
.
id
,
issue
.
assignee_id_was
).
deliver
...
...
app/views/issues/_form.html.haml
View file @
88c625e3
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
=
f
.
text_field
:title
,
:maxlength
=>
255
,
:class
=>
"xxlarge"
=
f
.
text_field
:title
,
:maxlength
=>
255
,
:class
=>
"xxlarge"
.issue_middle_block
.issue_middle_block
.issue_assignee
.issue_assignee
=
f
.
label
:assignee_id
,
"Assign to
*
"
=
f
.
label
:assignee_id
,
"Assign to"
.input
=
f
.
select
(
:assignee_id
,
@project
.
users
.
all
.
collect
{
|
p
|
[
p
.
name
,
p
.
id
]
},
{
:include_blank
=>
"Assign to user"
})
.input
=
f
.
select
(
:assignee_id
,
@project
.
users
.
all
.
collect
{
|
p
|
[
p
.
name
,
p
.
id
]
},
{
:include_blank
=>
"Assign to user"
})
.issue_milestone
.issue_milestone
=
f
.
label
:milestone_id
=
f
.
label
:milestone_id
...
...
app/views/issues/_show.html.haml
View file @
88c625e3
...
@@ -15,6 +15,7 @@
...
@@ -15,6 +15,7 @@
%i
.icon-edit
%i
.icon-edit
Edit
Edit
-
if
issue
.
assignee
=
image_tag
gravatar_icon
(
issue
.
assignee_email
),
:class
=>
"avatar"
=
image_tag
gravatar_icon
(
issue
.
assignee_email
),
:class
=>
"avatar"
%span
.update-author
%span
.update-author
assigned to
assigned to
...
@@ -22,5 +23,12 @@
...
@@ -22,5 +23,12 @@
-
if
issue
.
upvotes
>
0
-
if
issue
.
upvotes
>
0
%span
.badge.badge-success
=
"+
#{
issue
.
upvotes
}
"
%span
.badge.badge-success
=
"+
#{
issue
.
upvotes
}
"
-
else
=
image_tag
"no_avatar.png"
,
:class
=>
"avatar"
%span
.update-author
Unassigned
-
if
issue
.
upvotes
>
0
%span
.badge.badge-success
=
"+
#{
issue
.
upvotes
}
"
=
link_to
project_issue_path
(
issue
.
project
,
issue
)
do
=
link_to
project_issue_path
(
issue
.
project
,
issue
)
do
%p
.row_title
=
truncate
(
issue
.
title
,
:length
=>
100
)
%p
.row_title
=
truncate
(
issue
.
title
,
:length
=>
100
)
app/views/issues/show.html.haml
View file @
88c625e3
...
@@ -38,6 +38,7 @@
...
@@ -38,6 +38,7 @@
=
image_tag
gravatar_icon
(
@issue
.
author_email
),
:width
=>
16
,
:class
=>
"lil_av"
=
image_tag
gravatar_icon
(
@issue
.
author_email
),
:width
=>
16
,
:class
=>
"lil_av"
%strong
.author
=
link_to_issue_author
(
@issue
)
%strong
.author
=
link_to_issue_author
(
@issue
)
-
if
@issue
.
assignee
%cite
.cgray
and currently assigned to
%cite
.cgray
and currently assigned to
=
image_tag
gravatar_icon
(
@issue
.
assignee_email
),
:width
=>
16
,
:class
=>
"lil_av"
=
image_tag
gravatar_icon
(
@issue
.
assignee_email
),
:width
=>
16
,
:class
=>
"lil_av"
%strong
.author
=
link_to_issue_assignee
(
@issue
)
%strong
.author
=
link_to_issue_assignee
(
@issue
)
...
...
app/views/milestones/show.html.haml
View file @
88c625e3
...
@@ -49,8 +49,6 @@
...
@@ -49,8 +49,6 @@
%tr
%tr
%td
%td
=
link_to
[
@project
,
issue
]
do
=
link_to
[
@project
,
issue
]
do
=
image_tag
gravatar_icon
(
issue
.
assignee_email
,
16
),
:width
=>
"16"
%span
.badge.badge-info
##{issue.id}
%span
.badge.badge-info
##{issue.id}
–
–
=
truncate
issue
.
title
,
:length
=>
60
=
truncate
issue
.
title
,
:length
=>
60
...
...
spec/models/issue_spec.rb
View file @
88c625e3
...
@@ -12,7 +12,6 @@ describe Issue do
...
@@ -12,7 +12,6 @@ describe Issue do
it
{
should
validate_presence_of
(
:title
)
}
it
{
should
validate_presence_of
(
:title
)
}
it
{
should
validate_presence_of
(
:author_id
)
}
it
{
should
validate_presence_of
(
:author_id
)
}
it
{
should
validate_presence_of
(
:project_id
)
}
it
{
should
validate_presence_of
(
:project_id
)
}
it
{
should
validate_presence_of
(
:assignee_id
)
}
end
end
describe
"Scope"
do
describe
"Scope"
do
...
...
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