Skip to content

Commit

Permalink
Solution upload page enhancement
Browse files Browse the repository at this point in the history
resolves: #266

Signed-off-by: Kostiantyn Kostiuk <[email protected]>
  • Loading branch information
kostyanf14 committed Sep 2, 2023
1 parent 3ae006d commit 31412c8
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions app/views/uploads/edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,13 @@
<%= b.hidden_field :task_id %>

<div class="field">
<%= b.label :file, b.object.task_display_name %>
<%= b.file_field :file, direct_upload: true, accept: b.object.task_accepted_ext,
data: { accept_names: b.object.task_file_names&.to_json } %>
<% if b.object.upload_number <= b.object.task_upload_limit %>
<%= b.label :file, "#{b.object.task_display_name} (#{b.object.task_upload_limit - b.object.upload_number + 1} відправки залишилося)" %>
<%= b.file_field :file, direct_upload: true, accept: b.object.task_accepted_ext,
data: { accept_names: b.object.task_file_names&.to_json } %>
<% else %>
<%= b.label :file, "#{b.object.task_display_name}: Розв'язок завантажено максимальну кількість разів" %>
<% end %>
</div>
<% end %>

Expand Down

0 comments on commit 31412c8

Please sign in to comment.