Search params

master
E. Almqvist 3 years ago
parent a49d964b32
commit 7da34e816d
  1. 5
      src/TODO.md
  2. 10
      src/lib/db_models.rb
  3. 9
      src/views/auction/index.slim
  4. 2
      src/views/index.slim
  5. 1
      src/views/stylesheets/style.sass

@ -1,12 +1,13 @@
# TODO
- Auction searching at index 40%
- Bidding 90% TODO: refactor
- Recent posts (profile & index page)
- Bidding 99% TODO: add money check
----------------
- Auction expiry (unable to bid after x time)
- User reviews
- Yardoc 50%
----------------
- Remove bids
- Remove posts
## Refactor
- Funds transfer logic for auctions?

@ -290,7 +290,7 @@ class Auction < EntityModel
@user_id = data["user_id"].to_i
@title = data["title"]
@description = data["description"]
@init_price = data["price"].to_i
@init_price = data["price"].to_f
@start_time = data["start_time"].to_i
@end_time = data["end_time"].to_i
end
@ -348,6 +348,10 @@ class Auction < EntityModel
ah && ah.expired?
end
def poster
User.find_by_id @user_id
end
def images
Image.get_relation @id
end
@ -394,9 +398,9 @@ class Auction < EntityModel
def current_bid
mbid = self.max_bid
if mbid != nil then
return mbid.amount
return mbid.amount.to_f
else
return @init_price
return @init_price.to_f
end
end

@ -18,6 +18,13 @@
input type="checkbox" name="expired"
label Expired?
- if Category.get_all.length > 0
label Categories
- Category.get_all.each do |category|
.checkbox-container
input type="checkbox" name="category-#{category.id}" value="#{category.id}"
label style="color: #{category.color};" = "#{category.name}"
input type="submit" value="Search"
a.button href="/auctions" = "Clear Filters"
@ -39,6 +46,8 @@
- if auction.end_time and auction.end_time - Time.now.to_i <= 0
span.red
| [Expired]
h4
| Posted by: #{auction.poster.name}
h4
| #{COINS_PREFIX}#{auction.current_bid}#{COINS_SUFFIX}
p

@ -30,6 +30,8 @@
- if auction.end_time and auction.end_time - Time.now.to_i <= 0
span.red
| [Expired]
h4
| Posted by: #{auction.poster.name}
h4
| #{COINS_PREFIX}#{auction.current_bid}#{COINS_SUFFIX}
p

@ -481,6 +481,7 @@ ul.list-container
width: 40rem
margin-right: 4rem
.form-container
margin-top: 8rem
form
padding: 0
width: inherit

Loading…
Cancel
Save