Admin actions behind admin path.
This commit is contained in:
@@ -17,9 +17,17 @@ defmodule RunosaariWeb.Router do
|
|||||||
pipe_through :browser
|
pipe_through :browser
|
||||||
|
|
||||||
get "/", PageController, :index
|
get "/", PageController, :index
|
||||||
resources "/performers", PerformerController
|
resources "/performers", PerformerController, only: [:index, :show]
|
||||||
resources "/performances", PerformanceController
|
resources "/performances", PerformanceController, only: [:index, :show]
|
||||||
resources "/locations", LocationController
|
resources "/locations", LocationController, only: [:index, :show]
|
||||||
|
end
|
||||||
|
|
||||||
|
scope "/admin", RunosaariWeb, as: :admin do
|
||||||
|
pipe_through :browser
|
||||||
|
|
||||||
|
resources "/performers", PerformerController, except: [:index, :show]
|
||||||
|
resources "/performances", PerformanceController, except: [:index, :show]
|
||||||
|
resources "/locations", LocationController, except: [:index, :show]
|
||||||
end
|
end
|
||||||
|
|
||||||
# Other scopes may use custom stacks.
|
# Other scopes may use custom stacks.
|
||||||
|
|||||||
@@ -18,7 +18,8 @@
|
|||||||
<%= link "Etusivu", to: Routes.page_path(@conn, :index) %>
|
<%= link "Etusivu", to: Routes.page_path(@conn, :index) %>
|
||||||
<%= link "Esiintyjät", to: Routes.performer_path(@conn, :index) %>
|
<%= link "Esiintyjät", to: Routes.performer_path(@conn, :index) %>
|
||||||
<%= link "Ohjelma", to: Routes.performance_path(@conn, :index) %>
|
<%= link "Ohjelma", to: Routes.performance_path(@conn, :index) %>
|
||||||
<%= link "Ilmoittautuminen", to: Routes.performer_path(@conn, :new) %>
|
<%= link "Ilmoittautuminen", to: Routes.admin_performer_path(@conn, :new) %>
|
||||||
|
<%= link "DEBUG Uusi näytös", to: Routes.admin_performance_path(@conn, :new) %>
|
||||||
</nav>
|
</nav>
|
||||||
</header>
|
</header>
|
||||||
<main role="main">
|
<main role="main">
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<h1>Edit Location</h1>
|
<h1>Edit Location</h1>
|
||||||
|
|
||||||
<%= render "form.html", Map.put(assigns, :action, Routes.location_path(@conn, :update, @location)) %>
|
<%= render "form.html", Map.put(assigns, :action, Routes.admin_location_path(@conn, :update, @location)) %>
|
||||||
|
|
||||||
<span><%= link "Back", to: Routes.location_path(@conn, :index) %></span>
|
<span><%= link "Back", to: Routes.location_path(@conn, :index) %></span>
|
||||||
|
|||||||
@@ -23,12 +23,12 @@
|
|||||||
|
|
||||||
<td>
|
<td>
|
||||||
<span><%= link "Show", to: Routes.location_path(@conn, :show, location) %></span>
|
<span><%= link "Show", to: Routes.location_path(@conn, :show, location) %></span>
|
||||||
<span><%= link "Edit", to: Routes.location_path(@conn, :edit, location) %></span>
|
<span><%= link "Edit", to: Routes.admin_location_path(@conn, :edit, location) %></span>
|
||||||
<span><%= link "Delete", to: Routes.location_path(@conn, :delete, location), method: :delete, data: [confirm: "Are you sure?"] %></span>
|
<span><%= link "Delete", to: Routes.admin_location_path(@conn, :delete, location), method: :delete, data: [confirm: "Are you sure?"] %></span>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<% end %>
|
<% end %>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<span><%= link "New Location", to: Routes.location_path(@conn, :new) %></span>
|
<span><%= link "New Location", to: Routes.admin_location_path(@conn, :new) %></span>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<h1>New Location</h1>
|
<h1>New Location</h1>
|
||||||
|
|
||||||
<%= render "form.html", Map.put(assigns, :action, Routes.location_path(@conn, :create)) %>
|
<%= render "form.html", Map.put(assigns, :action, Routes.admin_location_path(@conn, :create)) %>
|
||||||
|
|
||||||
<span><%= link "Back", to: Routes.location_path(@conn, :index) %></span>
|
<span><%= link "Back", to: Routes.location_path(@conn, :index) %></span>
|
||||||
|
|||||||
@@ -29,5 +29,5 @@
|
|||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<span><%= link "Edit", to: Routes.location_path(@conn, :edit, @location) %></span>
|
<span><%= link "Edit", to: Routes.admin_location_path(@conn, :edit, @location) %></span>
|
||||||
<span><%= link "Back", to: Routes.location_path(@conn, :index) %></span>
|
<span><%= link "Back", to: Routes.location_path(@conn, :index) %></span>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<h1>Edit Performance</h1>
|
<h1>Edit Performance</h1>
|
||||||
|
|
||||||
<%= render "form.html", Map.put(assigns, :action, Routes.performance_path(@conn, :update, @performance)) %>
|
<%= render "form.html", Map.put(assigns, :action, Routes.admin_performance_path(@conn, :update, @performance)) %>
|
||||||
|
|
||||||
<span><%= link "Back", to: Routes.performance_path(@conn, :index) %></span>
|
<span><%= link "Back", to: Routes.performance_path(@conn, :index) %></span>
|
||||||
|
|||||||
@@ -19,12 +19,12 @@
|
|||||||
|
|
||||||
<td>
|
<td>
|
||||||
<span><%= link "Show", to: Routes.performance_path(@conn, :show, performance) %></span>
|
<span><%= link "Show", to: Routes.performance_path(@conn, :show, performance) %></span>
|
||||||
<span><%= link "Edit", to: Routes.performance_path(@conn, :edit, performance) %></span>
|
<span><%= link "Edit", to: Routes.admin_performance_path(@conn, :edit, performance) %></span>
|
||||||
<span><%= link "Delete", to: Routes.performance_path(@conn, :delete, performance), method: :delete, data: [confirm: "Are you sure?"] %></span>
|
<span><%= link "Delete", to: Routes.admin_performance_path(@conn, :delete, performance), method: :delete, data: [confirm: "Are you sure?"] %></span>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<% end %>
|
<% end %>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<span><%= link "New Performance", to: Routes.performance_path(@conn, :new) %></span>
|
<span><%= link "New Performance", to: Routes.admin_performance_path(@conn, :new) %></span>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<h1>New Performance</h1>
|
<h1>New Performance</h1>
|
||||||
|
|
||||||
<%= render "form.html", Map.put(assigns, :action, Routes.performance_path(@conn, :create)) %>
|
<%= render "form.html", Map.put(assigns, :action, Routes.admin_performance_path(@conn, :create)) %>
|
||||||
|
|
||||||
<span><%= link "Back", to: Routes.performance_path(@conn, :index) %></span>
|
<span><%= link "Back", to: Routes.performance_path(@conn, :index) %></span>
|
||||||
|
|||||||
@@ -19,5 +19,5 @@
|
|||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<span><%= link "Edit", to: Routes.performance_path(@conn, :edit, @performance) %></span>
|
<span><%= link "Edit", to: Routes.admin_performance_path(@conn, :edit, @performance) %></span>
|
||||||
<span><%= link "Back", to: Routes.performance_path(@conn, :index) %></span>
|
<span><%= link "Back", to: Routes.performance_path(@conn, :index) %></span>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<h1>Edit Performer</h1>
|
<h1>Edit Performer</h1>
|
||||||
|
|
||||||
<%= render "form.html", Map.put(assigns, :action, Routes.performer_path(@conn, :update, @performer)) %>
|
<%= render "form.html", Map.put(assigns, :action, Routes.admin_performer_path(@conn, :update, @performer)) %>
|
||||||
|
|
||||||
<span><%= link "Back", to: Routes.performer_path(@conn, :index) %></span>
|
<span><%= link "Back", to: Routes.performer_path(@conn, :index) %></span>
|
||||||
|
|||||||
@@ -25,10 +25,12 @@
|
|||||||
|
|
||||||
<td>
|
<td>
|
||||||
<span><%= link "Show", to: Routes.performer_path(@conn, :show, performer) %></span>
|
<span><%= link "Show", to: Routes.performer_path(@conn, :show, performer) %></span>
|
||||||
<span><%= link "Edit", to: Routes.performer_path(@conn, :edit, performer) %></span>
|
<span><%= link "Edit", to: Routes.admin_performer_path(@conn, :edit, performer) %></span>
|
||||||
<span><%= link "Delete", to: Routes.performer_path(@conn, :delete, performer), method: :delete, data: [confirm: "Are you sure?"] %></span>
|
<span><%= link "Delete", to: Routes.admin_performer_path(@conn, :delete, performer), method: :delete, data: [confirm: "Are you sure?"] %></span>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<% end %>
|
<% end %>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
|
<span><%= link "New Performance", to: Routes.admin_performance_path(@conn, :new) %></span>
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
<h1>Ilmoittaudu</h1>
|
<h1>Ilmoittaudu</h1>
|
||||||
|
|
||||||
<%= render "form.html", Map.put(assigns, :action, Routes.performer_path(@conn, :create)) %>
|
<%= render "form.html", Map.put(assigns, :action, Routes.admin_performer_path(@conn, :create)) %>
|
||||||
|
|||||||
@@ -34,5 +34,5 @@
|
|||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<span><%= link "Edit", to: Routes.performer_path(@conn, :edit, @performer) %></span>
|
<span><%= link "Edit", to: Routes.admin_performer_path(@conn, :edit, @performer) %></span>
|
||||||
<span><%= link "Back", to: Routes.performer_path(@conn, :index) %></span>
|
<span><%= link "Back", to: Routes.performer_path(@conn, :index) %></span>
|
||||||
|
|||||||
Reference in New Issue
Block a user