Sequence number to performance list and creation form.

This commit is contained in:
codevictory
2021-05-22 11:34:33 +03:00
parent d82746f074
commit fcfee8ce18
3 changed files with 14 additions and 8 deletions

View File

@@ -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

View File

@@ -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>

View File

@@ -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" %>