This commit is contained in:
Mirai Kumiko 2025-06-19 16:16:27 +02:00
parent 8f63a831c4
commit f963620cf0
Signed by: miraikumiko
GPG key ID: 3F178B1B5E0CB278
11 changed files with 135 additions and 20 deletions

View file

@ -95,3 +95,9 @@ defmodule NullaWeb.ActorHTML do
end
end
end
defmodule NullaWeb.NoteHTML do
use NullaWeb, :html
embed_templates "templates/note/*"
end

View file

@ -0,0 +1,22 @@
<main class="grid grid-cols-[25%_50%_25%]">
<div class="flex flex-col items-center mt-5 gap-5">
<input
placeholder="Search"
class="border border-gray-300 px-4 py-3 rounded-xl outline-none w-[90%]"
/>
<div class="text-sm rounded-xl border border-gray-300 p-2 w-[90%]">
<textarea
placeholder="What's on your mind?"
class="h-[150px] w-full resize-none border-none focus:ring-0"
></textarea>
<div>
<button class="text-white bg-black px-3 py-1 rounded-xl">Post</button>
</div>
</div>
</div>
<div class="relative border border-gray-300 shadow-md mt-5 rounded-t-xl overflow-hidden">
</div>
<div class="flex flex-col items-center mt-5 gap-5">
<div class="text-sm rounded-xl border border-gray-300 p-4 w-[90%] h-[300px]"></div>
</div>
</main>

View file

@ -6,12 +6,12 @@ defmodule NullaWeb.NoteController do
def show(conn, %{"username" => username, "id" => id}) do
accept = List.first(get_req_header(conn, "accept"))
note = Note.get_note!(id) |> Repo.preload([:user, :media_attachments])
note = Note.get_note(id) |> Repo.preload([:actor, :media_attachments])
if username != note.user.username do
if username != note.actor.preferredUsername do
conn
|> put_status(:not_found)
|> json(%{error: "Note not found"})
|> json(%{error: "Not Found"})
|> halt()
end

View file

@ -35,7 +35,7 @@ defmodule NullaWeb.Router do
get "/followers", FollowController, :followers
post "/inbox", InboxController, :inbox
get "/outbox", OutboxController, :outbox
get "/statuses/:id", NoteController, :show
get "/notes/:id", NoteController, :show
end
scope "/@:username" do