Add state for votes
This commit is contained in:
parent
abc26f733f
commit
aefc722c9d
5 changed files with 177 additions and 49 deletions
56
views/votes_edit.erb
Normal file
56
views/votes_edit.erb
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
<h1>Edit draft vote</h1>
|
||||
|
||||
<form action="/votes/<%= @vote.secure_id %>/edit" method="post">
|
||||
<p>
|
||||
<label for="title">Title</label>
|
||||
<input type="text" name="title" value="<%= @vote.title %>">
|
||||
</p>
|
||||
<p>
|
||||
<label for="description">Description</label>
|
||||
<input type="text" name="description" value="<%= @vote.description %>">
|
||||
</p>
|
||||
<button type="submit">Update vote description</button>
|
||||
</form>
|
||||
|
||||
<h2>Candidates</h2>
|
||||
|
||||
<% @vote.candidates.each do |candidate| %>
|
||||
<h3><%= candidate.name %></h3>
|
||||
<p><%= candidate.description %></p>
|
||||
<% end %>
|
||||
|
||||
<h3>Add candidate</h3>
|
||||
|
||||
<form action="/votes/<%= @vote.secure_id %>/candidates" method="post">
|
||||
<p>
|
||||
<label for="name">Name</label>
|
||||
<input type="text" name="name">
|
||||
</p>
|
||||
<p>
|
||||
<label for="description">Description</label>
|
||||
<input type="text" name="description">
|
||||
</p>
|
||||
<button type="submit">Add new candidate</button>
|
||||
</form>
|
||||
|
||||
<h2>Organizers</h2>
|
||||
|
||||
<ul>
|
||||
<% @vote.organizers.each do |organizer| %>
|
||||
<li><%= organizer.user.email %></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
|
||||
<form action="/votes/<%= @vote.secure_id %>/organizers" method="post">
|
||||
<p>
|
||||
<label for="email">Email</label>
|
||||
<input type="text" name="email">
|
||||
</p>
|
||||
<button type="submit">Add new organizer</button>
|
||||
</form>
|
||||
|
||||
<h2>Start voting period</h2>
|
||||
|
||||
<form action="/votes/<%= @vote.secure_id %>/open" method="post">
|
||||
<button type="submit">Open vote to participants</button>
|
||||
</form>
|
||||
Loading…
Add table
Add a link
Reference in a new issue