Module: LinkHelper

Defined in:
app/helpers/link_helper.rb

Instance Method Summary collapse

Instance Method Details

#job_description(job) ⇒ Object


31
32
33
# File 'app/helpers/link_helper.rb', line 31

def job_description(job)
  t("hint.job_description", city: I18n.tw("city"), job_link: (:strong, link_to(job.name, job.url, title: job.name)), company_link: link_to_location(job.location))
end

10
11
12
13
14
# File 'app/helpers/link_helper.rb', line 10

def link_to_event(event, options = {})
  options = {title: event.name, icon: true}.merge(options)
  (options[:icon] ? fa_icon('calendar-o', class: 'pull-left') : '') +
  link_to(options[:title], event, title: options[:title])
end

45
46
47
48
49
50
51
# File 'app/helpers/link_helper.rb', line 45

def link_to_external_route(location)
   :p, class: "external-maps" do
    html = "".html_safe
    html << "#{t("location.open_in")}: "
    html << link_to(t("location.google_maps"), "https://maps.google.com/?q=#{location.address}", target: "_blank")
  end
end

6
7
8
# File 'app/helpers/link_helper.rb', line 6

def link_to_job(job)
  link_to job.name, job.url, title: job.name
end

35
36
37
# File 'app/helpers/link_helper.rb', line 35

def link_to_location(location)
  "#{link_to location.name, location, title: location.name} (#{link_to location.nice_url, location.url, title: location.name})".html_safe
end

26
27
28
29
# File 'app/helpers/link_helper.rb', line 26

def link_to_mailing_list(entry)
  fa_icon('envelope-o', class: 'pull-left') +
  link_to(entry.title, entry.url, title: entry.title)
end

21
22
23
24
# File 'app/helpers/link_helper.rb', line 21

def link_to_material(material)
  fa_icon('list-ul', class: 'pull-left') +
  link_to(material.name, material.url, title: material.name)
end

39
40
41
42
43
# File 'app/helpers/link_helper.rb', line 39

def link_to_route(location)
  (:span, link_to(location.address, "#route", title: "#{location.name}, #{location.address}")) +
  " #{t("show.at")} " +
  (:span, link_to_location(location), class: 'open-icon')
end

16
17
18
19
# File 'app/helpers/link_helper.rb', line 16

def link_to_topic(topic)
  fa_icon('comment-o', class: 'pull-left') +
  link_to(topic.name, topic, title: topic.name)
end

2
3
4
# File 'app/helpers/link_helper.rb', line 2

def link_to_user(user)
  link_to user.name, user, title: user.name
end