Class/Module Index [+]

Quicksearch

ApplicationHelper

Public Instance Methods

absurl(path) click to toggle source
# File app/helpers/application_helper.rb, line 126
def absurl(path)
   if path.nil?
     return nil
   end
  url=URI(root_url)
  url.path=path
  return url
end
cache_array_key(array,prefix="") click to toggle source
# File app/helpers/application_helper.rb, line 2
  def cache_array_key(array,prefix="")
 return "empty_array" if array.nil? or array.empty?
 prefix+array.map{|c| c.id}.join('_')+"_"+array.max{|c|c.updated_at.to_i}.updated_at.try(:utc).to_s+"_"+I18n.locale.to_s 
# array.map{|c| c.id}.join('')+"_"+array.map{|c|c.try(:updated_at).try(:utc).to_s}.join('') +"_"+I18n.locale.to_s
 
 end
clean_calendar(cal) click to toggle source
# File app/helpers/application_helper.rb, line 9
def clean_calendar(cal)
  cal.rubrik.meetingtyps.each do |mt| 
    mt.meetings.each do |m|
      m.calentry.calendar=cal
    end
  end
end
convert_topic_to_meeting(t,mt) click to toggle source
# File app/helpers/application_helper.rb, line 24
  def convert_topic_to_meeting(t,mt)
    m=Meeting.new_with_date_and_typ(t,t.title.to_date+16.hour,mt)
    m.save
    m.create_protocol
    m.protocol.text=t.text
    m.protocol.save
    m.update_time_from_protocol
m.save

    t.meetings << m
    t.save
  end
current_url1(overwrite={}) click to toggle source
# File app/helpers/application_helper.rb, line 36
def current_url1(overwrite={})
  url_for  :params => params.merge(overwrite).except(:controller,:action,:ansicht)
end
fa_list() click to toggle source
# File app/helpers/application_helper.rb, line 73
def fa_list 
  y=YAML.load_file("#{::Rails.root.to_s}/config/fontawesome.yml")
  y["fa"]
end
fa_stack(icon1, icon2) click to toggle source
# File app/helpers/application_helper.rb, line 57
def fa_stack(icon1, icon2)
  h_1 = content_tag("span", content_tag("i","", class: "ficon "+" fa-"+icon1+" fa fa-stack-1x" ) + content_tag("i","", class: "ficon "+" fa-"+icon2+" fa fa-stack-2x" ),class: "fa-stack ")
  
  h_2 = content_tag("span", h_1 ,class: "fa-stack-sm")
 
  h_2
end
ff_icon(name) click to toggle source
# File app/helpers/application_helper.rb, line 53
def ff_icon (name)
  content_tag("i","", class: "ficon "+name )
end
ffi1_icon(name) click to toggle source
# File app/helpers/application_helper.rb, line 46
def ffi1_icon (name)
  content_tag("i", "", class: "ficon ffi1-" + name )
end
ffi1_list() click to toggle source
# File app/helpers/application_helper.rb, line 64
def ffi1_list 
  y=YAML.load_file("#{::Rails.root.to_s}/config/flatfeticon1.yml")
  y["ffi1"]
end
ffi2_icon(name) click to toggle source
# File app/helpers/application_helper.rb, line 50
def ffi2_icon (name)
  content_tag("i","", class: "ficon ffi2-"+name )
end
ffi2_list() click to toggle source
# File app/helpers/application_helper.rb, line 68
def ffi2_list 
  y=YAML.load_file("#{::Rails.root.to_s}/config/flatfeticon2.yml")
  y["ffi2"]
end
get_theme_help(u) click to toggle source
# File app/helpers/application_helper.rb, line 135
  def get_theme_help(u)

#  if params[:theme]== "default" || params[:theme]=="2003" || params[:theme].nil?
#    params[:theme]="blue1"
#    end
    if ! u.try(:preferredtheme).nil? and ThemesForRails.available_theme_names.include?(u.preferredtheme) 
      u.preferredtheme
  else
    "blue1"
  end
end
li_tag(content) click to toggle source
# File app/helpers/application_helper.rb, line 161
def li_tag(content)
  content_tag("li", content)
end
like_dislike_for(obj) click to toggle source
# File app/helpers/application_helper.rb, line 146
def like_dislike_for(obj)
  out=""
  if can?(:like, obj)
    out += link_to ffi1_icon("like3")+" like" + "("+obj.get_likes.size.to_s+")",  url_for([:like, obj]),title: "liked by " + ((current_user.liked?(obj)) ? ("you and " + ((obj.get_likes.size - 1).to_s + " others")) :  obj.get_likes.size.to_s), remote: true  
  else
     out += "liked by " + obj.get_likes.size.to_s
  end

         if can?(:dislike, obj)
          out += link_to ffi1_icon("dislike")+" dislike" + "("+obj.get_dislikes.size.to_s+")", url_for([:dislike, obj]),title:"disliked by " + ((current_user.disliked?(obj)) ? ("you and " + ((obj.get_dislikes.size - 1).to_s + " others")) :  obj.get_dislikes.size.to_s) , remote: true
         else
          out += "disliked by " + obj.get_dislikes.size.to_s
         end
  raw(out)
end
meta_itemprop(itemprop, content) click to toggle source
# File app/helpers/application_helper.rb, line 164
def meta_itemprop(itemprop, content)
  tag("meta", itemprop: itemprop, content: content) 
end
strip_control_chars(value) click to toggle source
# File app/helpers/application_helper.rb, line 16
def strip_control_chars(value)
  value.chars.inject("") do |str, char|
    unless char.ascii_only? && (char.ord < 32 || char.ord == 127)
      str << char
    end
     str
  end
end
switch_locale_url(target_locale) click to toggle source
# File app/helpers/application_helper.rb, line 41
  def switch_locale_url(target_locale)
#    current_url1({:locale=>target_locale}) .sub "/"+I18n.locale.to_s+"/", "/"+target_locale.to_s+"/"
    language_path(locale: target_locale)
  end
tinymce_icon_choice() click to toggle source
# File app/helpers/application_helper.rb, line 79
def tinymce_icon_choice 
  s=""
  ffi1_list.each do |i| 
    s=s+'<a onclick="insertIcon_ffi1(\ffi1-'+i+'\)">'+ffi1_icon(i)+'</a>' 
  end
  raw(s)
end
toolbar_html(elemente) click to toggle source
# File app/helpers/application_helper.rb, line 87
 def toolbar_html(elemente)
   html = ""
   limiter = " | "
       elemente.each do |e| 
               if !e[:icon].nil?
                       case e[:icon]
                       when :pencil
                       text = '<i class="icon-pencil"></i>'.html_safe + e[:text]
                       when :plus
                       text ='<i class="icon-plus"></i>'.html_safe+e[:text]
                       else
                       text = e[:text]
                       end
               else
                       text =e[:text]
               end
               if e[:link].nil? 
               if !e[:method].nil?
                       if !e[:confirm].nil?
                       html = html + link_to(text,e[:path],:confirm=>e[:confirm],:method=>e[:method])
                       else
                       html = html + link_to(text,e[:path],:method => e[:method])
                       end
               else
                       if !e[:confirm].nil?
                       html=html + link_to(text,e[:path],:confirm=>e[:confirm])
                       else
                       html= html + link_to(text,e[:path])
                       end

               end 
               else
               html = html + e[:link]
               end
               
               html=html+limiter
       end
   raw(html)
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.