diff --git a/lib/annot_at/atproto.ex b/lib/annot_at/atproto.ex new file mode 100644 index 0000000..88272a9 --- /dev/null +++ b/lib/annot_at/atproto.ex @@ -0,0 +1,17 @@ +defmodule AnnotAt.Atproto do + @moduledoc """ + atproto is the protocol that underpins all of the functionality + in this service. + + https://atproto.com/ + """ + + @inspect_site "https://pdsls.dev/" + + @doc """ + Let users inspect their records. + """ + def inspect_url(aturi) do + @inspect_site <> aturi + end +end diff --git a/lib/annot_at/atproto/standard_site.ex b/lib/annot_at/atproto/standard_site.ex index 0704e0e..1d7b774 100644 --- a/lib/annot_at/atproto/standard_site.ex +++ b/lib/annot_at/atproto/standard_site.ex @@ -126,6 +126,13 @@ defmodule AnnotAt.Atproto.StandardSite do } end + @doc """ + Construct an at-uri for a document, useful when referencing documents. + """ + def document_uri(did, rkey) do + "at://#{did}/site.standard.document/#{rkey}" + end + defp fetch_user(user_id) do case Accounts.get_user(user_id) do nil -> {:error, :no_session} diff --git a/lib/annot_at_web/components/layouts.ex b/lib/annot_at_web/components/layouts.ex index 2ab7ad0..b553e3b 100644 --- a/lib/annot_at_web/components/layouts.ex +++ b/lib/annot_at_web/components/layouts.ex @@ -80,9 +80,7 @@ defmodule AnnotAtWeb.Layouts do
- <.form for={@form} phx-change="suggest" phx-submit="login" class="mt-6 space-y-4"> + <.form + for={@form} + id="login-form" + phx-change="suggest" + phx-submit="login" + class="mt-6 space-y-4" + > - <.site_cards site={@site} record={@record} feed={@feed} /> + <.site_cards site={@site} record={@record} feed={@feed} did={@current_scope.user.did} /> <% :feed -> %> <.feed_step feeds={@feeds} /> <% :publication -> %> @@ -86,8 +86,7 @@ defmodule AnnotAtWeb.SiteLive do site⦠<:failed :let={_}> -Couldn't read your - site.
+Couldn't read your site.