Public registration changed from performers to visitors.
This commit is contained in:
@@ -18,8 +18,7 @@ defmodule RunosaariWeb.VisitorController do
|
||||
case Registration.create_visitor(visitor_params) do
|
||||
{:ok, visitor} ->
|
||||
conn
|
||||
|> put_flash(:info, "Visitor created successfully.")
|
||||
|> redirect(to: Routes.visitor_path(conn, :show, visitor))
|
||||
|> redirect(to: Routes.visitor_path(conn, :confirmation))
|
||||
|
||||
{:error, %Ecto.Changeset{} = changeset} ->
|
||||
render(conn, "new.html", changeset: changeset)
|
||||
@@ -59,4 +58,8 @@ defmodule RunosaariWeb.VisitorController do
|
||||
|> put_flash(:info, "Visitor deleted successfully.")
|
||||
|> redirect(to: Routes.visitor_path(conn, :index))
|
||||
end
|
||||
|
||||
def confirmation(conn, _params) do
|
||||
render(conn, "confirmation.html")
|
||||
end
|
||||
end
|
||||
|
||||
@@ -21,6 +21,8 @@ defmodule RunosaariWeb.Router do
|
||||
get "/covid19", PageController, :covid19
|
||||
resources "/performers", PerformerController, only: [:index, :show]
|
||||
resources "/performances", PerformanceController, only: [:index, :show]
|
||||
resources "/visitors", VisitorController, only: [:new, :create]
|
||||
get "/confirmation", VisitorController, :confirmation
|
||||
end
|
||||
|
||||
scope "/admin", RunosaariWeb, as: :admin do
|
||||
@@ -30,6 +32,7 @@ defmodule RunosaariWeb.Router do
|
||||
get "/performances", PerformanceController, :admin
|
||||
resources "/performers", PerformerController, except: [:index, :show]
|
||||
resources "/performances", PerformanceController, except: [:index, :show]
|
||||
resources "/visitors", VisitorController, except: [:new, :create]
|
||||
end
|
||||
|
||||
# Other scopes may use custom stacks.
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
<%= link "Esiintyjät", to: Routes.performer_path(@conn, :index) %>
|
||||
<%= link "Info", to: Routes.page_path(@conn, :info) %>
|
||||
<%= link "Covid-19", to: Routes.page_path(@conn, :covid19) %>
|
||||
<%= link "Ilmoittautuminen", to: Routes.admin_performer_path(@conn, :new) %>
|
||||
<%= link "Ilmoittautuminen", to: Routes.visitor_path(@conn, :new) %>
|
||||
</nav>
|
||||
<h1 class="mobile-main-title">
|
||||
<a href="/#logo-container">Runosaari 2021</a>
|
||||
@@ -31,7 +31,7 @@
|
||||
<%= link "Esiintyjät", to: "#{Routes.performer_path(@conn, :index)}#performers-start" %>
|
||||
<%= link "Info", to: "#{Routes.page_path(@conn, :info)}#contact-start" %>
|
||||
<%= link "Covid-19", to: "#{Routes.page_path(@conn, :covid19)}#covid-start" %>
|
||||
<%= link "Ilmoittautuminen", to: "#{Routes.admin_performer_path(@conn, :new)}#registration-start" %>
|
||||
<%= link "Ilmoittautuminen", to: "#{Routes.visitor_path(@conn, :new)}#registration-start" %>
|
||||
</nav>
|
||||
</header>
|
||||
<main role="main">
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<section class="text">
|
||||
<h1 id="registration-start">Ilmoittaudu</h1>
|
||||
<h1>Ilmoittaudu</h1>
|
||||
|
||||
<%= render "form.html", Map.put(assigns, :action, Routes.admin_performer_path(@conn, :create)) %>
|
||||
</section>
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
<section class="text">
|
||||
<h2>Ilmoittautumisesi on rekisteröity. </h2>
|
||||
<h1>Tervetuloa mukaan!</h1>
|
||||
<h3>Tapahtuman järjestäjät ovat teihin yhteydessä sähköpostilla tarpeen mukaan.</h3>
|
||||
</section>
|
||||
@@ -1,47 +1,55 @@
|
||||
<%= form_for @changeset, @action, fn f -> %>
|
||||
<%= form_for @changeset, @action, fn form -> %>
|
||||
<%= if @changeset.action do %>
|
||||
<div class="alert alert-danger">
|
||||
<p>Oops, something went wrong! Please check the errors below.</p>
|
||||
<p>Jokin kentistä on tyhjä.</p>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<%= label f, :fname %>
|
||||
<%= text_input f, :fname %>
|
||||
<%= error_tag f, :fname %>
|
||||
<%= label form, :fname, "Etunimi" %>
|
||||
<%= text_input form, :fname %>
|
||||
<%= error_tag form, :fname %>
|
||||
|
||||
<%= label f, :lname %>
|
||||
<%= text_input f, :lname %>
|
||||
<%= error_tag f, :lname %>
|
||||
<%= label form, :lname, "Sukunimi" %>
|
||||
<%= text_input form, :lname %>
|
||||
<%= error_tag form, :lname %>
|
||||
|
||||
<%= label f, :email %>
|
||||
<%= text_input f, :email %>
|
||||
<%= error_tag f, :email %>
|
||||
<%= label form, :email, "Sähköposti" %>
|
||||
<%= email_input form, :email %>
|
||||
<%= error_tag form, :email %>
|
||||
|
||||
<%= label f, :tel %>
|
||||
<%= text_input f, :tel %>
|
||||
<%= error_tag f, :tel %>
|
||||
<%= label form, :tel, "Puhelinumero" %>
|
||||
<%= text_input form, :tel %>
|
||||
<%= error_tag form, :tel %>
|
||||
|
||||
<%= label f, :date1 %>
|
||||
<%= checkbox f, :date1 %>
|
||||
<%= error_tag f, :date1 %>
|
||||
<h2>Ilmoita alustava kiinnostuksesi tässä</h2>
|
||||
|
||||
<%= label f, :date2 %>
|
||||
<%= checkbox f, :date2 %>
|
||||
<%= error_tag f, :date2 %>
|
||||
|
||||
<%= label f, :date3 %>
|
||||
<%= checkbox f, :date3 %>
|
||||
<%= error_tag f, :date3 %>
|
||||
|
||||
<%= label f, :bus %>
|
||||
<%= checkbox f, :bus %>
|
||||
<%= error_tag f, :bus %>
|
||||
|
||||
<%= label f, :accom %>
|
||||
<%= checkbox f, :accom %>
|
||||
<%= error_tag f, :accom %>
|
||||
<div class="checkbox-container">
|
||||
<%= checkbox form, :date1 %>
|
||||
<%= label form, :date1, "Torstai 22.7" %>
|
||||
<%= error_tag form, :date1 %>
|
||||
</div>
|
||||
<div class="checkbox-container">
|
||||
<%= checkbox form, :date2 %>
|
||||
<%= label form, :date2, "Perjantai 23.7." %>
|
||||
<%= error_tag form, :date2 %>
|
||||
</div>
|
||||
<div class="checkbox-container">
|
||||
<%= checkbox form, :date3 %>
|
||||
<%= label form, :date3, "Lauantai 24.7." %>
|
||||
<%= error_tag form, :date3 %>
|
||||
</div>
|
||||
<div class="checkbox-container">
|
||||
<%= checkbox form, :bus %>
|
||||
<%= label form, :bus, "Olen kiinnostunut bussikuljetuksesta" %>
|
||||
<%= error_tag form, :bus %>
|
||||
</div>
|
||||
<div class="checkbox-container">
|
||||
<%= checkbox form, :accom %>
|
||||
<%= label form, :accom, "Olen kiinnostunut majoituksesta" %>
|
||||
<%= error_tag form, :accom %>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<%= submit "Save" %>
|
||||
<%= submit "Lähetä" %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<h1>New Visitor</h1>
|
||||
<section class="text">
|
||||
<h1 id="registration-start">Ilmoittaudu vierailijaksi</h1>
|
||||
|
||||
<%= render "form.html", Map.put(assigns, :action, Routes.visitor_path(@conn, :create)) %>
|
||||
|
||||
<span><%= link "Back", to: Routes.visitor_path(@conn, :index) %></span>
|
||||
<%= render "form.html", Map.put(assigns, :action, Routes.visitor_path(@conn, :create)) %>
|
||||
</section>
|
||||
|
||||
Reference in New Issue
Block a user