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
Kazuhiko Shiozaki
gitlab-ce
Commits
36d858bc
Commit
36d858bc
authored
Jan 09, 2016
by
Zeger-Jan van de Weg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add #can_unsubscribe? to SentNotification
parent
58867eff
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
1 deletion
+5
-1
app/models/sent_notification.rb
app/models/sent_notification.rb
+4
-0
app/views/layouts/notify.html.haml
app/views/layouts/notify.html.haml
+1
-1
No files found.
app/models/sent_notification.rb
View file @
36d858bc
...
@@ -62,6 +62,10 @@ class SentNotification < ActiveRecord::Base
...
@@ -62,6 +62,10 @@ class SentNotification < ActiveRecord::Base
end
end
end
end
def
can_unsubscribe?
!
for_commit?
end
def
for_commit?
def
for_commit?
noteable_type
==
"Commit"
noteable_type
==
"Commit"
end
end
...
...
app/views/layouts/notify.html.haml
View file @
36d858bc
...
@@ -45,7 +45,7 @@
...
@@ -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.
-# 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
}
.
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 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
)
=
link_to
"unsubscribe"
,
unsubscribe_sent_notification_url
(
@sent_notification
)
from this thread or
from this thread or
adjust your notification settings.
adjust your notification settings.
...
...
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