New welcome page
This commit is contained in:
@@ -4,4 +4,8 @@ defmodule OsuuspuutarhaWeb.PageController do
|
|||||||
def index(conn, _params) do
|
def index(conn, _params) do
|
||||||
render(conn, "index.html")
|
render(conn, "index.html")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def welcome(conn, _params) do
|
||||||
|
render(conn, "welcome.html")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
phx-change="validate"
|
phx-change="validate"
|
||||||
phx-submit="save">
|
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" %>
|
<%= select f, :order_type, Ecto.Enum.values(Osuuspuutarha.Orders.Order, :order_type), prompt: "Ei valintaa" %>
|
||||||
<%= error_tag f, :order_type %>
|
<%= error_tag f, :order_type %>
|
||||||
|
|
||||||
@@ -54,7 +54,7 @@
|
|||||||
<%= error_tag f, :split_invoice %>
|
<%= error_tag f, :split_invoice %>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<%= submit "Tallenna", phx_disable_with: "Tallennetaan..." %>
|
<%= submit @submit_text, phx_disable_with: "Tallennetaan..." %>
|
||||||
</div>
|
</div>
|
||||||
</.form>
|
</.form>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -17,12 +17,14 @@ defmodule OsuuspuutarhaWeb.OrderLive.Index do
|
|||||||
defp apply_action(socket, :edit, %{"id" => id}) do
|
defp apply_action(socket, :edit, %{"id" => id}) do
|
||||||
socket
|
socket
|
||||||
|> assign(:page_title, "Muokkaa tilausta")
|
|> assign(:page_title, "Muokkaa tilausta")
|
||||||
|
|> assign(:submit_text, "Tallenna")
|
||||||
|> assign(:order, Orders.get_order!(id))
|
|> assign(:order, Orders.get_order!(id))
|
||||||
end
|
end
|
||||||
|
|
||||||
defp apply_action(socket, :new, _params) do
|
defp apply_action(socket, :new, _params) do
|
||||||
socket
|
socket
|
||||||
|> assign(:page_title, "Satolaatikko tilaus")
|
|> assign(:page_title, "Satolaatikko tilaus")
|
||||||
|
|> assign(:submit_text, "Lähetä")
|
||||||
|> assign(:order, %Order{})
|
|> assign(:order, %Order{})
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
module={OsuuspuutarhaWeb.OrderLive.FormComponent}
|
module={OsuuspuutarhaWeb.OrderLive.FormComponent}
|
||||||
id={@order.id || :new}
|
id={@order.id || :new}
|
||||||
title={@page_title}
|
title={@page_title}
|
||||||
|
submit_text={@submit_text}
|
||||||
action={@live_action}
|
action={@live_action}
|
||||||
order={@order}
|
order={@order}
|
||||||
return_to={Routes.order_index_path(@socket, :index)}
|
return_to={Routes.order_index_path(@socket, :index)}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ defmodule OsuuspuutarhaWeb.Router do
|
|||||||
pipe_through :browser
|
pipe_through :browser
|
||||||
|
|
||||||
get "/", PageController, :index
|
get "/", PageController, :index
|
||||||
|
get "/tervetuloa", PageController, :welcome
|
||||||
|
|
||||||
live "/tilaukset", OrderLive.Index, :index
|
live "/tilaukset", OrderLive.Index, :index
|
||||||
live "/tilaukset/uusi", OrderLive.Index, :new
|
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