diff options
author | Zeger-Jan van de Weg <mail@zjvandeweg.nl> | 2016-01-09 12:47:31 +0100 |
---|---|---|
committer | Zeger-Jan van de Weg <mail@zjvandeweg.nl> | 2016-01-09 12:47:31 +0100 |
commit | 36d858bcf98868426256ce51a28e7029b38e0c2d (patch) | |
tree | 7a1b458c65ebc46ad3533dd361a753621c418d89 /app | |
parent | 58867eff46dc6886b85bfe5a787341f224d09421 (diff) | |
download | gitlab-ce-36d858bcf98868426256ce51a28e7029b38e0c2d.tar.gz |
Add #can_unsubscribe? to SentNotification
Diffstat (limited to 'app')
-rw-r--r-- | app/models/sent_notification.rb | 4 | ||||
-rw-r--r-- | app/views/layouts/notify.html.haml | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/app/models/sent_notification.rb b/app/models/sent_notification.rb index fd12615717b..03108da17be 100644 --- a/app/models/sent_notification.rb +++ b/app/models/sent_notification.rb @@ -62,6 +62,10 @@ class SentNotification < ActiveRecord::Base end end + def can_unsubscribe? + !for_commit? + end + def for_commit? noteable_type == "Commit" end diff --git a/app/views/layouts/notify.html.haml b/app/views/layouts/notify.html.haml index da7de41abad..07f9be12f99 100644 --- a/app/views/layouts/notify.html.haml +++ b/app/views/layouts/notify.html.haml @@ -45,7 +45,7 @@ -# Don't link the host is the line below, one link in the email is easier to quickly click than two. You're receiving this email because of your account on #{Gitlab.config.gitlab.host}. If you'd like to receive fewer emails, you can - - if @sent_notification && !@sent_notification.for_commit? + - if @sent_notification && @sent_notification.can_unsubscribe? = link_to "unsubscribe", unsubscribe_sent_notification_url(@sent_notification) from this thread or adjust your notification settings. |