ncbo/bioportal_web_ui

View on GitHub
app/views/home/feedback.html.haml

Summary

Maintainability
Test Coverage
- @title = "Feedback"
- if params[:pop].eql?("true")
  - pop = true
%div{:style => "margin:20px;"}
  = form_tag('/feedback') do
    -# Simulate form_for by providing a hidden field to check for submission
    = hidden_field_tag 'sim_submit', 'true'
    %p{:style => "font-size:14px"}
      Support is available for Questions, Error reports, Feature requests, Ontology
      submissions, etc.
    %p
      Please include the following:
    .feedback
      %ul
        %li Your email, so we can respond.
        %li
          If you are describing an error, details of how the error occurred, including:
          %ul
            %li URL of the page resulting in the error
            %li Exact steps to replicate the error
            %li Full error message, if any
    %p
      You can use the form below or email us at
      %a{:href => "mailto:#{$SUPPORT_EMAIL}"}= $SUPPORT_EMAIL
    - unless @errors.nil?
      %div{:style => "color:red;margin-bottom:1em;"}
        Errors On Form
        %ul
          - for error in @errors
            %li= error
    %table.form
      = hidden_field_tag("pop", pop)
      = hidden_field_tag("location", params[:location])
      - if session[:user].nil?
        %tr
          %th.top Name:*
          %td.top
            %input{:name => "name", :style => "width:180px", :type => "text", :value => "#{h(params[:name])}"}/
        %tr
          %th Email Address:*
          %td
            %input{:name => "email", :style => "width:180px", :type => "text", :value => "#{h(params[:email])}"}/
      - else
        Hello
        = succeed "," do
          %b= session[:user].username
        = hidden_field_tag "name", session[:user].username
        = hidden_field_tag "email", session[:user].email
      %tr
        %th.top Comment:*
        %td.top
          %textarea{:cols => "60", :name => "comment", :rows => "8"}= h(params[:comment])
      - if using_captcha? && !session[:user]
        %tr
          %th
          %td= recaptcha_tags
      %tr
        %td{:align => "right", :colspan => "2"}
          %input{:type => "submit", :value => "Send Feedback"}/