Commit 9a0b763eece1305437a7410cf9e6debca9a8670b
1 parent
6f9428b1
Exists in
master
and in
4 other branches
Fix missing @project errors
Showing
3 changed files
with
13 additions
and
4 deletions
Show diff stats
app/mailers/notify.rb
| ... | ... | @@ -16,12 +16,14 @@ class Notify < ActionMailer::Base |
| 16 | 16 | |
| 17 | 17 | def new_issue_email(issue_id) |
| 18 | 18 | @issue = Issue.find(issue_id) |
| 19 | + @project = @issue.project | |
| 19 | 20 | mail(:to => @issue.assignee_email, :subject => "gitlab | New Issue was created") |
| 20 | 21 | end |
| 21 | 22 | |
| 22 | 23 | def note_wall_email(recipient_id, note_id) |
| 23 | 24 | recipient = User.find(recipient_id) |
| 24 | 25 | @note = Note.find(note_id) |
| 26 | + @project = @note.project | |
| 25 | 27 | mail(:to => recipient.email, :subject => "gitlab | #{@note.project_name} ") |
| 26 | 28 | end |
| 27 | 29 | |
| ... | ... | @@ -29,6 +31,7 @@ class Notify < ActionMailer::Base |
| 29 | 31 | recipient = User.find(recipient_id) |
| 30 | 32 | @note = Note.find(note_id) |
| 31 | 33 | @commit = @note.target |
| 34 | + @project = @note.project | |
| 32 | 35 | mail(:to => recipient.email, :subject => "gitlab | note for commit | #{@note.project_name} ") |
| 33 | 36 | end |
| 34 | 37 | |
| ... | ... | @@ -36,6 +39,7 @@ class Notify < ActionMailer::Base |
| 36 | 39 | recipient = User.find(recipient_id) |
| 37 | 40 | @note = Note.find(note_id) |
| 38 | 41 | @merge_request = @note.noteable |
| 42 | + @project = @note.project | |
| 39 | 43 | mail(:to => recipient.email, :subject => "gitlab | note for merge request | #{@note.project_name} ") |
| 40 | 44 | end |
| 41 | 45 | |
| ... | ... | @@ -43,6 +47,7 @@ class Notify < ActionMailer::Base |
| 43 | 47 | recipient = User.find(recipient_id) |
| 44 | 48 | @note = Note.find(note_id) |
| 45 | 49 | @issue = @note.noteable |
| 50 | + @project = @note.project | |
| 46 | 51 | mail(:to => recipient.email, :subject => "gitlab | note for issue #{@issue.id} | #{@note.project_name} ") |
| 47 | 52 | end |
| 48 | 53 | |
| ... | ... | @@ -50,11 +55,13 @@ class Notify < ActionMailer::Base |
| 50 | 55 | recipient = User.find(recipient_id) |
| 51 | 56 | @note = Note.find(note_id) |
| 52 | 57 | @wiki = @note.noteable |
| 58 | + @project = @note.project | |
| 53 | 59 | mail(:to => recipient.email, :subject => "gitlab | note for wiki | #{@note.project_name}") |
| 54 | 60 | end |
| 55 | 61 | |
| 56 | 62 | def new_merge_request_email(merge_request_id) |
| 57 | 63 | @merge_request = MergeRequest.find(merge_request_id) |
| 64 | + @project = @merge_request.project | |
| 58 | 65 | mail(:to => @merge_request.assignee_email, :subject => "gitlab | new merge request | #{@merge_request.title} ") |
| 59 | 66 | end |
| 60 | 67 | |
| ... | ... | @@ -62,6 +69,7 @@ class Notify < ActionMailer::Base |
| 62 | 69 | recipient = User.find(recipient_id) |
| 63 | 70 | @merge_request = MergeRequest.find(merge_request_id) |
| 64 | 71 | @previous_assignee ||= User.find(previous_assignee_id) |
| 72 | + @project = @merge_request.project | |
| 65 | 73 | mail(:to => recipient.email, :subject => "gitlab | merge request changed | #{@merge_request.title} ") |
| 66 | 74 | end |
| 67 | 75 | |
| ... | ... | @@ -69,6 +77,7 @@ class Notify < ActionMailer::Base |
| 69 | 77 | recipient = User.find(recipient_id) |
| 70 | 78 | @issue = Issue.find(issue_id) |
| 71 | 79 | @previous_assignee ||= User.find(previous_assignee_id) |
| 80 | + @project = @issue.project | |
| 72 | 81 | mail(:to => recipient.email, :subject => "gitlab | changed issue | #{@issue.title} ") |
| 73 | 82 | end |
| 74 | 83 | end | ... | ... |
app/views/dashboard/issues.html.haml
| ... | ... | @@ -8,8 +8,8 @@ |
| 8 | 8 | - if @issues.any? |
| 9 | 9 | - @issues.group_by(&:project).each do |group| |
| 10 | 10 | %div.ui-box |
| 11 | - - project = group[0] | |
| 12 | - %h5= project.name | |
| 11 | + - @project = group[0] | |
| 12 | + %h5= @project.name | |
| 13 | 13 | %ul.unstyled.issues_table |
| 14 | 14 | - group[1].each do |issue| |
| 15 | 15 | = render(:partial => 'issues/show', :locals => {:issue => issue}) | ... | ... |
app/views/dashboard/merge_requests.html.haml
| ... | ... | @@ -7,8 +7,8 @@ |
| 7 | 7 | - if @merge_requests.any? |
| 8 | 8 | - @merge_requests.group_by(&:project).each do |group| |
| 9 | 9 | %ul.unstyled.ui-box |
| 10 | - - project = group[0] | |
| 11 | - %h5= project.name | |
| 10 | + - @project = group[0] | |
| 11 | + %h5= @project.name | |
| 12 | 12 | - group[1].each do |merge_request| |
| 13 | 13 | = render(:partial => 'merge_requests/merge_request', :locals => {:merge_request => merge_request}) |
| 14 | 14 | %hr | ... | ... |