Complete refactoring of messaging module. From now messages are saved only once and send afterwards via a the 'send_emails'-rake-task.
This commit is contained in:
parent
6ce6c2c75a
commit
e8d55e50c0
30 changed files with 220 additions and 349 deletions
|
|
@ -1,23 +1,20 @@
|
|||
%h1 Neue Nachricht
|
||||
|
||||
- form_tag(:action => 'create') do
|
||||
= error_messages_for 'message'
|
||||
- form_for @message do |f|
|
||||
= f.error_messages
|
||||
|
||||
%p
|
||||
%label{:for => "message_recipient"} An
|
||||
%fieldset
|
||||
<input type="checkbox" name="everyone" value="yes"
|
||||
= "checked='checked'" if @everyone
|
||||
onchange="Element.toggle('recipients')" />
|
||||
= f.check_box :sent_to_all, :onchange => "Element.toggle('recipients')"
|
||||
gesamte Foodcoop
|
||||
%table{:id => 'recipients', :style => (@everyone ? 'display:none;' : '')}
|
||||
%table#recipients
|
||||
%tr
|
||||
%td
|
||||
%b BenutzerInnen:
|
||||
%br/
|
||||
%small{:style => "color:grey"} (Mehrere Benutzerinnen mit Komma trennen)
|
||||
%br/
|
||||
= text_field_with_auto_complete(:recipient, :nicks, {:value => @recipient_nicks}, {:tokens => ","})
|
||||
= text_field_with_auto_complete(:message, :recipients_nicks, {:value => @message.recipients_nicks}, {:tokens => ","})
|
||||
:javascript
|
||||
var userListLoaded = false;
|
||||
function checkUserList() {
|
||||
|
|
@ -27,23 +24,21 @@
|
|||
return !userListLoaded;
|
||||
}
|
||||
= link_to_remote('Liste', :update => 'user-list', :url => {:action => 'user_list'}, :complete => 'userListLoaded = true', :condition => 'checkUserList()')
|
||||
%div{:id => 'user-list', :class => 'auto_complete'}
|
||||
#user-list.auto_complete
|
||||
%tr
|
||||
%td
|
||||
%b Gruppe:
|
||||
%br/
|
||||
%select{:name => 'recipient[group_id]'}
|
||||
%option{:value => '-1'} -- Gruppe --
|
||||
= options_from_collection_for_select(Group.find(:all, :order => 'name', :include => :memberships).reject{|g| g.memberships.empty?}, "id", "name", (@group ? @group.id : nil))
|
||||
= f.select :group_id, groups_for_select, :prompt => " -- Gruppe auswählen --"
|
||||
|
||||
%p
|
||||
%label{:for => "message_subject"} Betreff
|
||||
= f.label :subject, "Betreff"
|
||||
%br/
|
||||
= text_field 'message', 'subject'
|
||||
= f.text_field :subject
|
||||
|
||||
%p
|
||||
%label{:for => "message_body"} Nachricht
|
||||
= f.label :body, "Nachricht"
|
||||
%br/
|
||||
= preserve(text_area 'message', 'body', :cols => '80', :rows => '20')
|
||||
~ f.text_area :body, :cols => '80', :rows => '20'
|
||||
|
||||
= submit_tag "Senden"
|
||||
Loading…
Add table
Add a link
Reference in a new issue