Module: Trinidad::Sandbox::Helpers::View

Defined in:
lib/trinidad_sandbox_extension/app/helpers/view.rb

Instance Method Summary collapse

Instance Method Details



5
6
7
# File 'lib/trinidad_sandbox_extension/app/helpers/view.rb', line 5

def link_to_deploy
  %q{<a href="deploy">deploy</a>}
end

#render_deploy_tokenObject



28
29
30
# File 'lib/trinidad_sandbox_extension/app/helpers/view.rb', line 28

def render_deploy_token
  $servlet_context.get_attribute('deploy_token') || 'SECRET_DEPLOY_TOKEN'
end

#render_host_nameObject



24
25
26
# File 'lib/trinidad_sandbox_extension/app/helpers/view.rb', line 24

def render_host_name
  $servlet_context.get_attribute('host_name') || 'HOST_NAME'
end

#render_parameters(parameters) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/trinidad_sandbox_extension/app/helpers/view.rb', line 9

def render_parameters(parameters)
  render = ''

  parameters.keys.sort.each_with_index do |key, index|
    column = find_column(parameters, index)

    klass = "column#{column}"
    klass << " reset" if column == 2 && find_column(parameters, index - 1) == 1

    render << %Q{<li class="#{klass}">#{key} => #{parameters[key]}</li>}
  end

  render
end