Editable workshops.
This commit is contained in:
@@ -32,10 +32,10 @@
|
||||
<% end %>
|
||||
<% end %>
|
||||
<h2>Työpajat</h2>
|
||||
<p id="workshops">
|
||||
<b>Jaana Kouri:</b> Shamanistinen kirjoitustyöpaja <br class="workshops-br">
|
||||
<b>Hanna Toivonen:</b> Sarjakuvatyöpaja <br class="workshops-br">
|
||||
<br />
|
||||
<i>Näihin avataan ennakkoilmoittautuminen hyvissä ajoin.</i>
|
||||
</p>
|
||||
<%= for workshop <- @workshops do %>
|
||||
<p class="workshop-paragraph">
|
||||
<b><%= workshop.name %></b><%= workshop.text %>
|
||||
</p>
|
||||
<% end %>
|
||||
<i class="foot-note">Näihin avataan ennakkoilmoittautuminen hyvissä ajoin.</i>
|
||||
</section>
|
||||
|
||||
32
lib/runosaari_web/templates/workshop/admin.html.eex
Normal file
32
lib/runosaari_web/templates/workshop/admin.html.eex
Normal file
@@ -0,0 +1,32 @@
|
||||
<section class="main">
|
||||
<h1>HALLINTA - Työpajat</h1>
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Nimi</th>
|
||||
<th>Teksti</th>
|
||||
<th>Prioriteetti</th>
|
||||
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<%= for workshop <- @workshops do %>
|
||||
<tr>
|
||||
<td><%= workshop.name %></td>
|
||||
<td><%= workshop.text %></td>
|
||||
<td><%= workshop.seqnum %></td>
|
||||
|
||||
<td class="actions">
|
||||
<span><%= link "Lisätietoja", to: Routes.admin_workshop_path(@conn, :show, workshop) %></span>
|
||||
<span><%= link "Muokkaa", to: Routes.admin_workshop_path(@conn, :edit, workshop) %></span>
|
||||
<span><%= link "Poista", to: Routes.admin_workshop_path(@conn, :delete, workshop), method: :delete, data: [confirm: "Oletko varma?"] %></span>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<span><%= link "Luo uusi työpaja", to: Routes.admin_workshop_path(@conn, :new) %></span>
|
||||
</section>
|
||||
5
lib/runosaari_web/templates/workshop/edit.html.eex
Normal file
5
lib/runosaari_web/templates/workshop/edit.html.eex
Normal file
@@ -0,0 +1,5 @@
|
||||
<h1>Muokkaa työpajan tietoja</h1>
|
||||
|
||||
<%= render "form.html", Map.put(assigns, :action, Routes.admin_workshop_path(@conn, :update, @workshop)) %>
|
||||
|
||||
<span><%= link "Takaisin", to: Routes.admin_workshop_path(@conn, :admin) %></span>
|
||||
23
lib/runosaari_web/templates/workshop/form.html.eex
Normal file
23
lib/runosaari_web/templates/workshop/form.html.eex
Normal file
@@ -0,0 +1,23 @@
|
||||
<%= form_for @changeset, @action, fn f -> %>
|
||||
<%= if @changeset.action do %>
|
||||
<div class="alert alert-danger">
|
||||
<p>Joku kentistä on tyhjä.</p>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<%= label f, :name, "Nimi" %>
|
||||
<%= text_input f, :name %>
|
||||
<%= error_tag f, :name %>
|
||||
|
||||
<%= label f, :text, "Teksti" %>
|
||||
<%= textarea f, :text %>
|
||||
<%= error_tag f, :text %>
|
||||
|
||||
<%= label f, :seqnum, "Prioriteetti (1 on korkein)" %>
|
||||
<%= number_input f, :seqnum %>
|
||||
<%= error_tag f, :seqnum %>
|
||||
|
||||
<div>
|
||||
<%= submit "Tallenna" %>
|
||||
</div>
|
||||
<% end %>
|
||||
5
lib/runosaari_web/templates/workshop/new.html.eex
Normal file
5
lib/runosaari_web/templates/workshop/new.html.eex
Normal file
@@ -0,0 +1,5 @@
|
||||
<h1>Luo uusi työpaja</h1>
|
||||
|
||||
<%= render "form.html", Map.put(assigns, :action, Routes.admin_workshop_path(@conn, :create)) %>
|
||||
|
||||
<span><%= link "Takaisin", to: Routes.admin_workshop_path(@conn, :admin) %></span>
|
||||
23
lib/runosaari_web/templates/workshop/show.html.eex
Normal file
23
lib/runosaari_web/templates/workshop/show.html.eex
Normal file
@@ -0,0 +1,23 @@
|
||||
<h1>Työpajan tiedot</h1>
|
||||
|
||||
<ul>
|
||||
|
||||
<li>
|
||||
<strong>Nimi:</strong>
|
||||
<%= @workshop.name %>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<strong>Teksti:</strong>
|
||||
<%= @workshop.text %>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<strong>Prioriteetti:</strong>
|
||||
<%= @workshop.seqnum %>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
<span><%= link "Muokkaa", to: Routes.admin_workshop_path(@conn, :edit, @workshop) %></span>
|
||||
<span><%= link "Takaisin", to: Routes.admin_workshop_path(@conn, :admin) %></span>
|
||||
Reference in New Issue
Block a user