- include_stylesheet('admin/reader') - include_javascript('admin/reader') - body_classes << "reversed" = render_region :top - render_region :header do |header| - header.title do %h1 = t('reader_extension.preview_and_send_message') #preview - render_region :preview do |preview| - preview.headers do .message_header %ul - @message.preview.each_header do |name, value| %li{:class => name} = "#{name}:" %strong = value - preview.body do .message_body %iframe.message_body{:src => preview_admin_message_url(@message)} - preview.buttons do .preview_controls %p = link_to t('reader_extension.edit_message'), edit_admin_message_url(@message) #deliver - render_region :delivery do |delivery| - delivery.function do - if @message.administrative? %p - if @message.groups.any? = t("reader_extension.belongs_to_groups", :links => @message.groups.map{ |g| link_to g.name, admin_group_url(g) }.to_sentence, :count => @message.groups.count) = t("reader_extension.message_group_administrative") - else = t("reader_extension.message_administrative") = t("reader_extension.message_function.#{@message.function}") - else %p = t("reader_extension.message_adhoc") - if @message.groups.any? = t("reader_extension.message_group_adhoc", :links => @message.groups.map{|g| link_to g.name, admin_group_url(g)}.to_sentence, :count => @message.groups.count) - delivery.options do - unless @message.administrative? - form_for :message, @message, :url => deliver_admin_message_path(@message), :html => {"data-onsubmit_status"=>"Sending email messages…"} do |f| %h3 = t("reader_extension.send_to").titlecase + ":" .radio_group %p = radio_button_tag 'delivery', 'all', true, :id => 'delivery_to_all', :disabled => @message.possible_readers.empty? %label.checkbox{:for => 'delivery_to_all', :class => @message.possible_readers.empty? ? 'disabled' : ''} = t('reader_extension.everyone') = t('reader_extension.count_people', :count => @message.possible_readers.count) %p = radio_button_tag 'delivery', 'unsent', false, :id => 'delivery_to_unsent', :disabled => @message.undelivered_readers.empty? %label.checkbox{:for => 'delivery_to_unsent', :class => @message.undelivered_readers.empty? ? 'disabled' : ''} = t('reader_extension.everyone_unsent') = t('reader_extension.count_people', :count => @message.undelivered_readers.count) %p = radio_button_tag 'delivery', 'inactive', false, :id => 'delivery_to_inactive', :disabled => @message.inactive_readers.empty? %label.checkbox{:for => 'delivery_to_inactive', :class => @message.inactive_readers.empty? ? 'disabled' : ''} = t('reader_extension.everyone_inactive') = t('reader_extension.count_people', :count => @message.inactive_readers.count) %p = radio_button_tag 'delivery', 'selected', false, :id => 'delivery_to_selected', :disabled => @message.possible_readers.empty?, :rel => 'toggle[select_recipients]' %label.checkbox{:for => 'delivery_to_selected', :class => @message.possible_readers.empty? ? 'disabled' : ''} = t('reader_extension.selected_people') + "..." %ul#select_recipients %li = check_box_tag 'null', '', false, :class => 'select_all' %label.checkbox.select_all = t('reader_extension.select_all') - @message.possible_readers.each do |reader| %li = check_box_tag "recipients[]", reader.id, false, :id => "recipients_#{reader.id}", :class => 'toggled' %label.checkbox = reader.preferred_name %p.buttons = submit_tag t('reader_extension.send_message') = t('or') = link_to t('reader_extension.cancel'), admin_messages_url