2012-10-08 18:19:15 +02:00
|
|
|
- content_for :javascript do
|
2011-05-18 14:47:17 +02:00
|
|
|
: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'),
|
2013-02-09 10:13:56 +01:00
|
|
|
hintText: '#{t '.search_user'}',
|
|
|
|
noResultText: '#{t '.no_user_found'}',
|
|
|
|
searchingText: '#{t '.search'}',
|
2012-10-08 18:19:15 +02:00
|
|
|
theme: 'facebook'
|
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
|
|
|
|
2013-02-09 10:13:56 +01:00
|
|
|
- title t('.title')
|
2009-03-17 18:28:09 +01:00
|
|
|
|
2011-05-18 14:47:17 +02:00
|
|
|
= simple_form_for @message do |f|
|
2012-08-24 19:52:38 +02:00
|
|
|
- if FoodsoftConfig[:mailing_list].blank?
|
2011-05-18 14:47:17 +02:00
|
|
|
= f.input :sent_to_all, :as => :boolean
|
|
|
|
- else
|
2013-02-09 10:13:56 +01:00
|
|
|
%b= t '.list.desc', list: mail_to(FoodsoftConfig[:mailing_list])
|
2009-01-06 11:49:19 +01:00
|
|
|
%br/
|
2011-05-18 14:47:17 +02:00
|
|
|
%small{:style => "color:grey"}
|
2013-02-09 10:13:56 +01:00
|
|
|
= t '.list.subscribe_msg'
|
2011-05-18 14:47:17 +02:00
|
|
|
%br/
|
2012-12-28 13:28:03 +01:00
|
|
|
- if FoodsoftConfig[:mailing_list_subscribe].blank?
|
2013-02-09 10:13:56 +01:00
|
|
|
= t '.list.subscribe', link: link_to(t('.list.wiki'), wiki_page_path('MailingListe'))
|
2012-12-14 18:10:46 +01:00
|
|
|
- else
|
2013-02-09 10:13:56 +01:00
|
|
|
= t '.list.mail', email: mail_to(FoodsoftConfig[: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 }
|
2013-03-16 17:53:24 +01:00
|
|
|
= f.input :group_id, :as => :select, :collection => Group.undeleted.order('type DESC, name ASC').all.reject { |g| g.memberships.empty? }
|
2011-05-18 14:47:17 +02:00
|
|
|
= f.input :private
|
2012-10-08 18:19:15 +02:00
|
|
|
= f.input :subject, input_html: {class: 'input-xxlarge'}
|
|
|
|
= f.input :body, input_html: {class: 'input-xxlarge'}
|
|
|
|
.form-actions
|
2012-12-23 17:38:04 +01:00
|
|
|
= f.submit class: 'btn btn-primary'
|
2013-02-09 10:13:56 +01:00
|
|
|
= link_to t('.cancel'), :back
|