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

85 lines
3.7 KiB
Plaintext

<p style="color: green"><%= notice %></p>
<h1><%= t('members.show.title') %></h1>
<table class='lined'>
<tr><td><%= t('members.attributes.display_name') %></td><td><%= @member.number %>. <%= @member.display_name %></td></tr>
<tr><td><%= t('members.attributes.email') %></td><td><%= @member.email %></td></tr>
<tr><td><%= t('members.attributes.category') %></td><td><%= @member.category %></td></tr>
<tr><td><%= t('members.attributes.identification_number') %></td><td><%= @member.identification_number %></td></tr>
<tr><td><%= t('members.attributes.address') %></td><td><%= simple_format @member.address %></td></tr>
<tr><td><%= t('members.attributes.wants_mailing_list') %></td><td><%= bool_option @member.wants_mailing_list %></td></tr>
<tr><td><%= t('members.attributes.prefers_postal') %></td><td><%= bool_option @member.prefers_postal %></td></tr>
<tr><td><%= t('members.attributes.joined_on') %></td><td><%= @member.joined_on %></td></tr>
<tr><td><%= t('members.attributes.expires_on') %></td><td><%= @member.expires_on %></td></tr>
<tr><td><%= t('members.attributes.status') %></td><td><%= @member.status %></td></tr>
<tr><td><%= t('members.attributes.regular_ifthenpay_link') %></td><td><% if @member.regular_ifthenpay_link %><%= link_to @member.regular_ifthenpay_link, @member.regular_ifthenpay_link %><% end %></td></tr>
<tr><td><%= t('members.attributes.reduced_ifthenpay_link') %></td><td><% if @member.reduced_ifthenpay_link %><%= link_to @member.reduced_ifthenpay_link, @member.reduced_ifthenpay_link %><% end %></td></tr>
</table>
<div>
<%= link_to t('members.show.actions.edit'), edit_member_path(@member) %>
</div>
<div>
<%= link_to t('members.show.actions.delete'), delete_member_path(@member) %>
</div>
<h2><%= t('members.show.contribution_history') %></h2>
<table class='zebra'>
<tr>
<th><%= t('contributions.attributes.payment_on') %></th>
<th><%= t('contributions.attributes.payment_method') %></th>
<th><%= t('contributions.attributes.payment_reference') %></th>
<th><%= t('contributions.attributes.amount') %></th>
</tr>
<% @member.contributions.order(payment_on: :asc).each do |contribution| %>
<tr>
<td><%= contribution.payment_on %></td>
<td><%= contribution.payment_method %></td>
<td><%= contribution.payment_reference %></td>
<td>€<%= contribution.eurocents %></td>
<td>
<ul>
<li><%= link_to t('members.show.actions.edit_contribution'), edit_contribution_path(contribution) %></div>
<li><%= link_to t('members.show.actions.delete_contribution'), delete_contribution_path(contribution) %></li>
</ul>
</td>
</tr>
<% end %>
</table>
<div>
<%= link_to t('members.index.actions.new_contribution'), new_member_contribution_path(@member) %>
</div>
<h2><%= t('members.show.notifications') %></h2>
<table class='zebra'>
<tr>
<th><%= t('notifications.attributes.to_be_sent_on') %></th>
<th><%= t('notifications.attributes.template') %></th>
<th><%= t('notifications.attributes.status') %></th>
<th><%= t('members.show.contribution_actions') %></th>
</tr>
<% @member.notifications.order(to_be_sent_on: :asc).each do |notification| %>
<tr>
<td><%= notification.to_be_sent_on %></td>
<td><code><%= notification.template %></code></td>
<td>
<%= notification_status(notification.status) %>
<% if notification.status == 'sent' %>
(<%= notification.sent_at %>)
<% end %>
</td>
<td>
<% if notification.status == 'scheduled' %>
<%= form_with url: deliver_notification_path(notification) do |form| %>
<%= form.submit t('members.show.actions.deliver_notification') %>
<% end %>
<% end %>
</td>
</tr>
<% end %>
</table>