Skip to content

Commit

Permalink
Minor tuning of box selection for imports
Browse files Browse the repository at this point in the history
  • Loading branch information
stage-rl committed Sep 20, 2023
1 parent f5a1656 commit 9784e13
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions app/controllers/message_drafts_imports_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ def create
end

def upload_new
@box = Current.box if Current.box
@box = Current.tenant.boxes.first if Current.tenant.boxes.count == 1
authorize MessageDraftsImport
end

Expand Down
7 changes: 6 additions & 1 deletion app/views/message_drafts_imports/upload_new.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
<h2>Nový import draftov</h2>
<% if !Current.box %>
<% if !@box %>
<p>Pre import draftov vyberte v hornej liste schranku, do ktorej sa ma import realizovat</p>
<% else %>
<div class="flex p-8">
<%= "Import prebehne do schránky " %>
<%= render Common::BoxLabelComponent.new(@box) %>
<%= @box.name %>
</div>
<%= form_tag message_drafts_imports_path, method: :post, multipart: true do %>
<%= label_tag :content, 'Import' %>
<%= file_field_tag :content, accept: "application/zip" %>
Expand Down

0 comments on commit 9784e13

Please sign in to comment.