Skip to content
This repository has been archived by the owner on Jul 30, 2019. It is now read-only.

Commit

Permalink
Merge pull request #251 from 18F/develop
Browse files Browse the repository at this point in the history
Deploy 1/25/16 #2
  • Loading branch information
adelevie committed Jan 25, 2016
2 parents ebdcbc9 + 7374cd5 commit d16cf2a
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 2 deletions.
2 changes: 0 additions & 2 deletions app/assets/stylesheets/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,6 @@ textarea#auction_description {
}

.bid-deadline-box {
height: 5rem;
position: relative;

.bid-deadline-box-children {
position: relative;
Expand Down
8 changes: 8 additions & 0 deletions app/helpers/auction_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,12 @@ def auction_label(auction)
'Open'
end
end

def auction_human_start_time(auction_time)
if auction_time < Time.now
"#{distance_of_time_in_words(Time.now, auction_time)} ago"
else
"in #{distance_of_time_in_words(Time.now, auction_time)}"
end
end
end
3 changes: 3 additions & 0 deletions app/views/auctions/_bids_and_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
<div class="bid-deadline-box-children">
<span class="bid-deadline">
Bid Deadline: <%= distance_of_time_in_words(Time.now, auction.end_datetime) %> left
</span><br/>
<span class="bid-deadline">
Bid start time: <%= auction_human_start_time(auction.start_datetime) %>
</span>
</div>
</div>
5 changes: 5 additions & 0 deletions app/views/auctions/_winning_bid.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,8 @@
<% else %>
<p>No bids</p>
<% end %>
<% unless auction.over? %>
<span class="bid-deadline">
Bid start time: <%= auction_human_start_time(auction.start_datetime) %>
</span>
<% end %>
2 changes: 2 additions & 0 deletions app/views/auctions/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
</p>
<p class="auction-label"><% if @auction.over? %>Auction ended at:<% else %>Bid deadline:<% end %></p>
<p class="auction-label-info"><%= @auction.end_datetime.strftime("%m/%d/%Y at %I:%M %p %Z") %></p>
<p class="auction-label"><% if @auction.over? %>Auction started at:<% else %>Bid start time:<% end %></p>
<p class="auction-label-info"><%= @auction.start_datetime.strftime("%m/%d/%Y at %I:%M %p %Z") %></p>
<p>
<a href="<%= new_auction_bid_path(@auction) %>" class='usa-button usa-button'>BID »</a>
</p>
Expand Down
1 change: 1 addition & 0 deletions spec/features/bidder_interacts_with_auction_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@

expect(page).to have_content("Open")
expect(page).to have_content(current_auction.end_datetime.strftime('%m/%d/%Y at %I:%M %p %Z'))
expect(page).to have_content(current_auction.start_datetime.strftime('%m/%d/%Y at %I:%M %p %Z'))
end

scenario "Viewing a closed auction" do
Expand Down

0 comments on commit d16cf2a

Please sign in to comment.