vedia/views/candidates_edit.erb
2025-12-04 02:23:04 +01:00

21 lines
832 B
Text

<h1 class="mb-5"><%= _("Edit candidate") %></h1>
<% if @errors %>
<% @errors.each do |error| %>
<% if error.attribute == :name and error.type == :blank %>
<p class="alert alert-warning mb-4"><%= _("Enter a name.") %></p>
<% end %>
<% end %>
<% end %>
<form action="/votes/<%= @vote.secure_id %>/candidates/<%= @candidate.id %>" method="post">
<div class="mb-3">
<label for="name" class="form-label"><%= _("Name") %></label>
<input type="text" name="name" value="<%= params[:name] %>" class="form-control">
</div>
<div class="mb-3">
<label for="description" class="form-label"><%= _("Description") %></label>
<textarea type="text" name="description" class="form-control"><%= params[:description] %></textarea>
</div>
<button type="submit" class="btn btn-primary"><%= _("Save") %></button>
</form>