saucy/app/views/members/edit.html.erb

68 lines
2.1 KiB
Plaintext
Raw Normal View History

2022-06-25 12:48:46 +00:00
<h1><%= t('members.edit.title') %></h1>
<%= form_with(model: @member) do |form| %>
<% if @member.errors.any? %>
<div style="color: red">
<h2><%= pluralize(@member.errors.count, "error") %> prohibited this member from being saved:</h2>
<ul>
<% @member.errors.each do |error| %>
<li><%= error.full_message %></li>
<% end %>
</ul>
</div>
<% end %>
<table>
<tr>
<td><label><%= t('members.attributes.display_name') %></label></td>
<td><%= form.text_field :display_name, required: true %></label></td>
</tr>
<tr>
<td><label><%= t('members.attributes.email') %></label></td>
<td><%= form.email_field :email, required: true %></label></td>
</tr>
<tr>
<td><label><%= t('members.attributes.category') %></label></td>
<td><%= form.select :category, %w{student retired unemployed employed} %></label></td>
</tr>
<tr>
<td><label><%= t('members.attributes.identification_number') %></label></td>
<td><%= form.text_field :identification_number %></label></td>
</tr>
<tr>
<td><label><%= t('members.attributes.address') %></label></td>
<td><%= form.text_area :address %></label></td>
</tr>
2022-06-26 09:44:30 +00:00
<tr>
<td><label><%= t('members.attributes.wants_mailing_list') %></label></td>
<td><%= form.check_box :wants_mailing_list %></label></td>
</tr>
<tr>
<td><label><%= t('members.attributes.prefers_postal') %></label></td>
<td><%= form.check_box :prefers_postal %></label></td>
</tr>
2022-06-25 12:48:46 +00:00
<tr>
<td colspan="2"><%= t('members.edit.edit_dates_warning') %></td>
</tr>
<tr>
<td><label for="member_joined_on"><%= t('members.attributes.joined_on') %></label></td>
<td><%= form.date_field :joined_on %></td>
</tr>
<tr>
<td><label for="member_expires_on"><%= t('members.attributes.expires_on') %></label></td>
<td><%= form.date_field :expires_on %></td>
</tr>
</table>
<div>
<%= form.submit %>
</div>
<% end %>
<br>
<div>
<%= link_to t('members.edit.actions.back_to_show'), @member %>
</div>