<% define_content :link do %> <%= appointment_group_url(asset.appointment_group, :event_id => asset.to_param) %> <% end %> <% define_content :subject do %> <%= t('subject', 'User signed up for "%{appointment_name}" (%{course})', :appointment_name => asset.title, :course => asset.appointment_group.contexts_for_user(user).map(&:name).join(", ")) %> <% end %> <% if asset.grants_right?(user, :read) -%> <% define_content :footer_link do %> <%= t :link_text, 'View the appointment' %> <% end %> <% end -%>

<%= t :message, '%{user} has signed up for "%{appointment_name}".', :user => data.updating_user_name || data.updating_user.name, :appointment_name => asset.title %>

<%= t :details, 'Appointment Details' %>:

<% if asset.appointment_group.participant_type == 'Group' -%> <% else %> <% end %> <% if asset.appointment_group.available_slots && asset.grants_right?(user, :read) -%> <% end %>
<%= t :date_and_time, 'Date/time' %>: <%= datetime_string(asset.start_at, asset.end_at) %>
<%= t :attendees, 'Attendees' %>: <%= asset.participants.map(&:name).to_sentence %>
<%= t :group, 'Group' %>: <%= asset.context.name %>
<%= t :attendee, 'Attendee' %>: <%= asset.context.name %>
<%= t :course, 'Course' %>: <%= asset.appointment_group.participant_type == 'Group' ? asset.appointment_group.contexts.first.name : asset.appointment_group.contexts_for_user(user).map(&:name).join(", ") %>
<%= t :slots_remaining, 'Available time slots' %>: <%= asset.appointment_group.available_slots(current_only: true) %>