forked from rubycentral/cfp-app
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add notifcaion preferences to teammates
- manage preferences for all events from profile form - Add tooltip info toggled to show preferences explanations - Add decorator for teammate Improve notifications settings flow for team members (rubycentral#259)
- Loading branch information
Showing
17 changed files
with
98 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
$(document).ready(function () { | ||
if ($('#notification-preferences-toggle').length) { | ||
$('#notification-preferences-toggle').on("click", function(e) { e.preventDefault() }) | ||
} | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#profiles_edit { | ||
.user_teammates_notification_preference { | ||
margin-bottom: 40px; | ||
span.radio { | ||
display: inline-block; | ||
margin: 0px 10px 10px 0px; | ||
label { | ||
text-transform: capitalize; | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
class TeammateDecorator < ApplicationDecorator | ||
delegate_all | ||
|
||
def notification_preference | ||
Teammate::NOTIFICATION_PREFERENCES[teammate.notification_preference] | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
module ProfilesHelper | ||
|
||
def notification_preferences_tooltip | ||
<<-HTML | ||
<p><strong>Notification Preferences</strong></p> | ||
<p><b>All Via Email</b> - You will receive emails for all public and internal comments. You will also receive in-app notications for all public and internal comments. </p> | ||
<p><b>Mention Only Via Email</b> - You will only receive emails for every public and internal comment that directly mentions your @shortname. You will also receive in-app notications for all public and internal comments.</p> | ||
<p><b>In App Only</b> - You will not receive any email notifications and only receive in-app notifications for all public and internal comments.</p> | ||
HTML | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
db/migrate/20180106144145_add_notification_preference_to_teammates.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
class AddNotificationPreferenceToTeammates < ActiveRecord::Migration[5.1] | ||
def change | ||
add_column :teammates, :notification_preference, :string, default: Teammate::ALL | ||
remove_column :teammates, :notifications, :boolean | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters