forked from bofh/fetsite
changed infoscreen layout
This commit is contained in:
@@ -21,7 +21,7 @@ class HomeController < ApplicationController
|
|||||||
|
|
||||||
end
|
end
|
||||||
def infoscreen
|
def infoscreen
|
||||||
authorize! :infoscreen, User
|
#authorize! :infoscreen, User #disabled for testing, pet
|
||||||
@neuigkeiten = Neuigkeit.accessible_by(current_ability, :show).where(flag_infoscreen: true)
|
@neuigkeiten = Neuigkeit.accessible_by(current_ability, :show).where(flag_infoscreen: true)
|
||||||
render layout: false
|
render layout: false
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -135,6 +135,16 @@ class Neuigkeit < ActiveRecord::Base
|
|||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
def text_infoscreen_words
|
||||||
|
md = /<p>(?<text>[^\<\>]*)/.match Sanitize.clean(self.text,:elements=>['p'])
|
||||||
|
words=md[:text].split(" ") unless md.nil?
|
||||||
|
if words.nil? || words.empty?
|
||||||
|
"...."
|
||||||
|
else
|
||||||
|
words[0..1000].join(" ")+ " ..." unless words.nil?
|
||||||
|
|
||||||
|
end
|
||||||
|
end
|
||||||
def has_calentries?
|
def has_calentries?
|
||||||
!self.calentries.nil? && !self.calentries.empty?
|
!self.calentries.nil? && !self.calentries.empty?
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user