diff --git a/lib/runosaari_web/controllers/location_controller.ex b/lib/runosaari_web/controllers/location_controller.ex
index bbdcba9..21e95c7 100644
--- a/lib/runosaari_web/controllers/location_controller.ex
+++ b/lib/runosaari_web/controllers/location_controller.ex
@@ -9,6 +9,11 @@ defmodule RunosaariWeb.LocationController do
render(conn, "index.html", locations: locations)
end
+ def admin(conn, _params) do
+ locations = Area.list_locations()
+ render(conn, "admin.html", locations: locations)
+ end
+
def new(conn, _params) do
changeset = Area.change_location(%Location{})
render(conn, "new.html", changeset: changeset)
diff --git a/lib/runosaari_web/controllers/performance_controller.ex b/lib/runosaari_web/controllers/performance_controller.ex
index e4bc80d..bed2d6b 100644
--- a/lib/runosaari_web/controllers/performance_controller.ex
+++ b/lib/runosaari_web/controllers/performance_controller.ex
@@ -9,6 +9,11 @@ defmodule RunosaariWeb.PerformanceController do
render(conn, "index.html", performances: performances)
end
+ def admin(conn, _params) do
+ performances = Schedule.list_performances()
+ render(conn, "admin.html", performances: performances)
+ end
+
def new(conn, _params) do
changeset = Schedule.change_performance(%Performance{})
render(conn, "new.html", changeset: changeset)
diff --git a/lib/runosaari_web/controllers/performer_controller.ex b/lib/runosaari_web/controllers/performer_controller.ex
index e314185..5671398 100644
--- a/lib/runosaari_web/controllers/performer_controller.ex
+++ b/lib/runosaari_web/controllers/performer_controller.ex
@@ -9,6 +9,11 @@ defmodule RunosaariWeb.PerformerController do
render(conn, "index.html", performers: performers)
end
+ def admin(conn, _params) do
+ performers = Registration.list_performers()
+ render(conn, "admin.html", performers: performers)
+ end
+
def new(conn, _params) do
changeset = Registration.change_performer(%Performer{})
render(conn, "new.html", changeset: changeset)
diff --git a/lib/runosaari_web/router.ex b/lib/runosaari_web/router.ex
index 6e586d2..c0b6637 100644
--- a/lib/runosaari_web/router.ex
+++ b/lib/runosaari_web/router.ex
@@ -25,6 +25,9 @@ defmodule RunosaariWeb.Router do
scope "/admin", RunosaariWeb, as: :admin do
pipe_through :browser
+ get "/performers", PerformerController, :admin
+ get "/performers", PerformanceController, :admin
+ get "/performers", LocationController, :admin
resources "/performers", PerformerController, except: [:index, :show]
resources "/performances", PerformanceController, except: [:index, :show]
resources "/locations", LocationController, except: [:index, :show]
diff --git a/lib/runosaari_web/templates/location/admin.html.eex b/lib/runosaari_web/templates/location/admin.html.eex
new file mode 100644
index 0000000..fc4e5d2
--- /dev/null
+++ b/lib/runosaari_web/templates/location/admin.html.eex
@@ -0,0 +1,34 @@
+
Tapahtumapaikat - HALLINTA
+
+
+
+
+ | Name |
+ Address |
+ Reserved seats |
+ Max seats |
+ Description |
+
+ |
+
+
+
+<%= for location <- @locations do %>
+
+ | <%= location.name %> |
+ <%= location.address %> |
+ <%= location.reserved_seats %> |
+ <%= location.max_seats %> |
+ <%= location.description %> |
+
+
+ <%= link "Show", to: Routes.location_path(@conn, :show, location) %>
+ <%= link "Edit", to: Routes.admin_location_path(@conn, :edit, location) %>
+ <%= link "Delete", to: Routes.admin_location_path(@conn, :delete, location), method: :delete, data: [confirm: "Are you sure?"] %>
+ |
+
+<% end %>
+
+
+
+<%= link "New Location", to: Routes.admin_location_path(@conn, :new) %>
diff --git a/lib/runosaari_web/templates/location/index.html.eex b/lib/runosaari_web/templates/location/index.html.eex
index eb35e96..1d7d363 100644
--- a/lib/runosaari_web/templates/location/index.html.eex
+++ b/lib/runosaari_web/templates/location/index.html.eex
@@ -20,15 +20,9 @@
<%= location.reserved_seats %> |
<%= location.max_seats %> |
<%= location.description %> |
-
-
- <%= link "Show", to: Routes.location_path(@conn, :show, location) %>
- <%= link "Edit", to: Routes.admin_location_path(@conn, :edit, location) %>
- <%= link "Delete", to: Routes.admin_location_path(@conn, :delete, location), method: :delete, data: [confirm: "Are you sure?"] %>
- |
<% end %>
-<%= link "New Location", to: Routes.admin_location_path(@conn, :new) %>
+<%= link "Hallinta", to: Routes.admin_location_path(@conn, :admin) %>
diff --git a/lib/runosaari_web/templates/performance/admin.html.eex b/lib/runosaari_web/templates/performance/admin.html.eex
new file mode 100644
index 0000000..eabc5d4
--- /dev/null
+++ b/lib/runosaari_web/templates/performance/admin.html.eex
@@ -0,0 +1,30 @@
+Ohjelma - HALLINTA
+
+
+
+
+ | Time |
+ Description |
+ Notes |
+
+ |
+
+
+
+<%= for performance <- @performances do %>
+
+ | <%= performance.time %> |
+ <%= performance.description %> |
+ <%= performance.notes %> |
+
+
+ <%= link "Show", to: Routes.performance_path(@conn, :show, performance) %>
+ <%= link "Edit", to: Routes.admin_performance_path(@conn, :edit, performance) %>
+ <%= link "Delete", to: Routes.admin_performance_path(@conn, :delete, performance), method: :delete, data: [confirm: "Are you sure?"] %>
+ |
+
+<% end %>
+
+
+
+<%= link "New Performance", to: Routes.admin_performance_path(@conn, :new) %>
diff --git a/lib/runosaari_web/templates/performance/index.html.eex b/lib/runosaari_web/templates/performance/index.html.eex
index 026af55..bcf6ef8 100644
--- a/lib/runosaari_web/templates/performance/index.html.eex
+++ b/lib/runosaari_web/templates/performance/index.html.eex
@@ -16,15 +16,9 @@
<%= performance.time %> |
<%= performance.description %> |
<%= performance.notes %> |
-
-
- <%= link "Show", to: Routes.performance_path(@conn, :show, performance) %>
- <%= link "Edit", to: Routes.admin_performance_path(@conn, :edit, performance) %>
- <%= link "Delete", to: Routes.admin_performance_path(@conn, :delete, performance), method: :delete, data: [confirm: "Are you sure?"] %>
- |
<% end %>
-<%= link "New Performance", to: Routes.admin_performance_path(@conn, :new) %>
+<%= link "Hallinta", to: Routes.admin_performance_path(@conn, :admin) %>
diff --git a/lib/runosaari_web/templates/performer/admin.html.eex b/lib/runosaari_web/templates/performer/admin.html.eex
new file mode 100644
index 0000000..061a942
--- /dev/null
+++ b/lib/runosaari_web/templates/performer/admin.html.eex
@@ -0,0 +1,36 @@
+Esiintyjät - HALLINTA
+
+
+
+
+ | Fname |
+ Lname |
+ Email |
+ Tel |
+ Confirmed |
+ Notes |
+
+ |
+
+
+
+<%= for performer <- @performers do %>
+
+ | <%= performer.fname %> |
+ <%= performer.lname %> |
+ <%= performer.email %> |
+ <%= performer.tel %> |
+ <%= performer.confirmed %> |
+ <%= performer.notes %> |
+
+
+ <%= link "Show", to: Routes.performer_path(@conn, :show, performer) %>
+ <%= link "Edit", to: Routes.admin_performer_path(@conn, :edit, performer) %>
+ <%= link "Delete", to: Routes.admin_performer_path(@conn, :delete, performer), method: :delete, data: [confirm: "Are you sure?"] %>
+ |
+
+<% end %>
+
+
+
+<%= link "New Performance", to: Routes.admin_performance_path(@conn, :new) %>
diff --git a/lib/runosaari_web/templates/performer/index.html.eex b/lib/runosaari_web/templates/performer/index.html.eex
index 39f6da1..9c0876e 100644
--- a/lib/runosaari_web/templates/performer/index.html.eex
+++ b/lib/runosaari_web/templates/performer/index.html.eex
@@ -22,15 +22,8 @@
<%= performer.tel %> |
<%= performer.confirmed %> |
<%= performer.notes %> |
-
-
- <%= link "Show", to: Routes.performer_path(@conn, :show, performer) %>
- <%= link "Edit", to: Routes.admin_performer_path(@conn, :edit, performer) %>
- <%= link "Delete", to: Routes.admin_performer_path(@conn, :delete, performer), method: :delete, data: [confirm: "Are you sure?"] %>
- |
<% end %>
-
-<%= link "New Performance", to: Routes.admin_performance_path(@conn, :new) %>
+<%= link "Hallinta", to: Routes.admin_performer_path(@conn, :admin) %>