veto

Simple Sinatra voting website.
git clone git://git.knutsen.co/veto
Log | Files | Refs | README | LICENSE

poll.erb (2058B)


<!DOCTYPE html>
<html>
  <head>
    <title><%= name %> — Veto Vote</title>
    <%= head_tags %>
    <script type="text/javascript">
      let other_allowed = true;
    </script>
    <% unless alt %>
      <script type="text/javascript">
        other_allowed = false;
      </script>
      <style>
        .others {
          display: none !important;
        }
      </style>
    <% end %>
    <link rel="stylesheet" type="text/css" href="/poll.css" />
  </head>
  <body>
    <div class="container">
      <h1><%= name %></h1>

      <div class="row primary">
        <div class="seven columns">
          <table id="primary" class="live"></table>
        </div>
        <div class="five columns chart-area">
          <canvas id="pie" width="100%"></canvas>
        </div>
      </div>

      <br />

      <div class="row others">
        <div class="six columns">
          <table id="other"></table>
          <form id="cast" action="/cast" method="POST">
            <input type="text" id="vote" placeholder="Type your vote."/>
            <input type="submit" id="submit" value="Submit Vote" />
          </form>
        </div>
        <div class="six columns chart-area">
          <canvas id="bar" width="100%"></canvas>
        </div>
      </div>
      <br />
    </div>

    <footer>
      <div class="container">
        <div class="row">
          <div class="left">
            <span>V</span> Straw Polls
          </div>
          <div class="right">
            <a class="github" href="https://github.com/Demonstrandum/Veto">
              <img src="https://cdn.jsdelivr.net/npm/simple-icons@latest/icons/github.svg" alt="GitHub" />
            </a>
            <div class="home">
              Make new poll
            </div>
          </div>
        </div>
      </div>
    </footer>

    <script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.7.3/Chart.bundle.min.js" charset="utf-8"></script>
    <script src="/stats.js"></script>

    <script src="/main.js"></script>
    <script src="/poller.js"></script>
  </body>
</html>