diff --git a/backend/prepare.sql b/backend/prepare.sql index de14924..8592e0a 100644 --- a/backend/prepare.sql +++ b/backend/prepare.sql @@ -51,6 +51,14 @@ CREATE TABLE IF NOT EXISTS receipt_products ( FOREIGN KEY(product_price) REFERENCES product_prices(id) ); +CREATE TABLE IF NOT EXISTS product_images ( + id INTEGER PRIMARY KEY, + product INTEGER NOT NULL UNIQUE, + data BLOB NOT NULL, + + FOREIGN KEY(product) REFERENCES products(id) +); + INSERT OR REPLACE INTO users (name, email, password_hash, balance_dkk_cent) VALUES ('User','test@email.com','08ce0220f6d63d85c3ac313e308f4fca35ecfb850baa8ddb924cfab98137b6b18b4a8e027067cb98802757df1337246a0f3aa25c44c2b788517a871086419dcf',10000); diff --git a/backend/public/deno.jsonc b/backend/public/deno.jsonc new file mode 100644 index 0000000..4d62fa6 --- /dev/null +++ b/backend/public/deno.jsonc @@ -0,0 +1,9 @@ +{ + "compilerOptions": { + "checkJs": false, + "lib": ["dom", "dom.iterable", "dom.asynciterable", "deno.ns"] + }, + "fmt": { + "indentWidth": 4 + } +} diff --git a/backend/public/product_editor.html b/backend/public/product_editor.html index 3db5a9e..b5858a6 100644 --- a/backend/public/product_editor.html +++ b/backend/public/product_editor.html @@ -59,51 +59,97 @@ #editor input, #editor textarea { width: 250px; } + #wrapper { + display: flex; + justify-content: center; + gap: 2rem; + } + #wrapper form { + min-width: 500px; + } + #image-uploader { + display: flex; + flex-direction: column; + align-items: center; + justify-content: space-between; + height: 100%; + } + #image-uploader #preview { + height: 150px; + background-color: #fff; + }