Admin pages.
This commit is contained in:
@@ -9,6 +9,11 @@ defmodule RunosaariWeb.LocationController do
|
|||||||
render(conn, "index.html", locations: locations)
|
render(conn, "index.html", locations: locations)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def admin(conn, _params) do
|
||||||
|
locations = Area.list_locations()
|
||||||
|
render(conn, "admin.html", locations: locations)
|
||||||
|
end
|
||||||
|
|
||||||
def new(conn, _params) do
|
def new(conn, _params) do
|
||||||
changeset = Area.change_location(%Location{})
|
changeset = Area.change_location(%Location{})
|
||||||
render(conn, "new.html", changeset: changeset)
|
render(conn, "new.html", changeset: changeset)
|
||||||
|
|||||||
@@ -9,6 +9,11 @@ defmodule RunosaariWeb.PerformanceController do
|
|||||||
render(conn, "index.html", performances: performances)
|
render(conn, "index.html", performances: performances)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def admin(conn, _params) do
|
||||||
|
performances = Schedule.list_performances()
|
||||||
|
render(conn, "admin.html", performances: performances)
|
||||||
|
end
|
||||||
|
|
||||||
def new(conn, _params) do
|
def new(conn, _params) do
|
||||||
changeset = Schedule.change_performance(%Performance{})
|
changeset = Schedule.change_performance(%Performance{})
|
||||||
render(conn, "new.html", changeset: changeset)
|
render(conn, "new.html", changeset: changeset)
|
||||||
|
|||||||
@@ -9,6 +9,11 @@ defmodule RunosaariWeb.PerformerController do
|
|||||||
render(conn, "index.html", performers: performers)
|
render(conn, "index.html", performers: performers)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def admin(conn, _params) do
|
||||||
|
performers = Registration.list_performers()
|
||||||
|
render(conn, "admin.html", performers: performers)
|
||||||
|
end
|
||||||
|
|
||||||
def new(conn, _params) do
|
def new(conn, _params) do
|
||||||
changeset = Registration.change_performer(%Performer{})
|
changeset = Registration.change_performer(%Performer{})
|
||||||
render(conn, "new.html", changeset: changeset)
|
render(conn, "new.html", changeset: changeset)
|
||||||
|
|||||||
@@ -25,6 +25,9 @@ defmodule RunosaariWeb.Router do
|
|||||||
scope "/admin", RunosaariWeb, as: :admin do
|
scope "/admin", RunosaariWeb, as: :admin do
|
||||||
pipe_through :browser
|
pipe_through :browser
|
||||||
|
|
||||||
|
get "/performers", PerformerController, :admin
|
||||||
|
get "/performers", PerformanceController, :admin
|
||||||
|
get "/performers", LocationController, :admin
|
||||||
resources "/performers", PerformerController, except: [:index, :show]
|
resources "/performers", PerformerController, except: [:index, :show]
|
||||||
resources "/performances", PerformanceController, except: [:index, :show]
|
resources "/performances", PerformanceController, except: [:index, :show]
|
||||||
resources "/locations", LocationController, except: [:index, :show]
|
resources "/locations", LocationController, except: [:index, :show]
|
||||||
|
|||||||
34
lib/runosaari_web/templates/location/admin.html.eex
Normal file
34
lib/runosaari_web/templates/location/admin.html.eex
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
<h1>Tapahtumapaikat - HALLINTA</h1>
|
||||||
|
|
||||||
|
<table>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Name</th>
|
||||||
|
<th>Address</th>
|
||||||
|
<th>Reserved seats</th>
|
||||||
|
<th>Max seats</th>
|
||||||
|
<th>Description</th>
|
||||||
|
|
||||||
|
<th></th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<%= for location <- @locations do %>
|
||||||
|
<tr>
|
||||||
|
<td><%= location.name %></td>
|
||||||
|
<td><%= location.address %></td>
|
||||||
|
<td><%= location.reserved_seats %></td>
|
||||||
|
<td><%= location.max_seats %></td>
|
||||||
|
<td><%= location.description %></td>
|
||||||
|
|
||||||
|
<td>
|
||||||
|
<span><%= link "Show", to: Routes.location_path(@conn, :show, location) %></span>
|
||||||
|
<span><%= link "Edit", to: Routes.admin_location_path(@conn, :edit, location) %></span>
|
||||||
|
<span><%= link "Delete", to: Routes.admin_location_path(@conn, :delete, location), method: :delete, data: [confirm: "Are you sure?"] %></span>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<% end %>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<span><%= link "New Location", to: Routes.admin_location_path(@conn, :new) %></span>
|
||||||
@@ -20,15 +20,9 @@
|
|||||||
<td><%= location.reserved_seats %></td>
|
<td><%= location.reserved_seats %></td>
|
||||||
<td><%= location.max_seats %></td>
|
<td><%= location.max_seats %></td>
|
||||||
<td><%= location.description %></td>
|
<td><%= location.description %></td>
|
||||||
|
|
||||||
<td>
|
|
||||||
<span><%= link "Show", to: Routes.location_path(@conn, :show, location) %></span>
|
|
||||||
<span><%= link "Edit", to: Routes.admin_location_path(@conn, :edit, location) %></span>
|
|
||||||
<span><%= link "Delete", to: Routes.admin_location_path(@conn, :delete, location), method: :delete, data: [confirm: "Are you sure?"] %></span>
|
|
||||||
</td>
|
|
||||||
</tr>
|
</tr>
|
||||||
<% end %>
|
<% end %>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<span><%= link "New Location", to: Routes.admin_location_path(@conn, :new) %></span>
|
<span><%= link "Hallinta", to: Routes.admin_location_path(@conn, :admin) %></span>
|
||||||
|
|||||||
30
lib/runosaari_web/templates/performance/admin.html.eex
Normal file
30
lib/runosaari_web/templates/performance/admin.html.eex
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
<h1>Ohjelma - HALLINTA</h1>
|
||||||
|
|
||||||
|
<table>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Time</th>
|
||||||
|
<th>Description</th>
|
||||||
|
<th>Notes</th>
|
||||||
|
|
||||||
|
<th></th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<%= for performance <- @performances do %>
|
||||||
|
<tr>
|
||||||
|
<td><%= performance.time %></td>
|
||||||
|
<td><%= performance.description %></td>
|
||||||
|
<td><%= performance.notes %></td>
|
||||||
|
|
||||||
|
<td>
|
||||||
|
<span><%= link "Show", to: Routes.performance_path(@conn, :show, performance) %></span>
|
||||||
|
<span><%= link "Edit", to: Routes.admin_performance_path(@conn, :edit, performance) %></span>
|
||||||
|
<span><%= link "Delete", to: Routes.admin_performance_path(@conn, :delete, performance), method: :delete, data: [confirm: "Are you sure?"] %></span>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<% end %>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<span><%= link "New Performance", to: Routes.admin_performance_path(@conn, :new) %></span>
|
||||||
@@ -16,15 +16,9 @@
|
|||||||
<td><%= performance.time %></td>
|
<td><%= performance.time %></td>
|
||||||
<td><%= performance.description %></td>
|
<td><%= performance.description %></td>
|
||||||
<td><%= performance.notes %></td>
|
<td><%= performance.notes %></td>
|
||||||
|
|
||||||
<td>
|
|
||||||
<span><%= link "Show", to: Routes.performance_path(@conn, :show, performance) %></span>
|
|
||||||
<span><%= link "Edit", to: Routes.admin_performance_path(@conn, :edit, performance) %></span>
|
|
||||||
<span><%= link "Delete", to: Routes.admin_performance_path(@conn, :delete, performance), method: :delete, data: [confirm: "Are you sure?"] %></span>
|
|
||||||
</td>
|
|
||||||
</tr>
|
</tr>
|
||||||
<% end %>
|
<% end %>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<span><%= link "New Performance", to: Routes.admin_performance_path(@conn, :new) %></span>
|
<span><%= link "Hallinta", to: Routes.admin_performance_path(@conn, :admin) %></span>
|
||||||
|
|||||||
36
lib/runosaari_web/templates/performer/admin.html.eex
Normal file
36
lib/runosaari_web/templates/performer/admin.html.eex
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
<h1>Esiintyjät - HALLINTA</h1>
|
||||||
|
|
||||||
|
<table>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Fname</th>
|
||||||
|
<th>Lname</th>
|
||||||
|
<th>Email</th>
|
||||||
|
<th>Tel</th>
|
||||||
|
<th>Confirmed</th>
|
||||||
|
<th>Notes</th>
|
||||||
|
|
||||||
|
<th></th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<%= for performer <- @performers do %>
|
||||||
|
<tr>
|
||||||
|
<td><%= performer.fname %></td>
|
||||||
|
<td><%= performer.lname %></td>
|
||||||
|
<td><%= performer.email %></td>
|
||||||
|
<td><%= performer.tel %></td>
|
||||||
|
<td><%= performer.confirmed %></td>
|
||||||
|
<td><%= performer.notes %></td>
|
||||||
|
|
||||||
|
<td>
|
||||||
|
<span><%= link "Show", to: Routes.performer_path(@conn, :show, performer) %></span>
|
||||||
|
<span><%= link "Edit", to: Routes.admin_performer_path(@conn, :edit, performer) %></span>
|
||||||
|
<span><%= link "Delete", to: Routes.admin_performer_path(@conn, :delete, performer), method: :delete, data: [confirm: "Are you sure?"] %></span>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<% end %>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<span><%= link "New Performance", to: Routes.admin_performance_path(@conn, :new) %></span>
|
||||||
@@ -22,15 +22,8 @@
|
|||||||
<td><%= performer.tel %></td>
|
<td><%= performer.tel %></td>
|
||||||
<td><%= performer.confirmed %></td>
|
<td><%= performer.confirmed %></td>
|
||||||
<td><%= performer.notes %></td>
|
<td><%= performer.notes %></td>
|
||||||
|
|
||||||
<td>
|
|
||||||
<span><%= link "Show", to: Routes.performer_path(@conn, :show, performer) %></span>
|
|
||||||
<span><%= link "Edit", to: Routes.admin_performer_path(@conn, :edit, performer) %></span>
|
|
||||||
<span><%= link "Delete", to: Routes.admin_performer_path(@conn, :delete, performer), method: :delete, data: [confirm: "Are you sure?"] %></span>
|
|
||||||
</td>
|
|
||||||
</tr>
|
</tr>
|
||||||
<% end %>
|
<% end %>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
<%= link "Hallinta", to: Routes.admin_performer_path(@conn, :admin) %>
|
||||||
<span><%= link "New Performance", to: Routes.admin_performance_path(@conn, :new) %></span>
|
|
||||||
|
|||||||
Reference in New Issue
Block a user