Module: ApplicationHelper
- Defined in:
- app/helpers/application_helper.rb
Instance Method Summary collapse
- #admin_image ⇒ Object
-
#current_semester ⇒ Object
Do we need this, used on welcome page.
- #display_timestamp(timestamp, options = {}) ⇒ Object
- #format_timestamp(timestamp) ⇒ Object
- #image_spacer(width) ⇒ Object
- #monthname(monthnumber) ⇒ Object
-
#professor_image ⇒ Object
def left_nav_current_semester_courses current_semester() + “ ” + Date.today.year end.
- #sanitize_trusted(html) ⇒ Object
- #scotty_dog_landscape ⇒ Object
- #scotty_dog_portrait ⇒ Object
Instance Method Details
#admin_image ⇒ Object
29 30 31 |
# File 'app/helpers/application_helper.rb', line 29 def admin_image image_tag("admin.jpg", :size => "50x50", :border => "0", :alt => "These fields can be edited by an admin role", :title => "Admin role") end |
#current_semester ⇒ Object
Do we need this, used on welcome page
34 35 36 |
# File 'app/helpers/application_helper.rb', line 34 def current_semester AcademicCalendar.current_semester() end |
#display_timestamp(timestamp, options = {}) ⇒ Object
49 50 51 52 53 54 |
# File 'app/helpers/application_helper.rb', line 49 def (, = {}) return "" if .nil? content_tag(:span, "#{.in_time_zone('Pacific Time (US & Canada)').strftime('%a %b %d %Y, %I:%M %p (Pacific)')}", ) end |
#format_timestamp(timestamp) ⇒ Object
38 39 40 41 |
# File 'app/helpers/application_helper.rb', line 38 def () return "" if .nil? content_tag(:span, "#{time_ago_in_words()} ago", :class => 'timestamp', :title => .in_time_zone('Pacific Time (US & Canada)').strftime('%a %b %d %Y, %I:%M %p Pacific Time')) end |
#image_spacer(width) ⇒ Object
17 18 19 |
# File 'app/helpers/application_helper.rb', line 17 def image_spacer(width) image_tag("/cmu_sv/spacer.gif", :border => "0", :height => "1", :width => width, :alt => "") end |
#monthname(monthnumber) ⇒ Object
43 44 45 46 47 |
# File 'app/helpers/application_helper.rb', line 43 def monthname(monthnumber) if monthnumber Date::MONTHNAMES[monthnumber] end end |
#professor_image ⇒ Object
def left_nav_current_semester_courses
current_semester() + " " + Date.today.year
end
25 26 27 |
# File 'app/helpers/application_helper.rb', line 25 def professor_image image_tag("professor.jpg", :size => "50x50", :border => "0", :alt => "These fields can be edited by a faculty role", :title => "Faculty role") end |
#sanitize_trusted(html) ⇒ Object
4 5 6 |
# File 'app/helpers/application_helper.rb', line 4 def sanitize_trusted(html) return sanitize html, :tags => %w(a b blockquote br div em h1 h2 h3 h4 hr i img span p pre strong strike table tbody thead th tr td u ul ol li), :attributes => %w(align bgcolor border colspan cellpadding cellspacing class href id name padding rowspan scope src start style valign width) end |
#scotty_dog_landscape ⇒ Object
9 10 11 |
# File 'app/helpers/application_helper.rb', line 9 def scotty_dog_landscape image_tag("ScottyDogLandscape.jpg", :class => "bevel", :size => "236x69") end |
#scotty_dog_portrait ⇒ Object
13 14 15 |
# File 'app/helpers/application_helper.rb', line 13 def scotty_dog_portrait image_tag("ScottyDog.jpg", :class => "bevel", :size => "214x234") end |