@ -173,8 +173,13 @@ post "/auctions" do
newid, resp = Auction.create user_id, title, description, init_price, delta_time, category_choices
if newid then
flash[:success] = "Auction posted!"
redirect "/auctions/#{newid}"
else
flash[:error] = resp
redirect "/auctions/new"
end
get "/auctions/:id" do
@ -215,7 +215,7 @@ class Auction < EntityModel
# Validate the input
check, errorstr = self.validate_ah(title, description, init_price, delta_time)
return errorstr unless check
return check, errorstr unless check
# Get current UNIX time
start_time = Time.now.to_i
@ -29,7 +29,7 @@ html lang="en"
a.inlbutton href="/profile" target="_self"
img.avatar src="#{session_user.avatar}" alt="Profile"
.content-container
.flash
div class="flash" onclick="this.remove();"
- flash.each do |k, v|
div class="flash-#{k}"
| #{v}
@ -142,12 +142,15 @@ a.button:hover
background-color: $special_clr
position: absolute
position: fixed
text-align: center
top: 5rem
top: 4rem
left: .8rem
font-size: 1rem
font-weight: bold
animation: flash .2s ease-in alternate
background: $bg_alt_clr
transition: .4s opacity
&-error
color: $fg_error
@ -161,6 +164,10 @@ a.button:hover
border: $border_size solid $green_clr
border-radius: $border_radius
.flash:hover
cursor: pointer
opacity: .5
img.avatar, img.avatar_big
background: $bg_clr
width: 2.25rem