Sequence number to performance list and creation form.
This commit is contained in:
@@ -5,7 +5,7 @@ defmodule Runosaari.Schedule.Performance do
|
|||||||
schema "performances" do
|
schema "performances" do
|
||||||
field :name, :string
|
field :name, :string
|
||||||
field :desc, :string
|
field :desc, :string
|
||||||
field :seqnum, :integer
|
field :seqnum, :integer, default: 999
|
||||||
|
|
||||||
timestamps()
|
timestamps()
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<th>Nimi</th>
|
<th>Nimi</th>
|
||||||
<th>Seloste</th>
|
<th>Seloste</th>
|
||||||
|
<th>Prioriteetti</th>
|
||||||
|
|
||||||
<th></th>
|
<th></th>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -15,6 +16,7 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td><%= performance.name %></td>
|
<td><%= performance.name %></td>
|
||||||
<td><%= performance.desc %></td>
|
<td><%= performance.desc %></td>
|
||||||
|
<td><%= performance.seqnum %></td>
|
||||||
|
|
||||||
<td class="actions">
|
<td class="actions">
|
||||||
<span><%= link "Lisätietoja", to: Routes.admin_performance_path(@conn, :show, performance) %></span>
|
<span><%= link "Lisätietoja", to: Routes.admin_performance_path(@conn, :show, performance) %></span>
|
||||||
|
|||||||
@@ -1,17 +1,21 @@
|
|||||||
<%= form_for @changeset, @action, fn f -> %>
|
<%= form_for @changeset, @action, fn form -> %>
|
||||||
<%= if @changeset.action do %>
|
<%= if @changeset.action do %>
|
||||||
<div class="alert alert-danger">
|
<div class="alert alert-danger">
|
||||||
<p>Jokin kentistä on tyhjä.</p>
|
<p>Jokin kentistä on tyhjä.</p>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<%= label f, :name, "Nimi" %>
|
<%= label form, :name, "Nimi" %>
|
||||||
<%= text_input f, :name %>
|
<%= text_input form, :name %>
|
||||||
<%= error_tag f, :name %>
|
<%= error_tag form, :name %>
|
||||||
|
|
||||||
<%= label f, :desc, "Seloste" %>
|
<%= label form, :desc, "Seloste" %>
|
||||||
<%= textarea f, :desc %>
|
<%= textarea form, :desc %>
|
||||||
<%= error_tag f, :desc %>
|
<%= error_tag form, :desc %>
|
||||||
|
|
||||||
|
<%= label form, :seqnum, "Prioriteetti (1 on korkein)" %>
|
||||||
|
<%= textarea form, :seqnum %>
|
||||||
|
<%= error_tag form, :seqnum %>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<%= submit "Tallenna" %>
|
<%= submit "Tallenna" %>
|
||||||
|
|||||||
Reference in New Issue
Block a user