Able to remove popup on click

master
E. Almqvist 3 years ago
parent a3073f36ec
commit 3370da2397
  1. 5
      src/app.rb
  2. 2
      src/db_models.rb
  3. 2
      src/views/layout.slim
  4. 11
      src/views/stylesheets/style.sass

@ -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
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
.flash
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

Loading…
Cancel
Save