This commit is contained in:
@ -9,17 +9,17 @@
|
||||
phx-hook="CtrlEnter"
|
||||
class="flex flex-col justify-start items-stretch space-y-4"
|
||||
>
|
||||
<%= text_input(f, :slug,
|
||||
{text_input(f, :slug,
|
||||
aria_label: gettext("slug"),
|
||||
class: "input input-primary",
|
||||
phx_debounce: 300,
|
||||
phx_hook: "SanitizeTitles",
|
||||
placeholder: gettext("slug"),
|
||||
required: true
|
||||
) %>
|
||||
<%= error_tag(f, :slug) %>
|
||||
)}
|
||||
{error_tag(f, :slug)}
|
||||
|
||||
<%= textarea(f, :content,
|
||||
{textarea(f, :content,
|
||||
id: "context-form-content",
|
||||
class: "input input-primary h-64 min-h-64",
|
||||
phx_update: "ignore",
|
||||
@ -28,32 +28,32 @@
|
||||
aria_label:
|
||||
gettext("use [[note-slug]] to link to a note or [context-slug] to link to a context"),
|
||||
phx_debounce: 300
|
||||
) %>
|
||||
<%= error_tag(f, :content) %>
|
||||
)}
|
||||
{error_tag(f, :content)}
|
||||
|
||||
<%= text_input(f, :tags_string,
|
||||
{text_input(f, :tags_string,
|
||||
aria_label: gettext("tag1,tag2"),
|
||||
class: "input input-primary",
|
||||
id: "tags-input",
|
||||
phx_debounce: 300,
|
||||
phx_hook: "SanitizeTags",
|
||||
placeholder: gettext("tag1,tag2")
|
||||
) %>
|
||||
<%= error_tag(f, :tags_string) %>
|
||||
)}
|
||||
{error_tag(f, :tags_string)}
|
||||
|
||||
<div class="flex justify-center items-stretch space-x-4">
|
||||
<%= select(f, :visibility, Ecto.Enum.values(Memex.Contexts.Context, :visibility),
|
||||
{select(f, :visibility, Ecto.Enum.values(Memex.Contexts.Context, :visibility),
|
||||
class: "grow input input-primary",
|
||||
prompt: gettext("select privacy"),
|
||||
aria_label: gettext("select privacy"),
|
||||
phx_debounce: 300
|
||||
) %>
|
||||
)}
|
||||
|
||||
<%= submit(dgettext("actions", "save"),
|
||||
{submit(dgettext("actions", "save"),
|
||||
phx_disable_with: gettext("saving..."),
|
||||
class: "mx-auto btn btn-primary"
|
||||
) %>
|
||||
)}
|
||||
</div>
|
||||
<%= error_tag(f, :visibility) %>
|
||||
{error_tag(f, :visibility)}
|
||||
</.form>
|
||||
</div>
|
||||
|
@ -1,6 +1,6 @@
|
||||
<div class="flex flex-col justify-center items-start mx-auto space-y-4 max-w-3xl">
|
||||
<h1 class="text-xl">
|
||||
<%= gettext("contexts") %>
|
||||
{gettext("contexts")}
|
||||
</h1>
|
||||
|
||||
<.form
|
||||
@ -11,18 +11,18 @@
|
||||
phx-submit="search"
|
||||
class="flex flex-col items-stretch self-stretch"
|
||||
>
|
||||
<%= text_input(f, :search_term,
|
||||
{text_input(f, :search_term,
|
||||
class: "input input-primary",
|
||||
value: @search,
|
||||
role: "search",
|
||||
phx_debounce: 300,
|
||||
placeholder: gettext("search")
|
||||
) %>
|
||||
)}
|
||||
</.form>
|
||||
|
||||
<%= if @contexts |> Enum.empty?() do %>
|
||||
<h1 class="self-center text-primary-500">
|
||||
<%= gettext("no contexts found") %>
|
||||
{gettext("no contexts found")}
|
||||
</h1>
|
||||
<% else %>
|
||||
<.live_component
|
||||
@ -37,7 +37,7 @@
|
||||
patch={~p"/contexts/#{context}/edit"}
|
||||
aria-label={dgettext("actions", "edit %{context_slug}", context_slug: context.slug)}
|
||||
>
|
||||
<%= dgettext("actions", "edit") %>
|
||||
{dgettext("actions", "edit")}
|
||||
</.link>
|
||||
<.link
|
||||
:if={@current_user}
|
||||
@ -47,14 +47,14 @@
|
||||
data-confirm={dgettext("prompts", "are you sure?")}
|
||||
aria-label={dgettext("actions", "delete %{context_slug}", context_slug: context.slug)}
|
||||
>
|
||||
<%= dgettext("actions", "delete") %>
|
||||
{dgettext("actions", "delete")}
|
||||
</.link>
|
||||
</:actions>
|
||||
</.live_component>
|
||||
<% end %>
|
||||
|
||||
<.link :if={@current_user} patch={~p"/contexts/new"} class="self-end btn btn-primary">
|
||||
<%= dgettext("actions", "new context") %>
|
||||
{dgettext("actions", "new context")}
|
||||
</.link>
|
||||
</div>
|
||||
|
||||
|
@ -1,11 +1,11 @@
|
||||
<div class="flex flex-col justify-center items-stretch mx-auto space-y-4 max-w-3xl">
|
||||
<h1 class="text-xl">
|
||||
<%= @context.slug %>
|
||||
{@context.slug}
|
||||
</h1>
|
||||
|
||||
<div class="flex flex-wrap space-x-1">
|
||||
<.link :for={tag <- @context.tags} navigate={~p"/contexts/#{tag}"} class="link">
|
||||
<%= tag %>
|
||||
{tag}
|
||||
</.link>
|
||||
</div>
|
||||
|
||||
@ -15,30 +15,30 @@
|
||||
:if={@context_backlinks ++ @pipeline_backlinks != []}
|
||||
class="flex flex-wrap justify-end items-center self-end"
|
||||
>
|
||||
<p><%= gettext("Backlinked by:") %></p>
|
||||
<p>{gettext("Backlinked by:")}</p>
|
||||
<.link
|
||||
:for={backlink <- @context_backlinks}
|
||||
class="m-1 hover:underline"
|
||||
patch={~p"/context/#{backlink}"}
|
||||
>
|
||||
<%= gettext("[%{slug}]", slug: backlink.slug) %>
|
||||
{gettext("[%{slug}]", slug: backlink.slug)}
|
||||
</.link>
|
||||
<.link
|
||||
:for={backlink <- @pipeline_backlinks}
|
||||
class="m-1 hover:underline"
|
||||
patch={~p"/pipeline/#{backlink}"}
|
||||
>
|
||||
<%= gettext("[[%{slug}]]", slug: backlink.slug) %>
|
||||
{gettext("[[%{slug}]]", slug: backlink.slug)}
|
||||
</.link>
|
||||
</div>
|
||||
|
||||
<p class="self-end">
|
||||
<%= gettext("Visibility: %{visibility}", visibility: @context.visibility) %>
|
||||
{gettext("Visibility: %{visibility}", visibility: @context.visibility)}
|
||||
</p>
|
||||
|
||||
<div class="flex self-end space-x-4">
|
||||
<.link :if={@current_user} class="btn btn-primary" patch={~p"/context/#{@context}/edit"}>
|
||||
<%= dgettext("actions", "edit") %>
|
||||
{dgettext("actions", "edit")}
|
||||
</.link>
|
||||
<button
|
||||
:if={@current_user}
|
||||
@ -48,7 +48,7 @@
|
||||
data-confirm={dgettext("prompts", "are you sure?")}
|
||||
aria-label={dgettext("actions", "delete %{context_slug}", context_slug: @context.slug)}
|
||||
>
|
||||
<%= dgettext("actions", "delete") %>
|
||||
{dgettext("actions", "delete")}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user