Update
This commit is contained in:
parent
8f63a831c4
commit
f963620cf0
11 changed files with 135 additions and 20 deletions
|
@ -95,3 +95,9 @@ defmodule NullaWeb.ActorHTML do
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
defmodule NullaWeb.NoteHTML do
|
||||
use NullaWeb, :html
|
||||
|
||||
embed_templates "templates/note/*"
|
||||
end
|
||||
|
|
22
lib/nulla_web/components/templates/note/show.html.heex
Normal file
22
lib/nulla_web/components/templates/note/show.html.heex
Normal 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>
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue