67 lines
1.9 KiB
Plaintext
Raw Normal View History

<div class="flex flex-col justify-center items-stretch mx-auto space-y-4 max-w-3xl">
2022-11-24 12:44:34 -05:00
<h1 class="text-xl">
2022-11-26 14:51:18 -05:00
<%= @context.slug %>
2022-11-24 12:44:34 -05:00
</h1>
2022-12-15 22:33:10 -05:00
<div class="flex flex-wrap space-x-1">
2023-04-13 23:29:29 -04:00
<.link :for={tag <- @context.tags} navigate={~p"/contexts/#{tag}"} class="link">
2023-02-04 11:29:06 -05:00
<%= tag %>
</.link>
2022-12-15 22:33:10 -05:00
</div>
2022-11-24 12:44:34 -05:00
2022-11-26 16:36:30 -05:00
<.context_content context={@context} />
2022-11-24 12:44:34 -05:00
2025-02-15 06:00:37 +00:00
<div
:if={@context_backlinks ++ @pipeline_backlinks != []}
class="flex flex-wrap justify-end items-center self-end"
>
<p><%= gettext("Backlinked by:") %></p>
<.link
:for={backlink <- @context_backlinks}
class="m-1 hover:underline"
patch={~p"/context/#{backlink}"}
>
<%= 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) %>
</.link>
</div>
2022-11-24 12:44:34 -05:00
<p class="self-end">
<%= 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"}>
2023-02-04 11:29:06 -05:00
<%= dgettext("actions", "edit") %>
</.link>
<button
:if={@current_user}
2023-02-04 11:29:06 -05:00
type="button"
class="btn btn-primary"
phx-click="delete"
data-confirm={dgettext("prompts", "are you sure?")}
aria-label={dgettext("actions", "delete %{context_slug}", context_slug: @context.slug)}
2023-02-04 11:29:06 -05:00
>
<%= dgettext("actions", "delete") %>
</button>
2022-11-24 12:44:34 -05:00
</div>
</div>
2022-07-25 20:11:08 -04:00
2023-04-13 23:29:29 -04:00
<.modal :if={@live_action == :edit} return_to={~p"/context/#{@context}"}>
2023-02-04 11:29:06 -05:00
<.live_component
module={MemexWeb.ContextLive.FormComponent}
id={@context.id}
current_user={@current_user}
title={@page_title}
action={@live_action}
context={@context}
2023-04-13 23:29:29 -04:00
return_to={~p"/context/#{@context}"}
2023-02-04 11:29:06 -05:00
/>
</.modal>