diff --git a/db/db.go b/db/db.go index 058d56ef02d852fb4d282b044a13ea942416207d..b992d3563853a8c2722b8a61510ece26b1be1840 100644 --- a/db/db.go +++ b/db/db.go @@ -46,6 +46,7 @@ type User struct { Money int64 `pg:"money,use_zero"` IsAdmin bool `pg:"is_admin,default:false"` IsPultosch bool `pg:"is_pultosch,default:false"` + Credits int64 `pg:"credits,default:5000"` Spends []*Spend `pg:"rel:has-many,join_fk:user_schacc"` } diff --git a/homepage/new.go b/homepage/new.go index 43498235dec00d38a74f41949d623b6b19159232..609169b768b258b2f34869a67c2c72b16a0f5ab0 100644 --- a/homepage/new.go +++ b/homepage/new.go @@ -94,7 +94,12 @@ func NewHandler(w http.ResponseWriter, r *http.Request) { return } - const credit = 5000 + var credit int64 + if session.User.Credits > 0 { + credit = session.User.Credits + } else { + credit = 5000 + } if session.User.Money < prod.Price*int64(amount)-credit { errorMsg("Nincs elég egyenleged") return diff --git a/static/images/cuba_libre.png b/static/images/cuba_libre.png new file mode 100644 index 0000000000000000000000000000000000000000..2a923a9e7f6c7af707714a09874bdfaa1c7bf0c2 Binary files /dev/null and b/static/images/cuba_libre.png differ diff --git a/static/images/darknstormy.png b/static/images/darknstormy.png new file mode 100644 index 0000000000000000000000000000000000000000..19f536187a58341b1ec3cc736f5a4eb3df61eb68 Binary files /dev/null and b/static/images/darknstormy.png differ diff --git a/static/images/jager.png b/static/images/jager.png new file mode 100644 index 0000000000000000000000000000000000000000..617bd35966711655213c4b420b3934a8ba402b1b Binary files /dev/null and b/static/images/jager.png differ diff --git a/static/images/long_island.png b/static/images/long_island.png new file mode 100644 index 0000000000000000000000000000000000000000..88bfa0c0a30855a6ea05d400e56c0c3b74565248 Binary files /dev/null and b/static/images/long_island.png differ diff --git a/static/images/mojito.png b/static/images/mojito.png new file mode 100644 index 0000000000000000000000000000000000000000..e6de8aa3971f2e46c11330308bff4e50d68d6def Binary files /dev/null and b/static/images/mojito.png differ diff --git a/static/images/screw_driver.png b/static/images/screw_driver.png new file mode 100644 index 0000000000000000000000000000000000000000..d6a20d00a57e14ee40c7b3d059e6f68c0f590f5b Binary files /dev/null and b/static/images/screw_driver.png differ diff --git a/static/images/tatratea.png b/static/images/tatratea.png new file mode 100644 index 0000000000000000000000000000000000000000..5c3df8a79fba8c4f389589cd473fa7fc19f3ae10 Binary files /dev/null and b/static/images/tatratea.png differ diff --git a/static/images/tequila_sunrise.png b/static/images/tequila_sunrise.png new file mode 100644 index 0000000000000000000000000000000000000000..2adb8604439d08f3db0c7a03e51b18441a0d5251 Binary files /dev/null and b/static/images/tequila_sunrise.png differ diff --git a/static/images/unicum.png b/static/images/unicum.png new file mode 100644 index 0000000000000000000000000000000000000000..87f54a30db5d1556f76bf530241f1ac17f02d02a Binary files /dev/null and b/static/images/unicum.png differ