%= 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.legend.name') %>