foodsoft/app/views/messages/new.haml
2012-12-28 13:28:03 +01:00

50 lines
1.8 KiB
Text

- content_for :javascript do
:javascript
$(function() {
$('#message_recipient_tokens').tokenInput("#{users_path(:format => :json)}", {
crossDomain: false,
prePopulate: $('#message_recipient_tokens').data('pre'),
hintText: 'Nach Nutzerin suchen',
noResultText: 'Keine Nutzerin gefunden',
searchingText: 'Suche ...',
theme: 'facebook'
});
$('#message_sent_to_all').click(function() {
if ($(this).is(':checked')) {
$('#recipients').slideUp();
} else {
$('#recipients').slideDown();
}
});
});
- title "Neue Nachricht"
= simple_form_for @message do |f|
- if FoodsoftConfig[:mailing_list].blank?
= f.input :sent_to_all, :as => :boolean
- else
%b Nachrichten an alle
verschickst Du bitte über den Verteiler:
= mail_to FoodsoftConfig[:mailing_list]
%br/
%small{:style => "color:grey"}
Eventuell musst Du Dich dem Verteiler erst bekannt machen.
%br/
- if FoodsoftConfig[:mailing_list_subscribe].blank?
Erklärungen zum Verteiler findest Du im
= link_to 'Wiki (Abschnitt Mailing-Liste)', wiki_page_path('MailingListe')
- else
z.b. mit einer Mail an
= mail_to FoodsoftConfig[:mailing_list_subscribe]
#recipients
= f.input :recipient_tokens, :input_html => { 'data-pre' => User.find_all_by_id(@message.recipients_ids).map { |u| u.token_attributes }.to_json }
= f.input :group_id, :as => :select, :collection => Group.order('type DESC, name ASC').all.reject { |g| g.memberships.empty? }
= f.input :private
= f.input :subject, input_html: {class: 'input-xxlarge'}
= f.input :body, input_html: {class: 'input-xxlarge'}
.form-actions
= f.submit class: 'btn btn-primary'
= link_to 'oder abbrechen', :back