AUTOGEN: Locations.
This commit is contained in:
5
lib/runosaari_web/templates/location/edit.html.eex
Normal file
5
lib/runosaari_web/templates/location/edit.html.eex
Normal file
@@ -0,0 +1,5 @@
|
||||
<h1>Edit Location</h1>
|
||||
|
||||
<%= render "form.html", Map.put(assigns, :action, Routes.location_path(@conn, :update, @location)) %>
|
||||
|
||||
<span><%= link "Back", to: Routes.location_path(@conn, :index) %></span>
|
||||
31
lib/runosaari_web/templates/location/form.html.eex
Normal file
31
lib/runosaari_web/templates/location/form.html.eex
Normal file
@@ -0,0 +1,31 @@
|
||||
<%= form_for @changeset, @action, fn f -> %>
|
||||
<%= if @changeset.action do %>
|
||||
<div class="alert alert-danger">
|
||||
<p>Oops, something went wrong! Please check the errors below.</p>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<%= label f, :name %>
|
||||
<%= text_input f, :name %>
|
||||
<%= error_tag f, :name %>
|
||||
|
||||
<%= label f, :address %>
|
||||
<%= text_input f, :address %>
|
||||
<%= error_tag f, :address %>
|
||||
|
||||
<%= label f, :reserved_seats %>
|
||||
<%= number_input f, :reserved_seats %>
|
||||
<%= error_tag f, :reserved_seats %>
|
||||
|
||||
<%= label f, :max_seats %>
|
||||
<%= number_input f, :max_seats %>
|
||||
<%= error_tag f, :max_seats %>
|
||||
|
||||
<%= label f, :description %>
|
||||
<%= text_input f, :description %>
|
||||
<%= error_tag f, :description %>
|
||||
|
||||
<div>
|
||||
<%= submit "Save" %>
|
||||
</div>
|
||||
<% end %>
|
||||
34
lib/runosaari_web/templates/location/index.html.eex
Normal file
34
lib/runosaari_web/templates/location/index.html.eex
Normal file
@@ -0,0 +1,34 @@
|
||||
<h1>Listing Locations</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.location_path(@conn, :edit, location) %></span>
|
||||
<span><%= link "Delete", to: Routes.location_path(@conn, :delete, location), method: :delete, data: [confirm: "Are you sure?"] %></span>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<span><%= link "New Location", to: Routes.location_path(@conn, :new) %></span>
|
||||
5
lib/runosaari_web/templates/location/new.html.eex
Normal file
5
lib/runosaari_web/templates/location/new.html.eex
Normal file
@@ -0,0 +1,5 @@
|
||||
<h1>New Location</h1>
|
||||
|
||||
<%= render "form.html", Map.put(assigns, :action, Routes.location_path(@conn, :create)) %>
|
||||
|
||||
<span><%= link "Back", to: Routes.location_path(@conn, :index) %></span>
|
||||
33
lib/runosaari_web/templates/location/show.html.eex
Normal file
33
lib/runosaari_web/templates/location/show.html.eex
Normal file
@@ -0,0 +1,33 @@
|
||||
<h1>Show Location</h1>
|
||||
|
||||
<ul>
|
||||
|
||||
<li>
|
||||
<strong>Name:</strong>
|
||||
<%= @location.name %>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<strong>Address:</strong>
|
||||
<%= @location.address %>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<strong>Reserved seats:</strong>
|
||||
<%= @location.reserved_seats %>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<strong>Max seats:</strong>
|
||||
<%= @location.max_seats %>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<strong>Description:</strong>
|
||||
<%= @location.description %>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
<span><%= link "Edit", to: Routes.location_path(@conn, :edit, @location) %></span>
|
||||
<span><%= link "Back", to: Routes.location_path(@conn, :index) %></span>
|
||||
Reference in New Issue
Block a user