Module: LinksHelper

Defined in:
app/helpers/links_helper.rb

Instance Method Summary collapse

Instance Method Details



43
44
45
# File 'app/helpers/links_helper.rb', line 43

def link_to_bibliotheca_exercise(exercise)
  edit_link_to_bibliotheca { "#{url_for_bibliotheca_guide(exercise.guide)}/exercises/#{exercise.bibliotheca_id}" }
end


39
40
41
# File 'app/helpers/links_helper.rb', line 39

def link_to_bibliotheca_guide(guide)
  edit_link_to_bibliotheca { url_for_bibliotheca_guide(guide) }
end


8
9
10
# File 'app/helpers/links_helper.rb', line 8

def link_to_error_404
  "<a href='https://es.wikipedia.org/wiki/Error_404'> #{I18n.t(:error_404)} </a>"
end


58
59
60
# File 'app/helpers/links_helper.rb', line 58

def link_to_forum_terms
  link_to t(:forum_terms), discussions_terms_path, target: '_blank'
end


12
13
14
# File 'app/helpers/links_helper.rb', line 12

def link_to_issues(translation)
  "<a href='https://github.com/mumuki/mumuki-laboratory/issues/new'> #{I18n.t(translation)} </a>"
end


3
4
5
6
# File 'app/helpers/links_helper.rb', line 3

def link_to_path_element(element, options={})
  name = extract_name element, options
  link_to name, element, options
end


54
55
56
# File 'app/helpers/links_helper.rb', line 54

def link_to_profile_terms
  link_to t(:terms_and_conditions), terms_user_path, target: '_blank'
end


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

def link_to_status_codes(code)
  "<a href='https://es.wikipedia.org/wiki/Anexo:C%C3%B3digos_de_estado_HTTP' target='_blank'> #{I18n.t("error_#{code}")} </a>"
end

#mail_to_administratorObject



47
48
49
50
51
52
# File 'app/helpers/links_helper.rb', line 47

def mail_to_administrator
  mail_to Organization.current.contact_email,
          Organization.current.contact_email,
          subject: I18n.t(:permissions),
          body: permissions_help_email_body(current_user)
end

#teacher_info_button(item) ⇒ Object



25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'app/helpers/links_helper.rb', line 25

def teacher_info_button(item)
  if current_user&.teacher_here? && item.teacher_info.present?
    %Q{
      <a
        class="mu-popover"
        data-toggle="popover"
        data-html="true"
        title="#{t :teacher_info}"
        data-placement="bottom"
        data-content="#{html_rescape item.teacher_info_html}">#{fixed_fa_icon('info-circle')}</a>
    }.html_safe
  end
end


62
63
64
# File 'app/helpers/links_helper.rb', line 62

def turbolinks_enable_for(exercise)
  %Q{data-turbolinks="#{!exercise.input_kids?}"}.html_safe
end

#url_for_application(app_name) ⇒ Object



20
21
22
23
# File 'app/helpers/links_helper.rb', line 20

def url_for_application(app_name)
  app = Mumukit::Platform.application_for(app_name)
  app.organic_url(Organization.current.name)
end