2011-05-18 14:47:17 +02:00
|
|
|
- content_for :head do
|
|
|
|
:javascript
|
|
|
|
$(function() {
|
|
|
|
$('#message_recipient_tokens').tokenInput("#{users_path(:format => :json)}", {
|
|
|
|
crossDomain: false,
|
2012-07-31 18:48:41 +02:00
|
|
|
prePopulate: $('#message_recipient_tokens').data('pre'),
|
|
|
|
hintText: 'Nach Nutzerin suchen',
|
|
|
|
noResultText: 'Keine Nutzerin gefunden',
|
|
|
|
searchingText: 'Suche ...'
|
2011-05-18 14:47:17 +02:00
|
|
|
});
|
2009-01-06 11:49:19 +01:00
|
|
|
|
2011-05-18 14:47:17 +02:00
|
|
|
$('#message_sent_to_all').click(function() {
|
|
|
|
if ($(this).is(':checked')) {
|
|
|
|
$('#recipients').slideUp();
|
|
|
|
} else {
|
|
|
|
$('#recipients').slideDown();
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
2009-01-06 11:49:19 +01:00
|
|
|
|
2011-05-18 14:47:17 +02:00
|
|
|
- title "Neue Nachricht"
|
2009-03-17 18:28:09 +01:00
|
|
|
|
2011-05-18 14:47:17 +02:00
|
|
|
= simple_form_for @message do |f|
|
|
|
|
- if Foodsoft.config[:mailing_list].blank?
|
|
|
|
= f.input :sent_to_all, :as => :boolean
|
|
|
|
- else
|
|
|
|
%b Nachrichten an alle
|
|
|
|
verschickst Du bitte über den Verteiler:
|
|
|
|
= mail_to Foodsoft.config[:mailing_list]
|
2009-01-06 11:49:19 +01:00
|
|
|
%br/
|
2011-05-18 14:47:17 +02:00
|
|
|
%small{:style => "color:grey"}
|
|
|
|
Eventuell musst Du Dich dem Verteiler erst bekannt machen.
|
|
|
|
%br/
|
|
|
|
z.b. mit einer Mail an
|
|
|
|
= mail_to Foodsoft.config[:mailing_list_subscribe]
|
2009-01-06 11:49:19 +01:00
|
|
|
|
2011-05-18 14:47:17 +02:00
|
|
|
#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.desc).all.reject { |g| g.memberships.empty? }
|
|
|
|
= f.input :private
|
|
|
|
= f.input :subject
|
|
|
|
= f.input :body
|
|
|
|
= f.submit
|