mark required fields as required
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing

This commit is contained in:
shibao 2025-02-15 02:48:09 +00:00
parent c3d066016b
commit 2a8a1d11b8
15 changed files with 103 additions and 97 deletions

View File

@ -2,6 +2,7 @@
- Update deps
- Fix content not escaping HTML properly
- Add placeholder for empty notes and contexts
- Marks some required fields as required
# v0.1.17
- Fix new invite button not working

View File

@ -1,4 +1,4 @@
<div class="h-full flex flex-col justify-start items-stretch space-y-4">
<div class="flex flex-col justify-start items-stretch space-y-4 h-full">
<.form
:let={f}
for={@changeset}
@ -14,7 +14,8 @@
class: "input input-primary",
phx_debounce: 300,
phx_hook: "SanitizeTitles",
placeholder: gettext("slug")
placeholder: gettext("slug"),
required: true
) %>
<%= error_tag(f, :slug) %>

View File

@ -1,12 +1,12 @@
<div>
<h2 class="mb-8 text-center title text-xl text-primary-400">
<h2 class="mb-8 text-xl text-center title text-primary-400">
<%= @title %>
</h2>
<.form
:let={f}
for={@changeset}
id="invite-form"
class="flex flex-col space-y-4 sm:space-y-0 sm:grid sm:grid-cols-3 sm:gap-4 justify-center items-center"
class="flex flex-col justify-center items-center space-y-4 sm:space-y-0 sm:grid sm:grid-cols-3 sm:gap-4"
phx-target={@myself}
phx-change="validate"
phx-submit="save"
@ -14,7 +14,7 @@
>
<div
:if={@changeset.action && not @changeset.valid?}
class="invalid-feedback col-span-3 text-center"
class="col-span-3 text-center invalid-feedback"
>
<%= changeset_errors(@changeset) %>
</div>
@ -25,7 +25,8 @@
) %>
<%= text_input(f, :name,
class: "input input-primary col-span-2",
phx_debounce: 300
phx_debounce: 300,
required: true
) %>
<%= error_tag(f, :name, "col-span-3") %>
@ -40,7 +41,7 @@
) %>
<%= error_tag(f, :uses_left, "col-span-3") %>
<span class="col-span-3 text-primary-500 italic text-center">
<span class="col-span-3 italic text-center text-primary-500">
<%= gettext(~s/leave "uses left" blank to make invite unlimited/) %>
</span>

View File

@ -1,4 +1,4 @@
<div class="h-full flex flex-col justify-start items-stretch space-y-4">
<div class="flex flex-col justify-start items-stretch space-y-4 h-full">
<.form
:let={f}
for={@changeset}
@ -14,7 +14,8 @@
class: "input input-primary",
phx_debounce: 300,
phx_hook: "SanitizeTitles",
placeholder: gettext("slug")
placeholder: gettext("slug"),
required: true
) %>
<%= error_tag(f, :slug) %>

View File

@ -1,4 +1,4 @@
<div class="h-full flex flex-col justify-start items-stretch space-y-4">
<div class="flex flex-col justify-start items-stretch space-y-4 h-full">
<.form
:let={f}
for={@changeset}
@ -14,7 +14,8 @@
class: "input input-primary",
phx_debounce: 300,
phx_hook: "SanitizeTitles",
placeholder: gettext("slug")
placeholder: gettext("slug"),
required: true
) %>
<%= error_tag(f, :slug) %>

View File

@ -1,4 +1,4 @@
<div class="h-full flex flex-col justify-start items-stretch space-y-4">
<div class="flex flex-col justify-start items-stretch space-y-4 h-full">
<.form
:let={f}
for={@changeset}
@ -14,7 +14,8 @@
class: "input input-primary",
phx_debounce: 300,
phx_hook: "SanitizeTitles",
placeholder: gettext("title")
placeholder: gettext("title"),
required: true
) %>
<%= error_tag(f, :title) %>

View File

@ -103,11 +103,11 @@ msgstr ""
msgid "register"
msgstr ""
#: lib/memex_web/live/context_live/form_component.html.heex:51
#: lib/memex_web/live/invite_live/form_component.html.heex:47
#: lib/memex_web/live/note_live/form_component.html.heex:49
#: lib/memex_web/live/pipeline_live/form_component.html.heex:55
#: lib/memex_web/live/step_live/form_component.html.heex:38
#: lib/memex_web/live/context_live/form_component.html.heex:52
#: lib/memex_web/live/invite_live/form_component.html.heex:48
#: lib/memex_web/live/note_live/form_component.html.heex:50
#: lib/memex_web/live/pipeline_live/form_component.html.heex:56
#: lib/memex_web/live/step_live/form_component.html.heex:39
#, elixir-autogen, elixir-format
msgid "save"
msgstr ""

