ee cummings this shit

This commit is contained in:
2022-11-17 22:30:01 -05:00
parent 821a8e223c
commit f1889aec07
36 changed files with 177 additions and 176 deletions

View File

@ -32,7 +32,7 @@ defmodule MemexWeb.NoteLive.FormComponent do
{:ok, _note} ->
{:noreply,
socket
|> put_flash(:info, "Note updated successfully")
|> put_flash(:info, gettext("%{title} saved", title: title))
|> push_navigate(to: socket.assigns.return_to)}
{:error, %Ecto.Changeset{} = changeset} ->
@ -45,7 +45,7 @@ defmodule MemexWeb.NoteLive.FormComponent do
{:ok, _note} ->
{:noreply,
socket
|> put_flash(:info, "Note created successfully")
|> put_flash(:info, gettext("%{title} created", title: title))
|> push_navigate(to: socket.assigns.return_to)}
{:error, %Ecto.Changeset{} = changeset} ->

View File

@ -16,19 +16,19 @@ defmodule MemexWeb.NoteLive.Index do
defp apply_action(socket, :edit, %{"id" => id}) do
socket
|> assign(:page_title, "Edit Note")
|> assign(page_title: gettext("edit %{title}", title: title))
|> assign(:note, Notes.get_note!(id))
end
defp apply_action(socket, :new, _params) do
socket
|> assign(:page_title, "New Note")
|> assign(page_title: "new note")
|> assign(:note, %Note{})
end
defp apply_action(socket, :index, _params) do
socket
|> assign(:page_title, "Listing Notes")
|> assign(page_title: "notes")
|> assign(:note, nil)
end
@ -37,8 +37,7 @@ defmodule MemexWeb.NoteLive.Index do
note = Notes.get_note!(id)
{:ok, _} = Notes.delete_note(note)
{:noreply, assign(socket, :notes, list_notes())}
end
|> put_flash(:info, gettext("%{title} deleted", title: title))
defp list_notes do
Notes.list_notes()

View File

@ -16,6 +16,6 @@ defmodule MemexWeb.NoteLive.Show do
|> assign(:note, Notes.get_note!(id))}
end
defp page_title(:show), do: "Show Note"
defp page_title(:edit), do: "Edit Note"
defp page_title(:show), do: "show note"
defp page_title(:edit), do: "edit note"
end