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:
parent
888dcc1a99
commit
be9c415048
5 changed files with 12078 additions and 12 deletions
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
13
views/votes_edit_description.erb
Normal file
13
views/votes_edit_description.erb
Normal 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>
|
||||
Loading…
Add table
Add a link
Reference in a new issue