Skip to content

Commit 64b6715

Browse files
committed
feat: new icons
1 parent 58e6b3f commit 64b6715

File tree

4 files changed

+56
-16
lines changed

4 files changed

+56
-16
lines changed

modules/core/migrations/20240602202521-initial.sql

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
-- +migrate Up
22
CREATE TABLE uploads
33
(
4-
4+
55
id SERIAL PRIMARY KEY,
6-
hash VARCHAR(255) NOT NULL UNIQUE,
6+
hash VARCHAR(255) NOT NULL UNIQUE,
77
url VARCHAR(1024) NOT NULL DEFAULT '',
88
name VARCHAR(255) NOT NULL DEFAULT '',
99
size INT NOT NULL DEFAULT 0,
@@ -52,7 +52,7 @@ CREATE TABLE employees
5252
salary_currency_id VARCHAR(3) REFERENCES currencies (code) ON DELETE SET NULL,
5353
hourly_rate NUMERIC(9, 2) NOT NULL,
5454
coefficient FLOAT NOT NULL,
55-
avatar_id INT REFERENCES uploads (id) ON DELETE SET NULL,
55+
avatar_id INT REFERENCES uploads (id) ON DELETE SET NULL,
5656
created_at TIMESTAMP WITH TIME ZONE DEFAULT current_timestamp,
5757
updated_at TIMESTAMP WITH TIME ZONE DEFAULT current_timestamp
5858
);
@@ -108,7 +108,7 @@ CREATE TABLE users
108108
email VARCHAR(255) NOT NULL UNIQUE,
109109
password VARCHAR(255),
110110
ui_language VARCHAR(3) NOT NULL,
111-
avatar_id INT REFERENCES uploads (id) ON DELETE SET NULL,
111+
avatar_id INT REFERENCES uploads (id) ON DELETE SET NULL,
112112
last_login TIMESTAMP NULL,
113113
last_ip VARCHAR(255) NULL,
114114
last_action TIMESTAMP WITH TIME ZONE NULL,
@@ -155,7 +155,7 @@ CREATE TABLE folders
155155
(
156156
id SERIAL PRIMARY KEY,
157157
name VARCHAR(255) NOT NULL,
158-
icon_id INT REFERENCES uploads (id) ON DELETE SET NULL,
158+
icon_id INT REFERENCES uploads (id) ON DELETE SET NULL,
159159
parent_id INT REFERENCES folders (id) ON DELETE CASCADE,
160160
created_at TIMESTAMP WITH TIME ZONE DEFAULT current_timestamp,
161161
updated_at TIMESTAMP WITH TIME ZONE DEFAULT current_timestamp
@@ -168,7 +168,7 @@ CREATE TABLE articles
168168
content TEXT NOT NULL,
169169
title_emoji VARCHAR(255),
170170
author_id INT REFERENCES users (id) ON DELETE SET NULL,
171-
picture_id INT REFERENCES uploads (id) ON DELETE SET NULL,
171+
picture_id INT REFERENCES uploads (id) ON DELETE SET NULL,
172172
folder_id INT REFERENCES folders (id) ON DELETE SET NULL,
173173
created_at TIMESTAMP WITH TIME ZONE DEFAULT current_timestamp,
174174
updated_at TIMESTAMP WITH TIME ZONE DEFAULT current_timestamp
@@ -196,7 +196,7 @@ CREATE TABLE likes
196196
CREATE TABLE uploaded_images
197197
(
198198
id SERIAL PRIMARY KEY,
199-
upload_id INT NOT NULL REFERENCES uploads (id) ON DELETE CASCADE,
199+
upload_id INT NOT NULL REFERENCES uploads (id) ON DELETE CASCADE,
200200
type VARCHAR(255) NOT NULL,
201201
size FLOAT NOT NULL,
202202
width INT NOT NULL,
@@ -392,12 +392,13 @@ CREATE TABLE contact_form_submissions
392392
created_at TIMESTAMP WITH TIME ZONE DEFAULT current_timestamp
393393
);
394394

395-
CREATE TABLE tabs (
396-
id SERIAL PRIMARY KEY,
397-
href VARCHAR(255) NOT NULL,
398-
user_id INT NOT NULL REFERENCES users (id) ON DELETE CASCADE,
399-
position INT NOT NULL DEFAULT 0,
400-
UNIQUE(href, user_id)
395+
CREATE TABLE tabs
396+
(
397+
id SERIAL PRIMARY KEY,
398+
href VARCHAR(255) NOT NULL,
399+
user_id INT NOT NULL REFERENCES users (id) ON DELETE CASCADE,
400+
position INT NOT NULL DEFAULT 0,
401+
UNIQUE (href, user_id)
401402
);
402403

403404
CREATE INDEX users_first_name_idx ON users (first_name);
@@ -481,6 +482,8 @@ DROP TABLE IF EXISTS skills CASCADE;
481482
DROP TABLE IF EXISTS task_types CASCADE;
482483
DROP TABLE IF EXISTS telegram_sessions CASCADE;
483484
DROP TABLE IF EXISTS uploaded_images CASCADE;
485+
DROP TABLE IF EXISTS uploads CASCADE;
486+
DROP TABLE IF EXISTS employee_positions CASCADE;
484487
DROP TABLE IF EXISTS user_roles CASCADE;
485488
DROP TABLE IF EXISTS users CASCADE;
486489
DROP TABLE IF EXISTS vacancies CASCADE;

modules/warehouse/locales/ru.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"Warehouse": "Склад",
44
"Products": "Продукты",
55
"WarehousePositions": "Наименования",
6-
"WarehouseOrders": "Заказы склада",
6+
"WarehouseOrders": "Заявки/Накладные",
77
"WarehouseUnits": "Единицы измерения"
88
},
99
"Products": {

pkg/commands/migrate_command.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ func Migrate() error {
3939
}
4040
case "redo":
4141
if err := app.RollbackMigrations(); err != nil {
42-
return err
42+
return errors.Join(err, errors.New("failed to rollback migrations"))
4343
}
4444
if err := app.RunMigrations(); err != nil {
45-
return err
45+
return errors.Join(err, errors.New("failed to run migrations"))
4646
}
4747
default:
4848
return fmt.Errorf("unsupported command: %s\nSupported commands: 'up', 'down', 'redo'", os.Args[1])

pkg/presentation/templates/icons/icons.templ

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ type Props struct {
44
Size string
55
Class string
66
Attributes templ.Attributes
7+
Filled bool
78
}
89

910
templ svg(props Props) {
@@ -179,3 +180,39 @@ templ Minus(props Props) {
179180
<path fill="currentColor" d="M224,128a8,8,0,0,1-8,8H40a8,8,0,0,1,0-16H216A8,8,0,0,1,224,128Z"></path>
180181
}
181182
}
183+
184+
templ Notepad(props Props) {
185+
@svg(props) {
186+
if props.Filled {
187+
<path fill="currentColor" d="M208,32H184V24a8,8,0,0,0-16,0v8H136V24a8,8,0,0,0-16,0v8H88V24a8,8,0,0,0-16,0v8H48a8,8,0,0,0-8,8V200a32,32,0,0,0,32,32H184a32,32,0,0,0,32-32V40A8,8,0,0,0,208,32ZM120,56a8,8,0,0,1,16,0v8a8,8,0,0,1-16,0ZM80,72a8,8,0,0,1-8-8V56a8,8,0,0,1,16,0v8A8,8,0,0,1,80,72Zm80,96H96a8,8,0,0,1,0-16h64a8,8,0,0,1,0,16Zm0-32H96a8,8,0,0,1,0-16h64a8,8,0,0,1,0,16Zm24-72a8,8,0,0,1-16,0V56a8,8,0,0,1,16,0Z"></path>
188+
} else {
189+
<path fill="currentColor" d="M168,128a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,128Zm-8,24H96a8,8,0,0,0,0,16h64a8,8,0,0,0,0-16ZM216,40V200a32,32,0,0,1-32,32H72a32,32,0,0,1-32-32V40a8,8,0,0,1,8-8H72V24a8,8,0,0,1,16,0v8h32V24a8,8,0,0,1,16,0v8h32V24a8,8,0,0,1,16,0v8h24A8,8,0,0,1,216,40Zm-16,8H184v8a8,8,0,0,1-16,0V48H136v8a8,8,0,0,1-16,0V48H88v8a8,8,0,0,1-16,0V48H56V200a16,16,0,0,0,16,16H184a16,16,0,0,0,16-16Z"></path>
190+
}
191+
}
192+
}
193+
194+
templ Package(props Props) {
195+
@svg(props) {
196+
if props.Filled {
197+
<path fill="currentColor" d="M223.68,66.15,135.68,18a15.88,15.88,0,0,0-15.36,0l-88,48.17a16,16,0,0,0-8.32,14v95.64a16,16,0,0,0,8.32,14l88,48.17a15.88,15.88,0,0,0,15.36,0l88-48.17a16,16,0,0,0,8.32-14V80.18A16,16,0,0,0,223.68,66.15ZM128,32l80.35,44L178.57,92.29l-80.35-44Zm0,88L47.65,76,81.56,57.43l80.35,44Zm88,55.85h0l-80,43.79V133.83l32-17.51V152a8,8,0,0,0,16,0V107.56l32-17.51v85.76Z"></path>
198+
} else {
199+
<path fill="currentColor" d="M223.68,66.15,135.68,18a15.88,15.88,0,0,0-15.36,0l-88,48.17a16,16,0,0,0-8.32,14v95.64a16,16,0,0,0,8.32,14l88,48.17a15.88,15.88,0,0,0,15.36,0l88-48.17a16,16,0,0,0,8.32-14V80.18A16,16,0,0,0,223.68,66.15ZM128,32l80.34,44-29.77,16.3-80.35-44ZM128,120,47.66,76l33.9-18.56,80.34,44ZM40,90l80,43.78v85.79L40,175.82Zm176,85.78h0l-80,43.79V133.82l32-17.51V152a8,8,0,0,0,16,0V107.55L216,90v85.77Z"></path>
200+
}
201+
}
202+
}
203+
204+
templ DotsSix(props Props) {
205+
@svg(props) {
206+
<path fill="currentColor" d="M72,92A12,12,0,1,1,60,80,12,12,0,0,1,72,92Zm56-12a12,12,0,1,0,12,12A12,12,0,0,0,128,80Zm68,24a12,12,0,1,0-12-12A12,12,0,0,0,196,104ZM60,152a12,12,0,1,0,12,12A12,12,0,0,0,60,152Zm68,0a12,12,0,1,0,12,12A12,12,0,0,0,128,152Zm68,0a12,12,0,1,0,12,12A12,12,0,0,0,196,152Z"></path>
207+
}
208+
}
209+
210+
templ TrayArrayDown(props Props) {
211+
@svg(props) {
212+
if props.Filled {
213+
<path fill="currentColor" d="M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM90.34,114.34a8,8,0,0,1,11.32,0L120,132.69V72a8,8,0,0,1,16,0v60.69l18.34-18.35a8,8,0,0,1,11.32,11.32l-32,32a8,8,0,0,1-11.32,0l-32-32A8,8,0,0,1,90.34,114.34ZM208,208H48V168H76.69L96,187.32A15.89,15.89,0,0,0,107.31,192h41.38A15.86,15.86,0,0,0,160,187.31L179.31,168H208v40Z"></path>
214+
} else {
215+
<path fill="currentColor" d="M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32Zm0,16V152h-28.7A15.86,15.86,0,0,0,168,156.69L148.69,176H107.31L88,156.69A15.86,15.86,0,0,0,76.69,152H48V48Zm0,160H48V168H76.69L96,187.31A15.86,15.86,0,0,0,107.31,192h41.38A15.86,15.86,0,0,0,160,187.31L179.31,168H208v40ZM90.34,125.66a8,8,0,0,1,11.32-11.32L120,132.69V72a8,8,0,0,1,16,0v60.69l18.34-18.35a8,8,0,0,1,11.32,11.32l-32,32a8,8,0,0,1-11.32,0Z"></path>
216+
}
217+
}
218+
}

0 commit comments

Comments
 (0)