tangled
alpha
login
or
join now
kacaii.dev
/
sigo
0
fork
atom
๐ฉโ๐ Firefighters API written in Gleam!
lustre
gleam
0
fork
atom
overview
issues
pulls
pipelines
:lipstick: display error message when passwords dont match
kacaii.dev
2 weeks ago
9aa3ffbc
a606cf2c
verified
This commit was signed with the committer's
known signature
.
kacaii.dev
SSH Key Fingerprint:
SHA256:n9v7QGNWHCUv1x/483hCtPUvTsVabU5PzC5CSJMUNtI=
+26
-17
2 changed files
expand all
collapse all
unified
split
client
src
client
page
signup.gleam
justfile
+24
-15
client/src/client/page/signup.gleam
···
65
65
)
66
66
67
67
UserSelectedRole(value) -> {
68
68
-
let role = role.from_string(value)
69
69
-
#(Model(..model, user_role: role), effect.none())
68
68
+
let user_role = role.from_string(value)
69
69
+
#(Model(..model, user_role:), effect.none())
70
70
}
71
71
72
72
-
UserUpdatedPasswordField(value) -> #(
73
73
-
Model(..model, user_password: value),
74
74
-
effect.none(),
75
75
-
)
72
72
+
UserUpdatedPasswordField(user_password) -> {
73
73
+
let text_message = case user_password == model.user_confirm_password {
74
74
+
True -> ""
75
75
+
False -> "Passwords must match"
76
76
+
}
76
77
77
77
-
UserUpdatedConfirmPasswordField(value) -> #(
78
78
-
Model(..model, user_confirm_password: value),
79
79
-
effect.none(),
80
80
-
)
78
78
+
#(Model(..model, text_message:, user_password:), effect.none())
79
79
+
}
80
80
+
81
81
+
UserUpdatedConfirmPasswordField(user_confirm_password) -> {
82
82
+
let text_message = case user_confirm_password == model.user_password {
83
83
+
True -> ""
84
84
+
False -> "Passwords must match"
85
85
+
}
86
86
+
87
87
+
#(Model(..model, text_message:, user_confirm_password:), effect.none())
88
88
+
}
81
89
82
90
UserSentRequest -> {
83
91
todo as "build and send request"
···
104
112
fn text_message(model: Model) -> element.Element(Msg) {
105
113
case model.text_message {
106
114
"" -> element.none()
107
107
-
text -> html.p([], [html.text(text)])
115
115
+
text -> html.p([class("text-white")], [html.text(text)])
108
116
}
109
117
}
110
118
···
187
195
event.on_input(UserSelectedRole),
188
196
]
189
197
190
190
-
html.select(
191
191
-
attributes,
192
192
-
list.map(role.all, fn(role) { html.option([], role.to_string(role)) }),
193
193
-
)
198
198
+
let role_to_option = fn(role: role.Role) {
199
199
+
html.option([attr.selected(model.user_role == role)], role.to_string(role))
200
200
+
}
201
201
+
202
202
+
html.select(attributes, list.map(role.all, role_to_option))
194
203
}
195
204
196
205
fn text_input(
+2
-2
justfile
···
44
44
45
45
# Start the pod
46
46
[group("podman")]
47
47
-
start:
47
47
+
start:
48
48
podman pod start {{ pod_name }}
49
49
50
50
# Stop pod
···
57
57
clean:
58
58
podman pod rm -f {{ pod_name }}
59
59
60
60
-
[private]
60
60
+
[group("podman")]
61
61
@init-database: create-pod
62
62
podman run --rm -d --name postgres-database --pod {{ pod_name }} --replace {{ pg_env }} \
63
63
{{ pg_health_cmd }} {{ pg_health_conf }} {{ pg_health_start_period }} \