Remove unneeded templates

This commit is contained in:
Mirai Kumiko 2025-06-14 18:52:04 +02:00
parent 49ac2bbe6f
commit 83182b9e7b
Signed by: miraikumiko
GPG key ID: 3F178B1B5E0CB278
10 changed files with 0 additions and 133 deletions

View file

@ -3,14 +3,6 @@ defmodule NullaWeb.UserHTML do
embed_templates "templates/user/*" embed_templates "templates/user/*"
@doc """
Renders a user form.
"""
attr :changeset, Ecto.Changeset, required: true
attr :action, :string, required: true
def user_form(assigns)
def format_birthdate(date) do def format_birthdate(date) do
formatted = Date.to_string(date) |> String.replace("-", "/") formatted = Date.to_string(date) |> String.replace("-", "/")
age = Timex.diff(Timex.today(), date, :years) age = Timex.diff(Timex.today(), date, :years)
@ -84,17 +76,3 @@ defmodule NullaWeb.UserHTML do
end end
end end
end end
defmodule NullaWeb.NoteHTML do
use NullaWeb, :html
embed_templates "templates/note/*"
@doc """
Renders a note form.
"""
attr :changeset, Ecto.Changeset, required: true
attr :action, :string, required: true
def note_form(assigns)
end

View file

@ -1,8 +0,0 @@
<.header>
Edit Note {@note.id}
<:subtitle>Use this form to manage note records in your database.</:subtitle>
</.header>
<.note_form changeset={@changeset} action={~p"/notes/#{@note}"} />
<.back navigate={~p"/notes"}>Back to notes</.back>

View file

@ -1,23 +0,0 @@
<.header>
Listing Notes
<:actions>
<.link href={~p"/notes/new"}>
<.button>New Note</.button>
</.link>
</:actions>
</.header>
<.table id="notes" rows={@notes} row_click={&JS.navigate(~p"/notes/#{&1}")}>
<:col :let={note} label="Content">{note.content}</:col>
<:action :let={note}>
<div class="sr-only">
<.link navigate={~p"/notes/#{note}"}>Show</.link>
</div>
<.link navigate={~p"/notes/#{note}/edit"}>Edit</.link>
</:action>
<:action :let={note}>
<.link href={~p"/notes/#{note}"} method="delete" data-confirm="Are you sure?">
Delete
</.link>
</:action>
</.table>

View file

@ -1,8 +0,0 @@
<.header>
New Note
<:subtitle>Use this form to manage note records in your database.</:subtitle>
</.header>
<.note_form changeset={@changeset} action={~p"/notes"} />
<.back navigate={~p"/notes"}>Back to notes</.back>

View file

@ -1,9 +0,0 @@
<.simple_form :let={f} for={@changeset} action={@action}>
<.error :if={@changeset.action}>
Oops, something went wrong! Please check the errors below.
</.error>
<.input field={f[:content]} type="text" label="Content" />
<:actions>
<.button>Save Note</.button>
</:actions>
</.simple_form>

View file

@ -1,15 +0,0 @@
<.header>
Note {@note.id}
<:subtitle>This is a note record from your database.</:subtitle>
<:actions>
<.link href={~p"/notes/#{@note}/edit"}>
<.button>Edit note</.button>
</.link>
</:actions>
</.header>
<.list>
<:item title="Content">{@note.content}</:item>
</.list>
<.back navigate={~p"/notes"}>Back to notes</.back>

View file

@ -1,8 +0,0 @@
<.header>
Edit User {@user.id}
<:subtitle>Use this form to manage user records in your database.</:subtitle>
</.header>
<.user_form changeset={@changeset} action={~p"/users/#{@user}"} />
<.back navigate={~p"/users"}>Back to users</.back>

View file

@ -1,23 +0,0 @@
<.header>
Listing Users
<:actions>
<.link href={~p"/users/new"}>
<.button>New User</.button>
</.link>
</:actions>
</.header>
<.table id="users" rows={@users} row_click={&JS.navigate(~p"/users/#{&1}")}>
<:col :let={user} label="Username">{user.username}</:col>
<:action :let={user}>
<div class="sr-only">
<.link navigate={~p"/users/#{user}"}>Show</.link>
</div>
<.link navigate={~p"/users/#{user}/edit"}>Edit</.link>
</:action>
<:action :let={user}>
<.link href={~p"/users/#{user}"} method="delete" data-confirm="Are you sure?">
Delete
</.link>
</:action>
</.table>

View file

@ -1,8 +0,0 @@
<.header>
New User
<:subtitle>Use this form to manage user records in your database.</:subtitle>
</.header>
<.user_form changeset={@changeset} action={~p"/users"} />
<.back navigate={~p"/users"}>Back to users</.back>

View file

@ -1,9 +0,0 @@
<.simple_form :let={f} for={@changeset} action={@action}>
<.error :if={@changeset.action}>
Oops, something went wrong! Please check the errors below.
</.error>
<.input field={f[:username]} type="text" label="Username" />
<:actions>
<.button>Save User</.button>
</:actions>
</.simple_form>