View File

@ -103,11 +103,11 @@ msgstr ""
msgid "register"
msgstr ""
#: lib/memex_web/live/context_live/form_component.html.heex:51
#: lib/memex_web/live/invite_live/form_component.html.heex:47
#: lib/memex_web/live/note_live/form_component.html.heex:49
#: lib/memex_web/live/pipeline_live/form_component.html.heex:55
#: lib/memex_web/live/step_live/form_component.html.heex:38
#: lib/memex_web/live/context_live/form_component.html.heex:52
#: lib/memex_web/live/invite_live/form_component.html.heex:48
#: lib/memex_web/live/note_live/form_component.html.heex:50
#: lib/memex_web/live/pipeline_live/form_component.html.heex:56
#: lib/memex_web/live/step_live/form_component.html.heex:39
#, elixir-autogen, elixir-format
msgid "save"
msgstr ""

View File

@ -237,20 +237,20 @@ msgstr ""
msgid "report bugs or request features"
msgstr ""
#: lib/memex_web/live/context_live/form_component.html.heex:52
#: lib/memex_web/live/note_live/form_component.html.heex:50
#: lib/memex_web/live/pipeline_live/form_component.html.heex:56
#: lib/memex_web/live/step_live/form_component.html.heex:39
#: lib/memex_web/live/context_live/form_component.html.heex:53
#: lib/memex_web/live/note_live/form_component.html.heex:51
#: lib/memex_web/live/pipeline_live/form_component.html.heex:57
#: lib/memex_web/live/step_live/form_component.html.heex:40
#, elixir-autogen, elixir-format
msgid "saving..."
msgstr ""
#: lib/memex_web/live/context_live/form_component.html.heex:46
#: lib/memex_web/live/context_live/form_component.html.heex:47
#: lib/memex_web/live/note_live/form_component.html.heex:44
#: lib/memex_web/live/context_live/form_component.html.heex:48
#: lib/memex_web/live/note_live/form_component.html.heex:45
#: lib/memex_web/live/pipeline_live/form_component.html.heex:50
#: lib/memex_web/live/note_live/form_component.html.heex:46
#: lib/memex_web/live/pipeline_live/form_component.html.heex:51
#: lib/memex_web/live/pipeline_live/form_component.html.heex:52
#, elixir-autogen, elixir-format
msgid "select privacy"
msgstr ""
@ -266,12 +266,12 @@ msgstr ""
msgid "settings"
msgstr ""
#: lib/memex_web/live/context_live/form_component.html.heex:34
#: lib/memex_web/live/context_live/form_component.html.heex:39
#: lib/memex_web/live/note_live/form_component.html.heex:32
#: lib/memex_web/live/note_live/form_component.html.heex:37
#: lib/memex_web/live/pipeline_live/form_component.html.heex:38
#: lib/memex_web/live/pipeline_live/form_component.html.heex:43
#: lib/memex_web/live/context_live/form_component.html.heex:35
#: lib/memex_web/live/context_live/form_component.html.heex:40
#: lib/memex_web/live/note_live/form_component.html.heex:33
#: lib/memex_web/live/note_live/form_component.html.heex:38
#: lib/memex_web/live/pipeline_live/form_component.html.heex:39
#: lib/memex_web/live/pipeline_live/form_component.html.heex:44
#, elixir-autogen, elixir-format
msgid "tag1,tag2"
msgstr ""
@ -629,12 +629,12 @@ msgstr ""
msgid "password"
msgstr ""
#: lib/memex_web/live/invite_live/form_component.html.heex:32
#: lib/memex_web/live/invite_live/form_component.html.heex:33
#, elixir-autogen, elixir-format, fuzzy
msgid "uses left"
msgstr ""
#: lib/memex_web/live/invite_live/form_component.html.heex:44
#: lib/memex_web/live/invite_live/form_component.html.heex:45
#, elixir-autogen, elixir-format, fuzzy
msgid "leave \"uses left\" blank to make invite unlimited"
msgstr ""
@ -672,22 +672,22 @@ msgstr ""
msgid "reset your password"
msgstr ""
#: lib/memex_web/live/pipeline_live/form_component.html.heex:26
#: lib/memex_web/live/pipeline_live/form_component.html.heex:30
#: lib/memex_web/live/step_live/form_component.html.heex:26
#: lib/memex_web/live/step_live/form_component.html.heex:30
#: lib/memex_web/live/pipeline_live/form_component.html.heex:27
#: lib/memex_web/live/pipeline_live/form_component.html.heex:31
#: lib/memex_web/live/step_live/form_component.html.heex:27
#: lib/memex_web/live/step_live/form_component.html.heex:31
#, elixir-autogen, elixir-format
msgid "use [[[note-slug]]] to link to a note or use [[context-slug]] to link to a context or [pipeline-slug] to link to a pipeline"
msgstr ""
#: lib/memex_web/live/context_live/form_component.html.heex:26
#: lib/memex_web/live/context_live/form_component.html.heex:28
#: lib/memex_web/live/context_live/form_component.html.heex:27
#: lib/memex_web/live/context_live/form_component.html.heex:29
#, elixir-autogen, elixir-format, fuzzy
msgid "use [[note-slug]] to link to a note or [context-slug] to link to a context"
msgstr ""
#: lib/memex_web/live/note_live/form_component.html.heex:25
#: lib/memex_web/live/note_live/form_component.html.heex:26
#: lib/memex_web/live/note_live/form_component.html.heex:27
#, elixir-autogen, elixir-format, fuzzy
msgid "use [note-slug] to link to a note"
msgstr ""

View File

@ -137,7 +137,7 @@ msgstr ""
msgid "are you sure you want to delete %{email}? this action is permanent!"
msgstr ""
#: lib/memex_web/live/invite_live/form_component.html.heex:49
#: lib/memex_web/live/invite_live/form_component.html.heex:50
#, elixir-autogen, elixir-format, fuzzy
msgid "saving..."
msgstr ""

View File

@ -235,20 +235,20 @@ msgstr ""
msgid "report bugs or request features"
msgstr ""
#: lib/memex_web/live/context_live/form_component.html.heex:52
#: lib/memex_web/live/note_live/form_component.html.heex:50
#: lib/memex_web/live/pipeline_live/form_component.html.heex:56
#: lib/memex_web/live/step_live/form_component.html.heex:39
#: lib/memex_web/live/context_live/form_component.html.heex:53
#: lib/memex_web/live/note_live/form_component.html.heex:51
#: lib/memex_web/live/pipeline_live/form_component.html.heex:57
#: lib/memex_web/live/step_live/form_component.html.heex:40
#, elixir-autogen, elixir-format
msgid "saving..."
msgstr ""
#: lib/memex_web/live/context_live/form_component.html.heex:46
#: lib/memex_web/live/context_live/form_component.html.heex:47
#: lib/memex_web/live/note_live/form_component.html.heex:44
#: lib/memex_web/live/context_live/form_component.html.heex:48
#: lib/memex_web/live/note_live/form_component.html.heex:45
#: lib/memex_web/live/pipeline_live/form_component.html.heex:50
#: lib/memex_web/live/note_live/form_component.html.heex:46
#: lib/memex_web/live/pipeline_live/form_component.html.heex:51
#: lib/memex_web/live/pipeline_live/form_component.html.heex:52
#, elixir-autogen, elixir-format
msgid "select privacy"
msgstr ""
@ -264,12 +264,12 @@ msgstr ""
msgid "settings"
msgstr ""
#: lib/memex_web/live/context_live/form_component.html.heex:34
#: lib/memex_web/live/context_live/form_component.html.heex:39
#: lib/memex_web/live/note_live/form_component.html.heex:32
#: lib/memex_web/live/note_live/form_component.html.heex:37
#: lib/memex_web/live/pipeline_live/form_component.html.heex:38
#: lib/memex_web/live/pipeline_live/form_component.html.heex:43
#: lib/memex_web/live/context_live/form_component.html.heex:35
#: lib/memex_web/live/context_live/form_component.html.heex:40
#: lib/memex_web/live/note_live/form_component.html.heex:33
#: lib/memex_web/live/note_live/form_component.html.heex:38
#: lib/memex_web/live/pipeline_live/form_component.html.heex:39
#: lib/memex_web/live/pipeline_live/form_component.html.heex:44
#, elixir-autogen, elixir-format
msgid "tag1,tag2"
msgstr ""
@ -627,12 +627,12 @@ msgstr ""
msgid "password"
msgstr ""
#: lib/memex_web/live/invite_live/form_component.html.heex:32
#: lib/memex_web/live/invite_live/form_component.html.heex:33
#, elixir-autogen, elixir-format
msgid "uses left"
msgstr ""
#: lib/memex_web/live/invite_live/form_component.html.heex:44
#: lib/memex_web/live/invite_live/form_component.html.heex:45
#, elixir-autogen, elixir-format
msgid "leave \"uses left\" blank to make invite unlimited"
msgstr ""
@ -670,22 +670,22 @@ msgstr ""
msgid "reset your password"
msgstr ""
#: lib/memex_web/live/pipeline_live/form_component.html.heex:26
#: lib/memex_web/live/pipeline_live/form_component.html.heex:30
#: lib/memex_web/live/step_live/form_component.html.heex:26
#: lib/memex_web/live/step_live/form_component.html.heex:30
#: lib/memex_web/live/pipeline_live/form_component.html.heex:27
#: lib/memex_web/live/pipeline_live/form_component.html.heex:31
#: lib/memex_web/live/step_live/form_component.html.heex:27
#: lib/memex_web/live/step_live/form_component.html.heex:31
#, elixir-autogen, elixir-format
msgid "use [[[note-slug]]] to link to a note or use [[context-slug]] to link to a context or [pipeline-slug] to link to a pipeline"
msgstr ""
#: lib/memex_web/live/context_live/form_component.html.heex:26
#: lib/memex_web/live/context_live/form_component.html.heex:28
#: lib/memex_web/live/context_live/form_component.html.heex:27
#: lib/memex_web/live/context_live/form_component.html.heex:29
#, elixir-autogen, elixir-format
msgid "use [[note-slug]] to link to a note or [context-slug] to link to a context"
msgstr ""
#: lib/memex_web/live/note_live/form_component.html.heex:25
#: lib/memex_web/live/note_live/form_component.html.heex:26
#: lib/memex_web/live/note_live/form_component.html.heex:27
#, elixir-autogen, elixir-format
msgid "use [note-slug] to link to a note"
msgstr ""

