diff --git a/src/TODO.md b/src/TODO.md index 74293d1..1730c4a 100644 --- a/src/TODO.md +++ b/src/TODO.md @@ -1,5 +1,4 @@ # TODO - - Auction searching at index 40% - Post editing - User reviews - Yardoc 50% diff --git a/src/lib/db_models.rb b/src/lib/db_models.rb index e8c27fb..e698eb3 100644 --- a/src/lib/db_models.rb +++ b/src/lib/db_models.rb @@ -350,7 +350,7 @@ class Auction < EntityModel if ah_ids == [] then ah_ids = Auction_Category_relation.category_auction_ids(catid) # first time then include all else - ah_ids |= Auction_Category_relation.category_auction_ids(catid) # union + ah_ids |= Auction_Category_relation.category_auction_ids(catid) # do union for all ids (prevent dupes) end end filters << "id IN (#{ah_ids.join(", ")})" # check if the auction id is any of the ids calculated above diff --git a/src/views/auction/edit.slim b/src/views/auction/edit.slim new file mode 100644 index 0000000..e69de29 diff --git a/src/views/auction/index.slim b/src/views/auction/index.slim index c440148..fd7ba00 100644 --- a/src/views/auction/index.slim +++ b/src/views/auction/index.slim @@ -10,9 +10,9 @@ label Price range .range-container label for="price-min" From: - input type="number" name="min_price" value="#{params[:min_price].to_f >= 0 ? params[:min_price] : ""}" min="#{MIN_INIT_PRICE}" max="#{MAX_INIT_PRICE}" + input type="number" name="min_price" value="#{params[:min_price]}" min="#{MIN_INIT_PRICE}" max="#{MAX_INIT_PRICE}" label for="price-max" To: - input type="number" name="max_price" value="#{params[:min_price].to_f >= 0 ? params[:min_price] : ""}" min="#{MIN_INIT_PRICE}" max="#{MAX_INIT_PRICE}" + input type="number" name="max_price" value="#{params[:min_price]}" min="#{MIN_INIT_PRICE}" max="#{MAX_INIT_PRICE}" .checkbox-container input type="checkbox" name="expired" checked=("checked" if params[:expired] == "on") @@ -29,25 +29,29 @@ article.post-container.card h2 Results - ul.list-container - - auctions.each do |auction| - li - a href="/auctions/#{auction.id}" - div style="background-image: url(#{auction.images[0].url})" - .info-container - h3 - | #{auction.title} - - if auction.time_left > 0 - | ( - span.red - | #{auction.time_left_s} - | ) - - 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 - | #{auction.description} + + - if auctions.length > 0 + ul.list-container + - auctions.each do |auction| + li + a href="/auctions/#{auction.id}" + div style="background-image: url(#{auction.images[0].url})" + .info-container + h3 + | #{auction.title} + - if auction.time_left > 0 + | ( + span.red + | #{auction.time_left_s} + | ) + - 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 + | #{auction.description} + - else + h3.tcenter No results :( diff --git a/src/views/stylesheets/style.sass b/src/views/stylesheets/style.sass index d444944..8f40a0f 100644 --- a/src/views/stylesheets/style.sass +++ b/src/views/stylesheets/style.sass @@ -429,12 +429,6 @@ ul.list-container max-height: 50rem width: 100% - h3.tcenter - opacity: .4 - font-weight: normal - margin: 42% 0 - - #settings form @@ -481,9 +475,9 @@ ul.list-container border-radius: $border_radius aside.card - width: 40rem + width: 20rem margin-right: 4rem - margin-top: 8rem + margin-top: 4rem .form-container form padding: 0 @@ -491,6 +485,13 @@ ul.list-container article.post-container height: 90% + width: 50rem + + h3.tcenter + opacity: .4 + font-weight: normal + margin: 42% 0 + ul height: 100% diff --git a/src/views/user/profile.slim b/src/views/user/profile.slim index b0bc3d4..1f368c8 100644 --- a/src/views/user/profile.slim +++ b/src/views/user/profile.slim @@ -43,28 +43,28 @@ #posts.card h2 Recent posts - - if user.auctions.length > 0 - article.post-container.card - ul.list-container - - user.auctions.reverse.each do |auction| - li - a href="/auctions/#{auction.id}" - div style="background-image: url(#{auction.images[0].url})" - .info-container - h3 - | #{auction.title} - - if auction.time_left > 0 - | ( - span.red - | #{auction.time_left_s} - | ) - - if auction.end_time and auction.end_time - Time.now.to_i <= 0 - span.red - | [Expired] - h4 - | #{COINS_PREFIX}#{auction.current_bid}#{COINS_SUFFIX} - p - | #{auction.description} - - else - h3.tcenter No activity yet... + article.post-container.card + - if user.auctions.length > 0 + ul.list-container + - user.auctions.reverse.each do |auction| + li + a href="/auctions/#{auction.id}" + div style="background-image: url(#{auction.images[0].url})" + .info-container + h3 + | #{auction.title} + - if auction.time_left > 0 + | ( + span.red + | #{auction.time_left_s} + | ) + - if auction.end_time and auction.end_time - Time.now.to_i <= 0 + span.red + | [Expired] + h4 + | #{COINS_PREFIX}#{auction.current_bid}#{COINS_SUFFIX} + p + | #{auction.description} + - else + h3.tcenter No activity yet...