-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature/pbrh+ 45 confirm returned item (#203)
* write tests and hate ruby on rails * fix factory bots * fucking errors * fix last tests and add more locale translations * rubocop * fix crash when another user is on waitlist * fix waitlist notifications not being shown correctly Co-authored-by: Julian <julian@DESKTOP-I3NQ0TP>
- Loading branch information
1 parent
64ee699
commit d42253f
Showing
38 changed files
with
647 additions
and
86 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# class of a basic return accepted notification. | ||
class ReturnAcceptedNotification < ApplicationRecord | ||
acts_as :notification | ||
|
||
belongs_to :owner, class_name: "User" | ||
belongs_to :item | ||
|
||
validates :receiver, presence: true | ||
validates :date, presence: true | ||
|
||
def title | ||
I18n.t "views.notifications.return_accepted.title" | ||
end | ||
|
||
def description | ||
I18n.t "views.notifications.return_accepted.description", owner: owner.name, item: item.name | ||
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,18 @@ | ||
# class of a basic return declined notification. | ||
class ReturnDeclinedNotification < ApplicationRecord | ||
acts_as :notification | ||
|
||
belongs_to :owner, class_name: "User" | ||
|
||
validates :receiver, presence: true | ||
validates :date, presence: true | ||
validates :item_name, presence: true | ||
|
||
def title | ||
I18n.t "views.notifications.return_declined.title" | ||
end | ||
|
||
def description | ||
I18n.t "views.notifications.return_declined.description", owner: owner.name, item: item_name | ||
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
72 changes: 72 additions & 0 deletions
72
app/views/notifications/_added_to_waitlist_notification.erb
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,72 @@ | ||
<style> | ||
.button { | ||
background-color: grey; | ||
color: black; | ||
margin-top: 1em; | ||
font-family: Roboto, sans-serif; | ||
float: bottom; | ||
} | ||
.button:hover { | ||
background-color: #B1063A; | ||
color: #efcdd8; | ||
border-color: #efcdd8; | ||
} | ||
.subtitle { | ||
font-family: Roboto, sans-serif; | ||
font-weight: bold; | ||
font-size: 20px; | ||
spacing: auto spacing; | ||
color: #b8043c; | ||
margin-bottom: 7px; | ||
margin-top: 0.5em; | ||
} | ||
.description { | ||
font-family: Roboto, sans-serif; | ||
} | ||
.btn-primary{ | ||
background-color: #dddfe0 !important; | ||
border: #dddfe0 !important; | ||
color: black !important; | ||
margin: 5px; | ||
} | ||
</style> | ||
|
||
<button type="button" style= "background-color: <%= notification.unread == true ? "#cce4ec" : "#dddfe0c" %> !important" | ||
class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#<%="notificationModal#{notification.id}"%>"> | ||
<div class="notification"> | ||
<h2 class="subtitle"> | ||
<%= notification.title %> | ||
</h2> | ||
<p class="description"> | ||
<%= notification.description %> | ||
</p> | ||
</div> | ||
</button> | ||
|
||
<!-- Modal --> | ||
<div class="modal fade" id="<%="notificationModal#{notification.id}"%>" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true"> | ||
<div class="modal-dialog"> | ||
<div class="modal-content"> | ||
<div class="modal-header"> | ||
<h5 class="modal-title" id="exampleModalLabel"><%= notification.title %></h5> | ||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button> | ||
</div> | ||
<div class="modal-body"> | ||
<p> | ||
<%= notification.description %> | ||
</p> | ||
</div> | ||
|
||
<div class="modal-footer"> | ||
<%if notification.active == true %> | ||
<%end%> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<script> | ||
$('<%="notificationModal#{notification.id}" %>').on('shown.bs.modal', function (e) { | ||
"<% notification.mark_as_read%>"; | ||
}) | ||
</script> |
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.