feat: add file upload to word import form
This commit is contained in:
parent
657e08faec
commit
5d1974605e
@ -46,11 +46,16 @@
|
|||||||
<div class="section">
|
<div class="section">
|
||||||
<h2>Import words</h2>
|
<h2>Import words</h2>
|
||||||
<p class="hint">
|
<p class="hint">
|
||||||
One entry per line. Formats: <code>word - definition</code> |
|
One entry per line or upload a .txt/.csv file.
|
||||||
|
Formats: <code>word - definition</code> |
|
||||||
<code>word: definition</code> | <code>word | definition</code> |
|
<code>word: definition</code> | <code>word | definition</code> |
|
||||||
just <code>word</code>
|
just <code>word</code>
|
||||||
</p>
|
</p>
|
||||||
<%= form_with url: words_path, method: :post, local: false, data: { turbo: false } do |f| %>
|
<%= form_with url: words_path, method: :post, local: false, data: { turbo: false }, multipart: true do |f| %>
|
||||||
|
<div class="import-file-row">
|
||||||
|
<%= f.file_field :word_file, accept: ".txt,.csv,.tsv", class: "file-input" %>
|
||||||
|
<span class="import-or">or paste below</span>
|
||||||
|
</div>
|
||||||
<%= f.text_area :word_list, placeholder: "ephemeral - lasting for a very short time\npersistent\ntenacious: holding firmly to a purpose", rows: 8, class: "import-textarea" %>
|
<%= f.text_area :word_list, placeholder: "ephemeral - lasting for a very short time\npersistent\ntenacious: holding firmly to a purpose", rows: 8, class: "import-textarea" %>
|
||||||
<%= f.submit "Import", class: "btn btn-primary" %>
|
<%= f.submit "Import", class: "btn btn-primary" %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user