summaryrefslogtreecommitdiffstats
path: root/views/index.erb
diff options
context:
space:
mode:
authorHarald Eilertsen <haraldei@anduin.net>2015-10-13 18:30:07 +0200
committerHarald Eilertsen <haraldei@anduin.net>2015-10-13 18:30:07 +0200
commit35d3ed2b09b3eff694d285a57d3ff911ef3f0ec2 (patch)
tree4d8001fe55e70a5848520fe07f767639141e01e3 /views/index.erb
parent800f8b9ee333fa703b30e3761124428564456908 (diff)
downloadnorsk-urskog-registrations-35d3ed2b09b3eff694d285a57d3ff911ef3f0ec2.tar.gz
norsk-urskog-registrations-35d3ed2b09b3eff694d285a57d3ff911ef3f0ec2.tar.bz2
norsk-urskog-registrations-35d3ed2b09b3eff694d285a57d3ff911ef3f0ec2.zip
Preserve info when redisplaying form on errors.
Diffstat (limited to 'views/index.erb')
-rw-r--r--views/index.erb21
1 files changed, 12 insertions, 9 deletions
diff --git a/views/index.erb b/views/index.erb
index 1a63651..8565a31 100644
--- a/views/index.erb
+++ b/views/index.erb
@@ -7,27 +7,27 @@
<div class="field text required">
<label for="band_name">Bandnavn:</label>
- <input type="text" id="band_name" name="band[name]">
+ <input type="text" id="band_name" name="band[name]" value="<%= @band.name %>">
</div>
<div class="field text optional">
<label for="band_city">Hjemsted:</label>
- <input type="text" id="band_city" name="band[city]">
+ <input type="text" id="band_city" name="band[city]" value="<%= @band.city %>">
</div>
<div class="field text optional">
<label for="band_website">Webside:</label>
- <input type="text" id="band_website" name="band[website]">
+ <input type="text" id="band_website" name="band[website]" value="<%= @band.website %>">
</div>
<div class="field text optional">
<label for="band_label">Plateselskap:</label>
- <input type="text" id="band_label" name="band[label]">
+ <input type="text" id="band_label" name="band[label]" value="<%= @band.label %>">
</div>
<div class="field text required">
<label for="band_shortbio">Kort bio:</label>
- <textarea cols="40" rows="5" id="band_shortbio" name="band[shortbio]"></textarea>
+ <textarea cols="40" rows="5" id="band_shortbio" name="band[shortbio]"><%= @band.short_bio %></textarea>
</div>
</div>
@@ -35,22 +35,22 @@
<h3>Kontaktperson</h3>
<div class="field text required">
<label for="band-contact-name">Navn:</label>
- <input type="text" id="band-contact-name" name="band[contact][name]">
+ <input type="text" id="band-contact-name" name="band[contact][name]" value="<%= @band.contact.name %>">
</div>
<div class="field textarea required">
<label for="band-contact-addr">Postadresse:</label>
- <textarea cols="40" rows="4" id="band-contact-addr" name="band[contact][addr]"></textarea>
+ <textarea cols="40" rows="4" id="band-contact-addr" name="band[contact][addr]"><%= @band.contact.addr %></textarea>
</div>
<div class="field text required">
<label for="band-contact-phone">Tlf:</label>
- <input type="text" id="band-contact-phone" name="band[contact][phone]">
+ <input type="text" id="band-contact-phone" name="band[contact][phone]" value="<%= @band.contact.phone %>">
</div>
<div class="field text required">
<label for="band-contact-email">E-post:</label>
- <input type="text" id="band-contact-email" name="band[contact][email]">
+ <input type="text" id="band-contact-email" name="band[contact][email]" value="<%= @band.contact.email %>">
</div>
</div>
@@ -59,6 +59,9 @@
<p>Klikk på knappen under for å legge til medlemmene som er med i bandet. Dette er kun til
informasjon for websider, promomateriale og lignende. Har bandmedlemene pseudonymer de
foretrekker å bruke, så kan du bruke dem her.</p>
+ <% @band.members.each do |member| %>
+ <%= erb :member, layout: false, locals: { member_number: 1 } %>
+ <% end %>
</div>
<input type="button" name="add_member" value="Legg til medlem" id="add-member-button">