This repository has been archived by the owner on Jul 30, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #180 from 18F/develop
Deploy #2 12/30
- Loading branch information
Showing
8 changed files
with
269 additions
and
28 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,9 @@ | ||
module AuctionHelper | ||
def auction_status(auction) | ||
if auction.available? | ||
'Open' | ||
else | ||
'Closed' | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
<% if auction.over? %> | ||
<% if auction.bids? %> | ||
<% if current_user %> | ||
<% if auction.user_is_winning_bidder?(current_user) %> | ||
<div class="usa-alert usa-alert-success auction-alert"> | ||
<div class="usa-alert-body"><h3>You are the winner</h3></div> | ||
<p class="usa-alert-text">Congratulations! We will contact you with further instructions.</p> | ||
</div> | ||
<% elsif auction.user_is_bidder?(current_user) %> | ||
<div class="usa-alert usa-alert-error auction-alert"> | ||
<div class="usa-alert-body"><h3>You are not the winner</h3></div> | ||
<p class="usa-alert-text">Someone else placed a lower bid than you.</p> | ||
</div> | ||
<% end %> | ||
<% else %> | ||
<div class="usa-alert usa-alert-info auction-alert"> | ||
<div class="usa-alert-body"> | ||
<h3 class="usa-alert-heading">Auction Now Closed</h3> | ||
</div> | ||
</div> | ||
<% end %> | ||
<% else %> | ||
<div class="usa-alert usa-alert-info auction-alert"> | ||
<div class="usa-alert-body"> | ||
<h3 class="usa-alert-heading">Auction Now Closed</h3> | ||
<p class="usa-alert-text">This auction ended with no bids.</p> | ||
</div> | ||
</div> | ||
<% end %> | ||
<% elsif auction.available? && auction.bids? && current_user && auction.user_is_bidder?(current_user) %> | ||
<% if flash["bid"] %> | ||
<div class="usa-alert usa-alert-success"> | ||
<div class="usa-alert-body"> | ||
<h3 class="usa-alert-heading">Bid Submitted! You currently have the winning bid.</h3> | ||
<p class="usa-alert-text">If your bid is selected as the winner, we will contact you with further instructions. <a href="<%= my_bids_path %>">View your bids »</a></p> | ||
</div> | ||
</div> | ||
<% elsif auction.user_is_winning_bidder?(current_user) %> | ||
<div class="usa-alert usa-alert-success auction-alert"> | ||
<div class="usa-alert-body"> | ||
<h3 class="usa-alert-heading">You currently have the winning bid.</h3> | ||
<p class="usa-alert-text">If your bid is selected as the winner, we will contact you with further instructions.</p> | ||
</div> | ||
</div> | ||
<% else %> | ||
<div class="usa-alert usa-alert-error auction-alert"> | ||
<div class="usa-alert-body"> | ||
<h3 class="usa-alert-heading">You currently do not have the winning bid.</h3> | ||
<p class="usa-alert-text">You must enter a new lower bid to win this auction.</p> | ||
</div> | ||
</div> | ||
<% end %> | ||
<%# display nothing if in the future %> | ||
<% 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