Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimothy Andrew <mail@timothyandrew.net>2016-02-12 17:58:39 +0300
committerRémy Coutable <remy@rymai.me>2016-03-15 19:25:37 +0300
commit0444fa560acd07255960284f19b1de6499cd5910 (patch)
tree005ce576bbe661242ee58c1e1ddebd9e665bd9ff /app/mailers/emails/merge_requests.rb
parent178c80a561fa10a157bae6e5d4682b232ae727c7 (diff)
Original implementation to allow users to subscribe to labels
1. Allow subscribing (the current user) to a label - Refactor the `Subscription` coffeescript class - The main change is that it accepts a container, and conducts all DOM queries within its scope. We need this because the labels page has multiple instances of `Subscription` on the same page. 2. Creating an issue or MR with labels notifies users subscribed to those labels - Label `has_many` subscribers through subscriptions. 3. Adding a label to an issue or MR notifies users subscribed to those labels - This only applies to subscribers of the label that has just been added, not all labels for the issue.
Diffstat (limited to 'app/mailers/emails/merge_requests.rb')
-rw-r--r--app/mailers/emails/merge_requests.rb14
1 files changed, 12 insertions, 2 deletions
diff --git a/app/mailers/emails/merge_requests.rb b/app/mailers/emails/merge_requests.rb
index 325996e2e16..680ce975c79 100644
--- a/app/mailers/emails/merge_requests.rb
+++ b/app/mailers/emails/merge_requests.rb
@@ -19,10 +19,20 @@ module Emails
subject: subject("#{@merge_request.title} (##{@merge_request.iid})"))
end
+ def relabeled_merge_request_email(recipient_id, merge_request_id, updated_by_user_id, label_names)
+ setup_merge_request_mail(merge_request_id, recipient_id)
+ @label_names = label_names
+ @updated_by = User.find(updated_by_user_id)
+ mail_answer_thread(@merge_request,
+ from: sender(@merge_request.author_id),
+ to: recipient(recipient_id),
+ subject: subject("#{@merge_request.title} (##{@merge_request.iid})"))
+ end
+
def closed_merge_request_email(recipient_id, merge_request_id, updated_by_user_id)
setup_merge_request_mail(merge_request_id, recipient_id)
- @updated_by = User.find updated_by_user_id
+ @updated_by = User.find(updated_by_user_id)
mail_answer_thread(@merge_request,
from: sender(updated_by_user_id),
to: recipient(recipient_id),
@@ -42,7 +52,7 @@ module Emails
setup_merge_request_mail(merge_request_id, recipient_id)
@mr_status = status
- @updated_by = User.find updated_by_user_id
+ @updated_by = User.find(updated_by_user_id)
mail_answer_thread(@merge_request,
from: sender(updated_by_user_id),
to: recipient(recipient_id),