diff --git a/app/controllers/messages_controller.rb b/app/controllers/messages_controller.rb index 13d0f9f7..d47a6db5 100644 --- a/app/controllers/messages_controller.rb +++ b/app/controllers/messages_controller.rb @@ -2,7 +2,7 @@ class MessagesController < ApplicationController # Renders the "inbox" action. def index - @messages = Message.all :order => 'created_at DESC', :limit => 100 + @messages = Message.public.all :order => 'created_at DESC', :limit => 100 end # Creates a new message object. diff --git a/app/models/message.rb b/app/models/message.rb index 274ca309..8fd1fb62 100644 --- a/app/models/message.rb +++ b/app/models/message.rb @@ -21,6 +21,7 @@ class Message < ActiveRecord::Base named_scope :pending, :conditions => { :email_state => 0 } named_scope :sent, :conditions => { :email_state => 1 } + named_scope :public, :conditions => {:private => false} # Values for the email_state attribute: :none, :pending, :sent, :failed EMAIL_STATE = { diff --git a/app/views/messages/new.haml b/app/views/messages/new.haml index fc15aec9..4af2e9e5 100644 --- a/app/views/messages/new.haml +++ b/app/views/messages/new.haml @@ -4,6 +4,7 @@ = f.error_messages %p + Empfängerinnen %fieldset - if APP_CONFIG[:mailing_list].blank? = f.check_box :sent_to_all, :onchange => "Element.toggle('recipients')" @@ -41,14 +42,19 @@ %b Gruppe: %br/ = f.select :group_id, groups_for_select, :prompt => " -- Gruppe auswählen --" - + %p - = f.label :subject, "Betreff" + Privat + = f.check_box :private + %small{:style => "color:grey"} (Nachricht taucht nicht im Foodsoft-Nachrichteneingang auf) + + %p + Betreff %br/ = f.text_field :subject %p - = f.label :body, "Nachricht" + Nachricht %br/ ~ f.text_area :body, :cols => '80', :rows => '20'