Move editing the vote description to a dedicated page

So that /votes/:id remains a preview page, even for organizers.
This commit is contained in:
ricola 2025-12-03 18:05:54 +01:00
parent 888dcc1a99
commit be9c415048
5 changed files with 12078 additions and 12 deletions

View file

@ -6,6 +6,7 @@
<title>Vedia</title>
<script src="/chartkick.js"></script>
<script src="/Chart.bundle.js"></script>
<link rel="stylesheet" href="/bootstrap.css">
<link rel="stylesheet" href="/style.css">
</head>
<script>

View file

@ -1,15 +1,11 @@
<h1><%= _("Edit draft vote") %></h1>
<h1><%= @vote.title %></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>
<textarea type="text" name="description"><%= @vote.description %></textarea>
</p>
<button type="submit"><%= _("Save") %></button>
<p>Draft</p>
<%= markdown(@vote.description) %>
<form action="/votes/<%= @vote.secure_id %>/edit" method="get">
<button type="submit"><%= _("Edit") %></button>
</form>
<h2><%= _("Candidates") %></h2>

View file

@ -0,0 +1,13 @@
<h1><%= _("Edit vote description") %></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>
<textarea type="text" name="description"><%= @vote.description %></textarea>
</p>
<button type="submit"><%= _("Save") %></button>
</form>