View File

@ -104,11 +104,11 @@ msgstr ""
msgid "register"
msgstr ""
#: lib/memex_web/live/context_live/form_component.html.heex:51
#: lib/memex_web/live/invite_live/form_component.html.heex:47
#: lib/memex_web/live/note_live/form_component.html.heex:49
#: lib/memex_web/live/pipeline_live/form_component.html.heex:55
#: lib/memex_web/live/step_live/form_component.html.heex:38
#: lib/memex_web/live/context_live/form_component.html.heex:52
#: lib/memex_web/live/invite_live/form_component.html.heex:48
#: lib/memex_web/live/note_live/form_component.html.heex:50
#: lib/memex_web/live/pipeline_live/form_component.html.heex:56
#: lib/memex_web/live/step_live/form_component.html.heex:39
#, elixir-autogen, elixir-format
msgid "save"
msgstr ""

View File

@ -236,20 +236,20 @@ msgstr ""
msgid "report bugs or request features"
msgstr ""
#: lib/memex_web/live/context_live/form_component.html.heex:52
#: lib/memex_web/live/note_live/form_component.html.heex:50
#: lib/memex_web/live/pipeline_live/form_component.html.heex:56
#: lib/memex_web/live/step_live/form_component.html.heex:39
#: lib/memex_web/live/context_live/form_component.html.heex:53
#: lib/memex_web/live/note_live/form_component.html.heex:51
#: lib/memex_web/live/pipeline_live/form_component.html.heex:57
#: lib/memex_web/live/step_live/form_component.html.heex:40
#, elixir-autogen, elixir-format
msgid "saving..."
msgstr ""
#: lib/memex_web/live/context_live/form_component.html.heex:46
#: lib/memex_web/live/context_live/form_component.html.heex:47
#: lib/memex_web/live/note_live/form_component.html.heex:44
#: lib/memex_web/live/context_live/form_component.html.heex:48
#: lib/memex_web/live/note_live/form_component.html.heex:45
#: lib/memex_web/live/pipeline_live/form_component.html.heex:50
#: lib/memex_web/live/note_live/form_component.html.heex:46
#: lib/memex_web/live/pipeline_live/form_component.html.heex:51
#: lib/memex_web/live/pipeline_live/form_component.html.heex:52
#, elixir-autogen, elixir-format
msgid "select privacy"
msgstr ""
@ -265,12 +265,12 @@ msgstr ""
msgid "settings"
msgstr ""
#: lib/memex_web/live/context_live/form_component.html.heex:34
#: lib/memex_web/live/context_live/form_component.html.heex:39
#: lib/memex_web/live/note_live/form_component.html.heex:32
#: lib/memex_web/live/note_live/form_component.html.heex:37
#: lib/memex_web/live/pipeline_live/form_component.html.heex:38
#: lib/memex_web/live/pipeline_live/form_component.html.heex:43
#: lib/memex_web/live/context_live/form_component.html.heex:35
#: lib/memex_web/live/context_live/form_component.html.heex:40
#: lib/memex_web/live/note_live/form_component.html.heex:33
#: lib/memex_web/live/note_live/form_component.html.heex:38
#: lib/memex_web/live/pipeline_live/form_component.html.heex:39
#: lib/memex_web/live/pipeline_live/form_component.html.heex:44
#, elixir-autogen, elixir-format
msgid "tag1,tag2"
msgstr ""
@ -628,12 +628,12 @@ msgstr ""
msgid "password"
msgstr ""
#: lib/memex_web/live/invite_live/form_component.html.heex:32
#: lib/memex_web/live/invite_live/form_component.html.heex:33
#, elixir-autogen, elixir-format
msgid "uses left"
msgstr ""
#: lib/memex_web/live/invite_live/form_component.html.heex:44
#: lib/memex_web/live/invite_live/form_component.html.heex:45
#, elixir-autogen, elixir-format, fuzzy
msgid "leave \"uses left\" blank to make invite unlimited"
msgstr ""
@ -671,22 +671,22 @@ msgstr ""
msgid "reset your password"
msgstr ""
#: lib/memex_web/live/pipeline_live/form_component.html.heex:26
#: lib/memex_web/live/pipeline_live/form_component.html.heex:30
#: lib/memex_web/live/step_live/form_component.html.heex:26
#: lib/memex_web/live/step_live/form_component.html.heex:30
#: lib/memex_web/live/pipeline_live/form_component.html.heex:27
#: lib/memex_web/live/pipeline_live/form_component.html.heex:31
#: lib/memex_web/live/step_live/form_component.html.heex:27
#: lib/memex_web/live/step_live/form_component.html.heex:31
#, elixir-autogen, elixir-format
msgid "use [[[note-slug]]] to link to a note or use [[context-slug]] to link to a context or [pipeline-slug] to link to a pipeline"
msgstr ""
#: lib/memex_web/live/context_live/form_component.html.heex:26
#: lib/memex_web/live/context_live/form_component.html.heex:28
#: lib/memex_web/live/context_live/form_component.html.heex:27
#: lib/memex_web/live/context_live/form_component.html.heex:29
#, elixir-autogen, elixir-format, fuzzy
msgid "use [[note-slug]] to link to a note or [context-slug] to link to a context"
msgstr ""
#: lib/memex_web/live/note_live/form_component.html.heex:25
#: lib/memex_web/live/note_live/form_component.html.heex:26
#: lib/memex_web/live/note_live/form_component.html.heex:27
#, elixir-autogen, elixir-format, fuzzy
msgid "use [note-slug] to link to a note"
msgstr ""

View File

@ -138,7 +138,7 @@ msgstr ""
msgid "are you sure you want to delete %{email}? this action is permanent!"
msgstr ""
#: lib/memex_web/live/invite_live/form_component.html.heex:49
#: lib/memex_web/live/invite_live/form_component.html.heex:50
#, elixir-autogen, elixir-format, fuzzy
msgid "saving..."
msgstr ""

View File

@ -137,7 +137,7 @@ msgstr ""
msgid "are you sure you want to delete %{email}? this action is permanent!"
msgstr ""
#: lib/memex_web/live/invite_live/form_component.html.heex:49
#: lib/memex_web/live/invite_live/form_component.html.heex:50
#, elixir-autogen, elixir-format
msgid "saving..."
msgstr ""