new form
This commit is contained in:
parent
de632cdfdc
commit
5731765e8d
2 changed files with 38 additions and 37 deletions
|
@ -1,3 +1,41 @@
|
|||
defmodule WildWeb.BookThoughts do
|
||||
use WildWeb, :live_view
|
||||
|
||||
def render(assigns) do
|
||||
~H"""
|
||||
<div class="mx-auto">
|
||||
<.header class="text-center">
|
||||
Write your thoughts for a book or a series of books
|
||||
<:subtitle>
|
||||
Share your thoughts and suggestion on the book that you just read
|
||||
</:subtitle>
|
||||
</.header>
|
||||
|
||||
<.simple_form for={@form} id="login_form" action={~p"/account/log_in"} phx-update="ignore">
|
||||
<.input field={@form[:email]} type="text" label="Book Title" required />
|
||||
<.input field={@form[:password]} type="number" label="Publication Year" required />
|
||||
<.input field={@form[:password]} type="range" label="Rating" required />
|
||||
|
||||
<:actions>
|
||||
<.input field={@form[:remember_me]} type="checkbox" label="Keep me logged in" />
|
||||
<.link href={~p"/account/reset_password"} class="text-sm font-semibold">
|
||||
Forgot your password?
|
||||
</.link>
|
||||
</:actions>
|
||||
<:actions>
|
||||
<.button phx-disable-with="Logging in..." class="w-full">
|
||||
Log in <span aria-hidden="true">→</span>
|
||||
</.button>
|
||||
</:actions>
|
||||
</.simple_form>
|
||||
</div>
|
||||
"""
|
||||
end
|
||||
|
||||
def mount(_params, _session, socket) do
|
||||
email = Phoenix.Flash.get(socket.assigns.flash, :email)
|
||||
form = to_form(%{"email" => email}, as: "user")
|
||||
{:ok, assign(socket, form: form), temporary_assigns: [form: form]}
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
@ -1,37 +0,0 @@
|
|||
<h1>Our Book Journey</h1>
|
||||
|
||||
<div>
|
||||
<h2>Book name</h2>
|
||||
<p>Review times</p>
|
||||
</div>
|
||||
|
||||
<div class="flex flex-col sm:flex-row bg-white border shadow-sm rounded-xl hover:shadow-lg focus:outline-none focus:shadow-lg transition dark:bg-neutral-900 dark:border-neutral-700 dark:shadow-neutral-700/70" >
|
||||
<img src={~p"/images/book-card-homepage.jpg"} class="w-1/2 h-auto rounded-t-xl">
|
||||
|
||||
<div>
|
||||
|
||||
<div class="flex px-4 pt-4 sm:px-5 sm:pt-5">
|
||||
<h3 class="flex-1 flex-row text-lg font-bold text-gray-800 dark:text-white">
|
||||
Book Name
|
||||
</h3>
|
||||
|
||||
<p class="flex-1 flex-row dark:text-white text-right">
|
||||
4 thoughts
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<p class="text-gray-400 w-full px-5 pb-5">
|
||||
by author name, published 1999
|
||||
</p>
|
||||
|
||||
<div class="p-5 mt-1">
|
||||
<h3 class="font-bold text-gray-800 dark:text-white">
|
||||
Recent thoughts from Thu
|
||||
</h3>
|
||||
<p class="text-gray-500 dark:text-neutral-400">
|
||||
Some quick example text to build on the card title and make up the bulk of the card's content.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
Loading…
Add table
Add a link
Reference in a new issue