Class/Module Index [+]

Quicksearch

HomeController

Public Instance Methods

admin() click to toggle source
# File app/controllers/home_controller.rb, line 43
def admin
  authorize! :doadmin, User
  t=YAML.load_file("#{::Rails.root.to_s}/config/contact_topic.yml")
  @kontaktthemen = Thema.where(:id=>t)

end
choose_contact_topics() click to toggle source
# File app/controllers/home_controller.rb, line 107
def choose_contact_topics
  authorize! :doadmin, User
  t=YAML.load_file("#{::Rails.root.to_s}/config/contact_topic.yml")
  unless params[:themen].nil?
  t=([t].flatten+params[:themen]).uniq
    end
  unless params[:rmthema].nil?
    t=t-[params[:rmthema]]
  end
  File.open("config/contact_topic.yml",'w'){|f|  f.write(t.to_yaml)}
  redirect_to admin_home_index_path
end
dev() click to toggle source
# File app/controllers/home_controller.rb, line 20
def dev

end
index() click to toggle source
# File app/controllers/home_controller.rb, line 2
def index
  @beispiele = Beispiel.last([Beispiel.count, 3].min)
  @neuigkeiten = Neuigkeit.accessible_by(current_ability, :show).limit(10)
  if Thema.count>0
  t=YAML.load_file("#{::Rails.root.to_s}/config/start_topic.yml")
  @rubriken= Rubrik.accessible_by(current_ability, :show)

  params[:month]= Date.today.month if params[:month].nil?
  params[:year]= Date.today.year if params[:year].nil?

  @calentries= (@rubriken.map {|r| r.calendar}).collect(&:calentries).flatten.select {|c| c.object !=nil}

  @starttopic= @themen = Thema.where(:id=>t).first
  else
    @starttopic=@themen = nil
  end
  @stickythemen = Thema.where(:sticky_startpage=>true)
end
infoscreen() click to toggle source
# File app/controllers/home_controller.rb, line 23
def infoscreen
  authorize! :infoscreen, User 
  @neuigkeiten = Neuigkeit.accessible_by(current_ability, :show).where(flag_infoscreen: true)
  render layout: false
end
intern() click to toggle source
# File app/controllers/home_controller.rb, line 38
def intern
  authorize! :seeintern, User
  @neuigkeiten = Neuigkeit.intern.recent
  @themengruppen=Themengruppe.intern.order(:priority).reverse
end
kontakt() click to toggle source
# File app/controllers/home_controller.rb, line 28
def kontakt
  t=YAML.load_file("#{::Rails.root.to_s}/config/contact_topic.yml")
  @themen = Thema.where(:id=>t)
end
language() click to toggle source
# File app/controllers/home_controller.rb, line 102
def language
  redirect_to :back
rescue ActionController::RedirectBackError
  redirect_to :root
end
linksnotimplemented() click to toggle source
# File app/controllers/home_controller.rb, line 62
def linksnotimplemented
render 'links_notimplemented'
end
log() click to toggle source
# File app/controllers/home_controller.rb, line 49
def log
  authorize! :doadmin, User
  lines = params[:lines]
  if Rails.env == "production"
    @logs = `tail -n #{lines} log/production.log | grep  -v 'actionpack\\|railties\\|activesupport\\|::Translation'`
  else
    @logs = `tail -n #{lines} log/development.log | grep -v 'actionpack\\|railties\\|activesupport\\|::Translation'`
  end

end
search() click to toggle source
# File app/controllers/home_controller.rb, line 66
def search

  unless params['query'].nil? || params['query'].empty?
    @results = Sunspot.search Neuigkeit,Rubrik, Fetprofile, Thema, Themengruppe, Lva, Studium, Modul, Modulgruppe, Gremium, Document do
      fulltext params['query']
    end
    @neuigkeiten=[];
    if can?(:showintern, Neuigkeit)
      #@neuigkeiten=Neuigkeit.search(params['query'])
    else
     # @neuigkeiten =Neuigkeit.search(params['query']).public
    end
    @res=[]
    @results.results.each do |r|
    @res << r if can?(:show,r)
    end

#    @fetprofiles = Fetprofile.search(params['query'])
    @fetprofiles=[]
   # if can?(:showintern, Neuigkeit)
   #   @themen=Thema.search(params['query'])
   # else
   #   @themen=Thema.search(params['query']).public
   # end
@themen=[]

  else
    @neuigkeiten=[]
    @fetprofiles=[]
    @themen=[]
  end
  respond_to do |format|
    format.html
    format.js
  end
end
startdev() click to toggle source
# File app/controllers/home_controller.rb, line 59
def startdev
render 'setup_fetsite_dev'
end
treeview() click to toggle source
# File app/controllers/home_controller.rb, line 32
def treeview
  authorize! :doadmin, User
  @themengruppen = Themengruppe.order(:priority).reverse
  @themengruppen += Themengruppe.intern.order(:priority).reverse

end

[Validate]

Generated with the Darkfish Rdoc Generator 2.