-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
114 additions
and
200 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 |
---|---|---|
|
@@ -99,7 +99,7 @@ body { | |
width: auto; | ||
} | ||
|
||
.unread { | ||
.bg-primary-light { | ||
background-color: #e6f3ff; | ||
} | ||
|
||
|
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 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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,33 @@ | ||
<% unless @notifications.empty? %> | ||
<% @notifications.each do |notification| %> | ||
<% class_names = notification.read ? "card mb-3 notification" : "card unread mb-3 notification" %> | ||
<div class="<%= class_names %>" style="width:100%"> | ||
<div class="card mb-3 <%= "bg-primary-light" if not notification.read %>"> | ||
<div class="card-body"> | ||
<%= link_to destroy_and_redirect_notification_path(notification), {controller: notification, action: 'destroy_and_redirect', method: :delete} do %> | ||
<h5 class="card-title"> | ||
<%= notification.title %> | ||
</h5> | ||
<%= simple_format(notification.message).html_safe%> | ||
<% end %> | ||
|
||
<div class="pull-right"> | ||
<%= link_to notification, method: :delete, data: { confirm: 'Are you sure you want to delete this notification?' }, class: 'icon-link delete' do %> | ||
<%= fa_icon('trash', class: 'big-icon') %> | ||
<% end %> | ||
</div> | ||
<%# Delete link %> | ||
<%= link_to fa_icon('trash lg'), notification_path(notification), | ||
method: :delete, | ||
title: 'Delete', | ||
data: { toggle: 'tooltip', placement: 'top', | ||
confirm: 'Are you sure you want to delete this notification?' }, | ||
class: "float-right" %> | ||
<%# Mark as read link %> | ||
<%= link_to fa_icon('check lg'), mark_as_read_notification_path(notification), | ||
title: 'Mark as read', | ||
data: { toggle: 'tooltip', placement: 'top'}, | ||
class: "float-right mr-2" unless notification.read %> | ||
<%# Notification title %> | ||
<h5 class="card-title"> | ||
<%= link_to notification.title, mark_as_read_and_redirect_notification_path(notification) %> | ||
<br> | ||
<span class="small"> | ||
<%= I18n.l notification.created_at,format: :short%> (<%= time_ago_in_words notification.created_at %> ago) | ||
</span> | ||
</h5> | ||
<%= simple_format(notification.message).html_safe %> | ||
</div> | ||
</div> | ||
<% end %> | ||
<% else %> | ||
<p>You don't have any notifications at the moment.</p> | ||
<div id="no-notifications" class="text-center">No unread notifications<div> | ||
<% 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 |
---|---|---|
@@ -1,5 +1,3 @@ | ||
<p id="notice"><%= notice %></p> | ||
|
||
<h1>Notifications</h1> | ||
|
||
<%= render 'list' %> |
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
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 |
---|---|---|
|
@@ -6,5 +6,6 @@ | |
title { 'Test Notification' } | ||
message { 'This is a test' } | ||
read { false } | ||
link { 'https://example.com' } | ||
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
Oops, something went wrong.