AutoCommit Mit Aug 26 12:03:05 CEST 2015

This commit is contained in:
Andreas Stephanides
2015-08-26 12:03:05 +02:00
parent 94cad06e31
commit 1047851b47
5 changed files with 36 additions and 9 deletions

View File

@@ -3,9 +3,7 @@
class NewsMailer < ActionMailer::Base
default from: "salzamt@fet.at"
helper :plugins
def current_user
@user
end
def neuigkeit_mail(email, neuigkeit_id)
@neuigkeit= Neuigkeit.find(neuigkeit_id)
@user=User.first
@@ -27,10 +25,20 @@ render locals: {current_user: User.first}
def daily_reminder(user_id)
user=User.find(user_id)
@user=user
self.message.perform_deliveries = false unless user.flag_getemails
ability = Ability.new(user)
@calentries = Calentry.limit(10)
@ability = Ability.new(user)
@calentries = Calentry.limit(100)
# @neuigkeiten=Neuigkeit.accessiblße_by(ability).published_scope.where("cache_order<2")
mail(to: user.email, content_type: "text/html", subject: "sdf")
render locals: {c_user: user}
end
private
include CanCan::ControllerAdditions
def current_user
@user
end
def current_ability
@ability
end
end

View File

@@ -0,0 +1 @@
<%= mail.icon_text %>

View File

@@ -0,0 +1,10 @@
<h1>
<%= mail.title%>
</h1>
<%= content_tag(:img,"",src: "http://" + ActionMailer::Base.default_url_options[:host].to_s + mail.picture.big_thumb.url.to_s) %>
<%=url_for controller: "neuigkeiten",action: :show, :id=>mail.id, only_path: false %>
<%= raw(mail.text) %>
<% mail.questions.each do |q| %>
<%= render partial:"survey/questions/mail", object: q %>
<% end %>
<%= link_to "Auf Fet.at weiterlesen", rubrik_neuigkeit_url(mail.rubrik, mail,:locale=>:de, :theme=>nil) %>

View File

@@ -1,3 +1,11 @@
<%= @calentries.each do |ce| %>
<%= render @calentry%>
<%= stylesheet_link_tag "http://"+ActionMailer::Base.default_url_options[:host].to_s + "/assets/themes/blue2/application.css", :media=>"all" %>
<% @calentries.each do |ce| %>
<hr/>
<% if can?(:show , ce.object) %>
<%= render partial: "calentries/mail", object: ce %>
<%= render partial: "neuigkeiten/mail", object: ce.object if ce.object.kind_of?(Neuigkeit)%>
<% end %>
<hr/>
<% end %>

View File

@@ -16,7 +16,7 @@ Fetsite::Application.configure do
# Don't care if the mailer can't send
config.action_mailer.raise_delivery_errors = true
config.action_mailer.delivery_method =:sendmail
config.action_mailer.default_url_options = {}#{:host=> "localhost", :port=>3000} # :host => 'glonass.htu.tuwien.ac.at' }
config.action_mailer.default_url_options = {:host=> "localhost", :port=>3000} # :host => 'glonass.htu.tuwien.ac.at' }
# Print deprecation notices to the Rails logger
config.active_support.deprecation = :log