django-hero-gen 1.3.2 → 1.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/k1/pages/CreateBlog.js +2 -6
- package/src/k1/pages/CreateMessage.js +5 -12
- package/src/k1/pages/EditBlog.js +4 -12
- package/src/k1/pages/GetIdPage.js +5 -6
- package/src/k1/pages/HomePage.js +5 -13
- package/src/k1/pages/Login.js +2 -12
- package/src/k1/pages/Message.js +1 -3
- package/src/k1/pages/Register.js +4 -14
package/package.json
CHANGED
|
@@ -35,9 +35,8 @@ export const CreateBlogPage = () => {
|
|
|
35
35
|
</Navbar>
|
|
36
36
|
|
|
37
37
|
<Container>
|
|
38
|
-
<div
|
|
38
|
+
<div >
|
|
39
39
|
<h4>Добавление новой записи</h4>
|
|
40
|
-
<hr />
|
|
41
40
|
<Form onSubmit={handleSubmit}>
|
|
42
41
|
<Form.Group className="mb-2">
|
|
43
42
|
<Form.Label>Заголовок (title)</Form.Label>
|
|
@@ -53,7 +52,6 @@ export const CreateBlogPage = () => {
|
|
|
53
52
|
<Form.Group className="mb-3">
|
|
54
53
|
<Form.Label>Текст (text)</Form.Label>
|
|
55
54
|
<Form.Control
|
|
56
|
-
as="textarea"
|
|
57
55
|
rows={5}
|
|
58
56
|
value={values.text}
|
|
59
57
|
onChange={(e) => setValues({ ...values, text: e.target.value })}
|
|
@@ -63,9 +61,7 @@ export const CreateBlogPage = () => {
|
|
|
63
61
|
<Button variant="primary" type="submit">
|
|
64
62
|
Сохранить данные
|
|
65
63
|
</Button>
|
|
66
|
-
|
|
67
|
-
Назад в меню
|
|
68
|
-
</Button>
|
|
64
|
+
|
|
69
65
|
</Form>
|
|
70
66
|
</div>
|
|
71
67
|
</Container>
|
|
@@ -17,16 +17,14 @@ export const CreateMessage = () => {
|
|
|
17
17
|
};
|
|
18
18
|
|
|
19
19
|
return (
|
|
20
|
-
<div
|
|
21
|
-
<Navbar bg="light"
|
|
20
|
+
<div>
|
|
21
|
+
<Navbar bg="light" className="mb-3">
|
|
22
22
|
<Container>
|
|
23
23
|
<Navbar.Brand as={Link} to="/">
|
|
24
24
|
МОЙ_САЙТ_123
|
|
25
25
|
</Navbar.Brand>
|
|
26
26
|
<Nav className="me-auto">
|
|
27
|
-
|
|
28
|
-
К списку блогов
|
|
29
|
-
</Nav.Link>
|
|
27
|
+
|
|
30
28
|
</Nav>
|
|
31
29
|
<Button variant="secondary" size="sm">
|
|
32
30
|
Выход
|
|
@@ -36,11 +34,7 @@ export const CreateMessage = () => {
|
|
|
36
34
|
|
|
37
35
|
<Container>
|
|
38
36
|
<div
|
|
39
|
-
|
|
40
|
-
border: "1px solid #ccc",
|
|
41
|
-
padding: "15px",
|
|
42
|
-
background: "#fff",
|
|
43
|
-
}}
|
|
37
|
+
|
|
44
38
|
>
|
|
45
39
|
<h4>Добавить комментарий к посту #{id}</h4>
|
|
46
40
|
<hr />
|
|
@@ -52,10 +46,9 @@ export const CreateMessage = () => {
|
|
|
52
46
|
rows={3}
|
|
53
47
|
value={txt}
|
|
54
48
|
onChange={(e) => setTxt(e.target.value)}
|
|
55
|
-
placeholder="Писать сюда..."
|
|
56
49
|
/>
|
|
57
50
|
</Form.Group>
|
|
58
|
-
<div
|
|
51
|
+
<div >
|
|
59
52
|
<Button variant="success" type="submit">
|
|
60
53
|
Отправить
|
|
61
54
|
</Button>
|
package/src/k1/pages/EditBlog.js
CHANGED
|
@@ -16,7 +16,6 @@ export const EditBlogPage = () => {
|
|
|
16
16
|
await editBlog(id, v.title, v.text);
|
|
17
17
|
navigate("/");
|
|
18
18
|
} catch (err) {
|
|
19
|
-
alert("Не сохранилось");
|
|
20
19
|
}
|
|
21
20
|
};
|
|
22
21
|
|
|
@@ -34,11 +33,11 @@ export const EditBlogPage = () => {
|
|
|
34
33
|
</Navbar>
|
|
35
34
|
|
|
36
35
|
<Container>
|
|
37
|
-
<div
|
|
36
|
+
<div>
|
|
38
37
|
<h3>Правка записи #{id}</h3>
|
|
39
38
|
<Form onSubmit={handleSub}>
|
|
40
39
|
<Form.Group>
|
|
41
|
-
<Form.Label
|
|
40
|
+
<Form.Label>заголовок</Form.Label>
|
|
42
41
|
<Form.Control
|
|
43
42
|
type="text"
|
|
44
43
|
value={v.title}
|
|
@@ -47,9 +46,8 @@ export const EditBlogPage = () => {
|
|
|
47
46
|
</Form.Group>
|
|
48
47
|
|
|
49
48
|
<Form.Group className="mt-2">
|
|
50
|
-
<Form.Label
|
|
49
|
+
<Form.Label>текст</Form.Label>
|
|
51
50
|
<Form.Control
|
|
52
|
-
as="textarea"
|
|
53
51
|
rows={5}
|
|
54
52
|
value={v.text}
|
|
55
53
|
onChange={(e) => setV({ ...v, text: e.target.value })}
|
|
@@ -60,13 +58,7 @@ export const EditBlogPage = () => {
|
|
|
60
58
|
<Button variant="primary" type="submit">
|
|
61
59
|
Сохранить
|
|
62
60
|
</Button>
|
|
63
|
-
|
|
64
|
-
variant="outline-secondary"
|
|
65
|
-
className="ms-2"
|
|
66
|
-
onClick={() => navigate("/")}
|
|
67
|
-
>
|
|
68
|
-
Назад
|
|
69
|
-
</Button>
|
|
61
|
+
|
|
70
62
|
</div>
|
|
71
63
|
</Form>
|
|
72
64
|
</div>
|
|
@@ -13,7 +13,6 @@ export const GetIdPage = () => {
|
|
|
13
13
|
const res = await getBlog(id);
|
|
14
14
|
setItem(res);
|
|
15
15
|
} catch {
|
|
16
|
-
alert("Нет такого ID");
|
|
17
16
|
}
|
|
18
17
|
};
|
|
19
18
|
|
|
@@ -23,24 +22,24 @@ export const GetIdPage = () => {
|
|
|
23
22
|
На главную
|
|
24
23
|
</Button>
|
|
25
24
|
<h3 className="mt-2">Найти запись по номеру</h3>
|
|
26
|
-
<div className="d-flex
|
|
25
|
+
<div className="d-flex mb-4">
|
|
27
26
|
<Form.Control
|
|
28
27
|
style={{ width: "200px" }}
|
|
29
28
|
placeholder="ID например 10"
|
|
30
29
|
value={id}
|
|
31
30
|
onChange={(e) => setId(e.target.value)}
|
|
32
31
|
/>
|
|
33
|
-
<Button
|
|
32
|
+
<Button onClick={find}>
|
|
34
33
|
Поиск
|
|
35
34
|
</Button>
|
|
36
35
|
</div>
|
|
37
36
|
{item && (
|
|
38
|
-
<div className="p-3
|
|
37
|
+
<div className="p-3 ">
|
|
39
38
|
<p>
|
|
40
|
-
|
|
39
|
+
{item.title}
|
|
41
40
|
</p>
|
|
42
41
|
<p>
|
|
43
|
-
|
|
42
|
+
{item.text}
|
|
44
43
|
</p>
|
|
45
44
|
</div>
|
|
46
45
|
)}
|
package/src/k1/pages/HomePage.js
CHANGED
|
@@ -27,8 +27,8 @@ export const HomePage = () => {
|
|
|
27
27
|
load();
|
|
28
28
|
};
|
|
29
29
|
return (
|
|
30
|
-
<div
|
|
31
|
-
<Navbar bg="light"
|
|
30
|
+
<div >
|
|
31
|
+
<Navbar bg="light" className="mb-3">
|
|
32
32
|
<Container>
|
|
33
33
|
<Navbar.Brand as={Link} to="/">
|
|
34
34
|
МОЙ_САЙТ_123
|
|
@@ -41,9 +41,6 @@ export const HomePage = () => {
|
|
|
41
41
|
Поиск
|
|
42
42
|
</Nav.Link>
|
|
43
43
|
</Nav>
|
|
44
|
-
<Button variant="secondary" size="sm">
|
|
45
|
-
Выход
|
|
46
|
-
</Button>
|
|
47
44
|
</Container>
|
|
48
45
|
</Navbar>
|
|
49
46
|
|
|
@@ -54,17 +51,12 @@ export const HomePage = () => {
|
|
|
54
51
|
<div
|
|
55
52
|
key={b.id}
|
|
56
53
|
style={{
|
|
57
|
-
border: "1px solid #ccc",
|
|
58
|
-
padding: "10px",
|
|
59
|
-
marginBottom: "10px",
|
|
60
|
-
borderRadius: "4px",
|
|
61
54
|
}}
|
|
62
55
|
>
|
|
63
56
|
<h5>{b.title}</h5>
|
|
64
57
|
<p>{b.text}</p>
|
|
65
|
-
<div style={{ display: "flex", gap: "
|
|
58
|
+
<div style={{ display: "flex", gap: "2px" }}>
|
|
66
59
|
<Button
|
|
67
|
-
variant="info"
|
|
68
60
|
size="sm"
|
|
69
61
|
onClick={() => navigate(\`/message/\${b.id}\`)}
|
|
70
62
|
>
|
|
@@ -78,7 +70,7 @@ export const HomePage = () => {
|
|
|
78
70
|
Редакт.
|
|
79
71
|
</Button>
|
|
80
72
|
<Button
|
|
81
|
-
variant="
|
|
73
|
+
variant="info"
|
|
82
74
|
size="sm"
|
|
83
75
|
onClick={() => {
|
|
84
76
|
handleDelete(b.id);
|
|
@@ -87,7 +79,7 @@ export const HomePage = () => {
|
|
|
87
79
|
Удалить
|
|
88
80
|
</Button>
|
|
89
81
|
<Button
|
|
90
|
-
variant="
|
|
82
|
+
variant="info"
|
|
91
83
|
size="sm"
|
|
92
84
|
onClick={() => navigate(\`/create-message/\${b.id}\`)}
|
|
93
85
|
>
|
package/src/k1/pages/Login.js
CHANGED
|
@@ -16,24 +16,17 @@ export const LoginPage = () => {
|
|
|
16
16
|
await authUser(u, p);
|
|
17
17
|
navigate("/");
|
|
18
18
|
} catch (err) {
|
|
19
|
-
alert("Неверный логин или пароль");
|
|
20
19
|
}
|
|
21
20
|
};
|
|
22
21
|
|
|
23
22
|
return (
|
|
24
23
|
<Container style={{ marginTop: "100px" }}>
|
|
25
24
|
<div
|
|
26
|
-
|
|
27
|
-
width: "350px",
|
|
28
|
-
margin: "0 auto",
|
|
29
|
-
padding: "20px",
|
|
30
|
-
border: "1px solid #ccc",
|
|
31
|
-
}}
|
|
25
|
+
|
|
32
26
|
>
|
|
33
27
|
<h2 className="mb-3">Вход</h2>
|
|
34
28
|
<Form onSubmit={handleLogin}>
|
|
35
29
|
<Form.Group className="mb-2">
|
|
36
|
-
<Form.Label>Логин:</Form.Label>
|
|
37
30
|
<Form.Control
|
|
38
31
|
type="text"
|
|
39
32
|
value={u}
|
|
@@ -42,7 +35,6 @@ export const LoginPage = () => {
|
|
|
42
35
|
</Form.Group>
|
|
43
36
|
|
|
44
37
|
<Form.Group className="mb-3">
|
|
45
|
-
<Form.Label>Пароль:</Form.Label>
|
|
46
38
|
<Form.Control
|
|
47
39
|
type="password"
|
|
48
40
|
value={p}
|
|
@@ -54,9 +46,7 @@ export const LoginPage = () => {
|
|
|
54
46
|
Войти
|
|
55
47
|
</Button>
|
|
56
48
|
<div className="mt-2 text-center">
|
|
57
|
-
|
|
58
|
-
Создать аккаунт
|
|
59
|
-
</Link>
|
|
49
|
+
|
|
60
50
|
</div>
|
|
61
51
|
</Form>
|
|
62
52
|
</div>
|
package/src/k1/pages/Message.js
CHANGED
|
@@ -46,9 +46,7 @@ export const Message = () => {
|
|
|
46
46
|
</Navbar>
|
|
47
47
|
|
|
48
48
|
<Container>
|
|
49
|
-
<h4>Комментарии к записи (ID: {id}):</h4>
|
|
50
49
|
<hr />
|
|
51
|
-
{messages.length === 0 && <p>Тут пока пусто...</p>}
|
|
52
50
|
{messages.map((m) => (
|
|
53
51
|
<div
|
|
54
52
|
key={m.id}
|
|
@@ -60,7 +58,7 @@ export const Message = () => {
|
|
|
60
58
|
}}
|
|
61
59
|
>
|
|
62
60
|
<p style={{ margin: 0 }}>{m.text}</p>
|
|
63
|
-
<div
|
|
61
|
+
<div >
|
|
64
62
|
<Button
|
|
65
63
|
variant="warning"
|
|
66
64
|
size="sm"
|
package/src/k1/pages/Register.js
CHANGED
|
@@ -16,25 +16,18 @@ export const RegisterPage = () => {
|
|
|
16
16
|
await createUser(u, p);
|
|
17
17
|
navigate("/login");
|
|
18
18
|
} catch (err) {
|
|
19
|
-
alert("Ошибка при регистрации");
|
|
20
19
|
}
|
|
21
20
|
};
|
|
22
21
|
|
|
23
22
|
return (
|
|
24
23
|
<Container style={{ marginTop: "80px" }}>
|
|
25
24
|
<div
|
|
26
|
-
|
|
27
|
-
width: "350px",
|
|
28
|
-
margin: "0 auto",
|
|
29
|
-
padding: "20px",
|
|
30
|
-
border: "1px solid #ddd",
|
|
31
|
-
borderRadius: "5px",
|
|
32
|
-
}}
|
|
25
|
+
|
|
33
26
|
>
|
|
34
27
|
<h3 className="text-center mb-4">Регистрация</h3>
|
|
35
28
|
<Form onSubmit={handleReg}>
|
|
36
29
|
<Form.Group className="mb-2">
|
|
37
|
-
<Form.Label
|
|
30
|
+
<Form.Label>Логин</Form.Label>
|
|
38
31
|
<Form.Control
|
|
39
32
|
type="text"
|
|
40
33
|
value={u}
|
|
@@ -44,12 +37,11 @@ export const RegisterPage = () => {
|
|
|
44
37
|
</Form.Group>
|
|
45
38
|
|
|
46
39
|
<Form.Group className="mb-4">
|
|
47
|
-
<Form.Label>Пароль
|
|
40
|
+
<Form.Label>Пароль </Form.Label>
|
|
48
41
|
<Form.Control
|
|
49
42
|
type="password"
|
|
50
43
|
value={p}
|
|
51
44
|
onChange={(e) => setP(e.target.value)}
|
|
52
|
-
placeholder="Минимум 6 символов"
|
|
53
45
|
/>
|
|
54
46
|
</Form.Group>
|
|
55
47
|
|
|
@@ -58,9 +50,7 @@ export const RegisterPage = () => {
|
|
|
58
50
|
</Button>
|
|
59
51
|
|
|
60
52
|
<div className="mt-3 text-center">
|
|
61
|
-
|
|
62
|
-
Уже есть аккаунт? Войти
|
|
63
|
-
</Link>
|
|
53
|
+
|
|
64
54
|
</div>
|
|
65
55
|
</Form>
|
|
66
56
|
</div>
|