producthunt/ShareMeow

View on GitHub
app/views/sip_poll.erb

Summary

Maintainability
Test Coverage
<!DOCTYPE HTML>
<html lang="en">
  <head>
    <meta charset="UTF-8">
  </head>
  <body
    style="background: url('http://ph-files.imgix.net/<%= options[:thumbnail_uuid] %>?auto=format&balph=60&blend=000000&blur=20&bm=normal&fit=crop&h=1280&w=720');">
    <div class="container">
      <div class="poll">
        <h2 class="poll--poll-question">
          <%= options[:poll_question] %>
        </h2>
        <div class="poll--content">
          <% options[:poll_options].each do |poll_option| %>
            <div class="poll--content--poll-option">
              <div class="poll--content--poll-option--text">
                <span class="poll--content--poll-option--option <%= poll_option['voted'] ? 'bold' : nil %>">
                  <img class='poll-icon'  src="https://s3.amazonaws.com/producthunt/static/sip/sip-poll-<%= poll_option['voted'] ? 'check' : 'empty' %>.svg" />
                  <%= poll_option[:option] %>
                </span>
              </div>
              <div
                class="poll--content--poll-option--percentage-container"
              ></div>
                <div
                  class="poll--content--poll-option--percentage-container-fill <%= poll_option['voted'] ? 'voted' : nil %>"
                  style="width: <%= poll_option['percentage'] %>%;"
                >
                </div>
            </div>
          <% end %>
        </div>
      </div>
    </div>
  </body>
</html>