New welcome page
This commit is contained in:
@@ -4,4 +4,8 @@ defmodule OsuuspuutarhaWeb.PageController do
|
||||
def index(conn, _params) do
|
||||
render(conn, "index.html")
|
||||
end
|
||||
|
||||
def welcome(conn, _params) do
|
||||
render(conn, "welcome.html")
|
||||
end
|
||||
end
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
phx-change="validate"
|
||||
phx-submit="save">
|
||||
|
||||
<%= label f, :order_type, "Valitse tilausmuoto" %>
|
||||
<%= label f, :order_type, "Valitse tilausmuoto" %>
|
||||
<%= select f, :order_type, Ecto.Enum.values(Osuuspuutarha.Orders.Order, :order_type), prompt: "Ei valintaa" %>
|
||||
<%= error_tag f, :order_type %>
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
<%= error_tag f, :split_invoice %>
|
||||
|
||||
<div>
|
||||
<%= submit "Tallenna", phx_disable_with: "Tallennetaan..." %>
|
||||
<%= submit @submit_text, phx_disable_with: "Tallennetaan..." %>
|
||||
</div>
|
||||
</.form>
|
||||
</div>
|
||||
|
||||
@@ -17,12 +17,14 @@ defmodule OsuuspuutarhaWeb.OrderLive.Index do
|
||||
defp apply_action(socket, :edit, %{"id" => id}) do
|
||||
socket
|
||||
|> assign(:page_title, "Muokkaa tilausta")
|
||||
|> assign(:submit_text, "Tallenna")
|
||||
|> assign(:order, Orders.get_order!(id))
|
||||
end
|
||||
|
||||
defp apply_action(socket, :new, _params) do
|
||||
socket
|
||||
|> assign(:page_title, "Satolaatikko tilaus")
|
||||
|> assign(:submit_text, "Lähetä")
|
||||
|> assign(:order, %Order{})
|
||||
end
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
module={OsuuspuutarhaWeb.OrderLive.FormComponent}
|
||||
id={@order.id || :new}
|
||||
title={@page_title}
|
||||
submit_text={@submit_text}
|
||||
action={@live_action}
|
||||
order={@order}
|
||||
return_to={Routes.order_index_path(@socket, :index)}
|
||||
|
||||
@@ -18,6 +18,7 @@ defmodule OsuuspuutarhaWeb.Router do
|
||||
pipe_through :browser
|
||||
|
||||
get "/", PageController, :index
|
||||
get "/tervetuloa", PageController, :welcome
|
||||
|
||||
live "/tilaukset", OrderLive.Index, :index
|
||||
live "/tilaukset/uusi", OrderLive.Index, :new
|
||||
|
||||
12
lib/osuuspuutarha_web/templates/page/welcome.html.heex
Normal file
12
lib/osuuspuutarha_web/templates/page/welcome.html.heex
Normal file
@@ -0,0 +1,12 @@
|
||||
<h2>Tervetuloa osuuspuutarhan jäseneksi</h2>
|
||||
|
||||
<p>Tarjouksemme ovat seuraavat</p>
|
||||
|
||||
<ul>
|
||||
<li>Asd</li>
|
||||
<li>Qwe</li>
|
||||
<li>Zxc</li>
|
||||
</ul>
|
||||
|
||||
<h3>Voit lähteä mukaan alla olevasta linkistä</h3>
|
||||
<%= link "Liity jäseneksi", to: Routes.order_index_path(@conn, :new) %>
|
||||
Reference in New Issue
Block a user