diff --git a/lib/runosaari/schedule/performance.ex b/lib/runosaari/schedule/performance.ex
index 94bc690..67b307a 100644
--- a/lib/runosaari/schedule/performance.ex
+++ b/lib/runosaari/schedule/performance.ex
@@ -5,7 +5,7 @@ defmodule Runosaari.Schedule.Performance do
schema "performances" do
field :name, :string
field :desc, :string
- field :seqnum, :integer
+ field :seqnum, :integer, default: 999
timestamps()
end
diff --git a/lib/runosaari_web/templates/performance/admin.html.eex b/lib/runosaari_web/templates/performance/admin.html.eex
index f9cd88e..a649bbc 100644
--- a/lib/runosaari_web/templates/performance/admin.html.eex
+++ b/lib/runosaari_web/templates/performance/admin.html.eex
@@ -6,6 +6,7 @@
| Nimi |
Seloste |
+ Prioriteetti |
|
@@ -15,6 +16,7 @@
| <%= performance.name %> |
<%= performance.desc %> |
+ <%= performance.seqnum %> |
<%= link "Lisätietoja", to: Routes.admin_performance_path(@conn, :show, performance) %>
diff --git a/lib/runosaari_web/templates/performance/form.html.eex b/lib/runosaari_web/templates/performance/form.html.eex
index 22eccec..61469ba 100644
--- a/lib/runosaari_web/templates/performance/form.html.eex
+++ b/lib/runosaari_web/templates/performance/form.html.eex
@@ -1,17 +1,21 @@
-<%= form_for @changeset, @action, fn f -> %>
+<%= form_for @changeset, @action, fn form -> %>
<%= if @changeset.action do %>
<% end %>
- <%= label f, :name, "Nimi" %>
- <%= text_input f, :name %>
- <%= error_tag f, :name %>
+ <%= label form, :name, "Nimi" %>
+ <%= text_input form, :name %>
+ <%= error_tag form, :name %>
- <%= label f, :desc, "Seloste" %>
- <%= textarea f, :desc %>
- <%= error_tag f, :desc %>
+ <%= label form, :desc, "Seloste" %>
+ <%= textarea form, :desc %>
+ <%= error_tag form, :desc %>
+
+ <%= label form, :seqnum, "Prioriteetti (1 on korkein)" %>
+ <%= textarea form, :seqnum %>
+ <%= error_tag form, :seqnum %>
<%= submit "Tallenna" %>
|