Module: MeurioUi::ViewHelpers

Defined in:
lib/meurio_ui/view_helpers.rb

Instance Method Summary collapse

Instance Method Details

#application_name(app) ⇒ Object



10
11
12
13
14
15
16
17
18
19
# File 'lib/meurio_ui/view_helpers.rb', line 10

def application_name app
  return "Nossas Cidades"      if app == :minhascidades
  return "Panela de Pressão"   if app == :pdp
  return "Imagine"             if app == :imagine
  return "Faça Acontecer"      if app == :apoie
  return "De Olho"             if app == :deolho
  return "De Guarda"           if app == :deguarda
  return "Multitude"           if app == :multitude
  return "Compartilhaço"       if app == :compartilhaco
end

#edit_profile_pathObject



42
43
44
45
46
47
48
# File 'lib/meurio_ui/view_helpers.rb', line 42

def edit_profile_path
  if [:pdp, :multitude, :minhascidades, :compartilhaco].include? @app
    "http://accounts.#{ENV["MEURIO_DOMAIN"]}/users/#{current_user.id}/edit"
  else
    "http://accounts.#{ENV["MEURIO_DOMAIN"]}/users/#{current_user.id}/edit"
  end
end

#meurio_header_for(app) ⇒ Object



5
6
7
8
# File 'lib/meurio_ui/view_helpers.rb', line 5

def meurio_header_for app
  @app = app
  render file: 'meurio_ui/meurio_header'
end

#meurio_ui_assetsObject



21
22
23
24
# File 'lib/meurio_ui/view_helpers.rb', line 21

def meurio_ui_assets
  return nil if request.protocol == 'https://'
   :link, nil, rel: "stylesheet", href: "http://i.icomoon.io/public/b6dafa29d0/MeuRio/style.css"
end

#sign_in_pathObject



26
27
28
29
30
31
32
# File 'lib/meurio_ui/view_helpers.rb', line 26

def 
  if [:pdp, :multitude, :minhascidades, :compartilhaco].include? @app
    "http://accounts.#{ENV["MEURIO_DOMAIN"]}/?service=#{request.url}"
  else
    "http://accounts.#{ENV["MEURIO_DOMAIN"]}/?redirect_url=#{request.url}"
  end
end

#sign_out_pathObject



34
35
36
37
38
39
40
# File 'lib/meurio_ui/view_helpers.rb', line 34

def sign_out_path
  if [:pdp, :multitude, :minhascidades, :compartilhaco].include? @app
    "http://accounts.#{ENV["MEURIO_DOMAIN"]}/logout?service=#{request.url}"
  else
    "http://accounts.#{ENV["MEURIO_DOMAIN"]}/logout?redirect_url=#{request.url}"
  end
end