Put multiple actions on the same line

This commit is contained in:
ricola 2025-12-04 17:17:12 -06:00
parent cc6a684bc6
commit 243d27781d

View file

@ -24,12 +24,14 @@
<div class="card-body"> <div class="card-body">
<h3 class="mb-3"><%= candidate.name %></h3> <h3 class="mb-3"><%= candidate.name %></h3>
<%= markdown(candidate.description) %> <%= markdown(candidate.description) %>
<form action="/votes/<%= @vote.secure_id %>/candidates/<%= candidate.id %>" method="get" class="mb-3"> <div class="d-flex">
<button type="submit" class="btn btn-outline-primary"><%= _("Edit") %></button> <form action="/votes/<%= @vote.secure_id %>/candidates/<%= candidate.id %>" method="get" class="me-3">
</form> <button type="submit" class="btn btn-outline-primary"><%= _("Edit") %></button>
<form action="/votes/<%= @vote.secure_id %>/candidates/<%= candidate.id %>/delete" method="post"> </form>
<button type="submit" class="btn btn-outline-danger"><%= _("Delete") %></button> <form action="/votes/<%= @vote.secure_id %>/candidates/<%= candidate.id %>/delete" method="post">
</form> <button type="submit" class="btn btn-outline-danger"><%= _("Delete") %></button>
</form>
</div>
</div> </div>
</div> </div>
<% end %> <% end %>
@ -65,20 +67,24 @@
</div> </div>
</div> </div>
<form action="/votes/<%= @vote.secure_id %>/open" method="get" class="mb-3"> <% if @vote.candidates.length < 2 %>
<% if @vote.candidates.length < 2 %> <p class="alert alert-warning mb-4"><%= _("Add at least 2 candidates before opening the vote to participants.") %></p>
<p class="alert alert-warning mb-4"><%= _("Add at least 2 candidates before opening the vote to participants.") %></p> <% end %>
<fieldset disabled="">
<% end %>
<button type="submit" class="btn btn-primary"><%= _("Open vote to participants") %></button>
<% if @vote.candidates.length < 2 %>
</fieldset>
<% end %>
</form>
<form action="/votes/<%= @vote.secure_id %>/delete" method="post" class="mb-5"> <div class="d-flex">
<button type="submit" class="btn btn-outline-danger"><%= _("Delete vote") %></button> <form action="/votes/<%= @vote.secure_id %>/open" method="get" class="me-3">
</form> <% if @vote.candidates.length < 2 %>
<fieldset disabled="">
<% end %>
<button type="submit" class="btn btn-primary"><%= _("Open vote to participants") %></button>
<% if @vote.candidates.length < 2 %>
</fieldset>
<% end %>
</form>
<form action="/votes/<%= @vote.secure_id %>/delete" method="post" class="mb-5">
<button type="submit" class="btn btn-outline-danger"><%= _("Delete vote") %></button>
</form>
</div>
<h2 class="mb-4"><%= _("Organizers") %></h2> <h2 class="mb-4"><%= _("Organizers") %></h2>