-
Notifications
You must be signed in to change notification settings - Fork 4
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
1 parent
34d559c
commit 7c73208
Showing
47 changed files
with
1,654 additions
and
1,015 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
24 changes: 24 additions & 0 deletions
24
app/components/common/notifications/icon/component.html.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,24 @@ | ||
|
||
<%- if @readed %> | ||
<%- if @notification_type == 'AuctionWinnerNotification' %> | ||
<span class="c-notification__header__icon o-trophy-icon"></span> | ||
<h5 class="c-notification__header__title">Oled võitnud! <span class="o-new"></span></h5> | ||
<%- elsif @notification_type == 'OfferNotification' %> | ||
<span class="c-notification__header__icon o-hammer-icon"></span> | ||
<h5 class="c-notification__header__title">OfferNotification <span class="o-new"></span></h5> | ||
<%- elsif @notification_type == 'AuctionLooserNotification' %> | ||
<span class="c-notification__header__icon o-hammer-icon"></span> | ||
<h5 class="c-notification__header__title">You losed! <span class="o-new"></span></h5> | ||
<%- end %> | ||
<%- else %> | ||
<%- if @notification_type == 'AuctionWinnerNotification' %> | ||
<span class="o-trophy-icon"></span> | ||
<h5 class="c-notification__header__title">Oled võitnud! <span class="o-new"></span></h5> | ||
<%- elsif @notification_type == 'OfferNotification' %> | ||
<span class="o-hammer-icon"></span> | ||
<h5 class="c-notification__header__title">OfferNotification <span class="o-new"></span></h5> | ||
<%- elsif @notification_type == 'AuctionLooserNotification' %> | ||
<span class="o-hammer-icon"></span> | ||
<h5 class="c-notification__header__title">You losed! <span class="o-new"></span></h5> | ||
<%- 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,16 @@ | ||
module Common | ||
module Notifications | ||
module Icon | ||
class Component < ViewComponent::Base | ||
attr_reader :notification_type, :readed | ||
|
||
def initialize(notification:, readed:) | ||
@notification_type = notification.type | ||
@readed = readed | ||
|
||
super | ||
end | ||
end | ||
end | ||
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 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,14 @@ | ||
module Offer::Broadcast | ||
extend ActiveSupport::Concern | ||
|
||
included do | ||
after_create_commit :broadcast_replace_auction | ||
after_update_commit :broadcast_replace_auction | ||
end | ||
|
||
def broadcast_replace_auction | ||
return if auction.platform == 'blind' || auction.platform.nil? | ||
|
||
Offers::ReplaceBroadcastService.call({ offer: self }) | ||
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 @@ | ||
module Offer::Filter | ||
extend ActiveSupport::Concern | ||
|
||
included do | ||
scope :filter_by_domain_name, -> { | ||
includes(:auction).where("auctions.domain_name LIKE ?", "%#{params[:domain_name]}%") | ||
} | ||
end | ||
|
||
class_methods do | ||
def search(params = {}) | ||
sort_by = params[:sort_by] || 'created_at' | ||
sort_direction = params[:sort_direction] || 'desc' | ||
|
||
includes(:auction).order("#{sort_by} #{sort_direction}") | ||
end | ||
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.