Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed text and styling for the settings page #9240

Merged
merged 3 commits into from
Mar 3, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
98 changes: 52 additions & 46 deletions app/views/users/settings.html.erb
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
<form name="settingsForm" action="/save_settings" method='post' data-remote="true">
<div class="emailSettings">
<h4><b>Notification Settings</b></h4>
<h4><b>Email Notifications</b></h4>
<hr style="width: 35%; margin-left: 0;" />

<h4><b>I want to be notified by email for:</b></h4>

<div style="display: inline-flex; justify-content: space-between; width: 90%;">
<span>Do you want to be notified by a email for comments on your posts? </span>
<span>Comments on my posts </span>
<span>
<label class="switch">
<p> Notification switch </p>
Expand All @@ -18,7 +20,7 @@
<br />

<div style="display: inline-flex; justify-content: space-between; width: 90%;">
<span>Do you want to be notified by a email for likes on your posts? </span>
<span>Likes on my posts </span>
<span>
<label class="switch">
<p> Notification switch </p>
Expand All @@ -32,7 +34,7 @@
<br />

<div style="display: inline-flex; justify-content: space-between; width: 90%;">
<span>Do you want to be notified by a email for comments on all posts you've commented on? </span>
<span>Comments on all posts I've commented on </span>
<span>
<label class="switch">
<p> Notification switch </p>
Expand All @@ -47,7 +49,7 @@

<% if logged_in_as(['admin', 'moderator']) %>
<div style="display: inline-flex; justify-content: space-between; width: 90%;">
<span>Do you want to be notified by a email for moderation emails? </span>
<span>Moderation emails </span>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was this part of the changes in the issue? Also, line 149 and 163

<span>
<label class="switch">
<p> Notification switch </p>
Expand All @@ -60,10 +62,12 @@
<br />
<br />
<% end %>


<br />
<h4><b>Email notifications are sent for each post in topics you follow. If you prefer to receive a digest, choose one of these options: </b></h4>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love it. Thank you so much!!!


<div style="display: inline-flex; justify-content: space-between; width: 90%;">
<span>Do you want to receive a customized digest weekly?</span>
<span>In a weekly digest </span>
<span>
<label style=" vertical-align: middle;" class="switch">
<p> Notification switch </p>
Expand All @@ -77,7 +81,7 @@
<br />

<div style="display: inline-flex; justify-content: space-between; width: 90%;">
<span>Do you want to receive a customized digest daily?</span>
<span>In a daily digest</span>
<span>
<label style=" vertical-align: middle;" class="switch">
<p> Notification switch </p>
Expand All @@ -90,8 +94,45 @@
<br />
<br />

<% if current_user.can_moderate? %>
<div style="display: inline-flex; justify-content: space-between; width: 90%;">
<span>In a weekly digest for unmoderated posts</span>
<span>
<label style=" vertical-align: middle;" class="switch">
<p> Notification switch </p>
<input type="checkbox" name="digest:weekly:spam" <% if UserTag.exists?(current_user.id, 'digest:weekly:spam') %>checked<% end %>>
<span class="slider round"></span>
</label>
</span>
</div>

<br />
<br />

<div style="display: inline-flex; justify-content: space-between; width: 90%;">
<span>In a daily digest for unmoderated posts</span>
<span>
<label style=" vertical-align: middle;" class="switch">
<p> Notification switch </p>
<input type="checkbox" name="digest:daily:spam" <% if UserTag.exists?(current_user.id, 'digest:daily:spam') %>checked<% end %>>
<span class="slider round"></span>
</label>
</span>
</div>

<br />
<br />
<% end %>

<br />

Comment on lines +97 to +128
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some of these lines differ from what was there previously, is this also part of the issue changes?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@RuthNjeri the changes mentioned in the issue are just for when we login as a "user". I've extended it for "moderator" and "admin" logins too to maintain uniformity. Hence those changes.
Thanks!

<h4><b>Browser Notifications</b></h4>
<hr style="width: 35%; margin-left: 0;" />

<h4><b>I want to receive browser notifications:</b></h4>

<div style="display: inline-flex; justify-content: space-between; width: 90%;">
<span>Do you want to receive a browser notification when you are mentioned?</span>
<span>When I'm mentioned</span>
<span>
<label style=" vertical-align: middle;" class="switch">
<p> Notification switch </p>
Expand All @@ -105,7 +146,7 @@
<br />

<div style="display: inline-flex; justify-content: space-between; width: 90%;">
<span>Do you want to receive a browser notification for all ?</span>
<span>For everything</span>
<span>
<label style=" vertical-align: middle;" class="switch">
<p> Notification switch </p>
Expand All @@ -119,7 +160,7 @@
<br />

<div style="display: inline-flex; justify-content: space-between; width: 90%;">
<span>Do you want to receive a browser notification when someone likes your work?</span>
<span>When someone likes my work</span>
<span>
<label style=" vertical-align: middle;" class="switch">
<p> Notification switch </p>
Expand All @@ -130,7 +171,6 @@
</div>

<br />
<br />


<!-- <div style="display: inline-flex; justify-content: space-between; width: 90%;">-->
Expand Down Expand Up @@ -171,40 +211,6 @@

<!-- <br />-->
<!-- <br />-->


<br>
<% if current_user.can_moderate? %>
<h4><b>Spam Digest Settings</b></h4>
<hr style="width: 35%; margin-left: 0;" />
<div style="display: inline-flex; justify-content: space-between; width: 90%;">
<span>Do you want to receive a weekly digest for unmoderated posts?</span>
<span>
<label style=" vertical-align: middle;" class="switch">
<p> Notification switch </p>
<input type="checkbox" name="digest:weekly:spam" <% if UserTag.exists?(current_user.id, 'digest:weekly:spam') %>checked<% end %>>
<span class="slider round"></span>
</label>
</span>
</div>

<br />
<br />

<div style="display: inline-flex; justify-content: space-between; width: 90%;">
<span>Do you want to receive a daily digest for unmoderated posts?</span>
<span>
<label style=" vertical-align: middle;" class="switch">
<p> Notification switch </p>
<input type="checkbox" name="digest:daily:spam" <% if UserTag.exists?(current_user.id, 'digest:daily:spam') %>checked<% end %>>
<span class="slider round"></span>
</label>
</span>
</div>

<br />
<br />
<% end %>
</div>

<br />
Expand Down