<%= content_for :javascript do%> $("#send_notification_button").livequery('click',function(){ // Build notification message by putting its parts together <%if @event.start_date%> var beginning = "<%= escape_javascript(t('event.notification.message_beginning_with_start_date' ,:space=>@space.name).gsub('\'event_name\'',@event.name).gsub('\'event_date\'', @event.start_date.strftime("%A %B %d at %H:%M:%S"))) %>" <%else%> var beginning = "<%= escape_javascript(t('event.notification.message_beginning_without_start_date' ,:space=>@space.name).gsub('\'event_name\'',@event.name)) %>" <%end%> // Changing the new line characters to
var personal_msg = ($('#notify_personal').val()).replace(/\n/g,'
'); var ending = "<%= escape_javascript(t('event.notification.message_ending' ,:username=>current_user.full_name,:useremail=>current_user.email,:userorg=>current_user.organization).gsub('event_url',space_event_url(@event.space,@event))) %>
" + "<%= escape_javascript(t('email.spam_invitation', :contact => Site.current.smtp_sender, :feedback => "http://" + Site.current.domain.to_s + new_feedback_path())) %>"; var complete_msg = beginning + personal_msg + '
' + ending; $('#notify_msg').text(complete_msg); document.forms["notification_edit_form"].submit(); }); <%end%>

<%=t('event.notification.message_title')%>

<%= form_for([@space,event], :html => { :multipart => true, :name => "notification_edit_form"}) do |f| -%>
<%=t('event.notification.show_all_attendants')%> <%=t('event.notification.hide_all_attendants')%> <%=t('event.notification.select_all_attendants')%> <%=t('event.notification.deselect_all_attendants')%>
<% for participant in @event.participants -%> <% if participant.attend then%>
<%= check_box_tag "event[notification_ids][]", participant.id, checked_attendants.include?(participant.id.to_s) %><%= label("checkbox",sanitize(participant.user.full_name))%>
<%end%> <%end%>
<%= f.text_field :notif_sender_id, :style => 'display:none', :value => current_user.id %>
<%if @event.start_date%> <%= t('event.notification.message_beginning_with_start_date' ,:space=>@space.name).gsub('\'event_name\'',@event.name).gsub('\'event_date\'', @event.start_date.strftime("%A %B %d at %H:%M:%S")) %> <%else%> <%= t('event.notification.message_beginning_without_start_date' ,:space=>@space.name).gsub('\'event_name\'',@event.name) %> <%end%> <%= t('event.notification.message_ending' ,:username=>current_user.full_name,:useremail=>current_user.email,:userorg=>current_user.organization).gsub('event_url',space_event_url(@event.space,@event)) %>

* <%= t('event.notification.legend.name') %>

" />
<% end %>