Add empty state for barcode printers [SCI-5935] ()

This commit is contained in:
aignatov-bio 2021-07-28 11:12:46 +02:00 committed by GitHub
parent 8d033274e4
commit a54f36a486
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 55 additions and 26 deletions
app
config/locales

Binary file not shown.

After

(image error) Size: 16 KiB

View file

@ -18,4 +18,14 @@
.modal-footer {
text-align: center;
}
.no-printers-container {
padding: 2em;
text-align: center;
.no-printer-title {
@include font-h3;
margin-top: 1em;
}
}
}

View file

@ -73,7 +73,7 @@ class RepositoryRowsController < ApplicationController
def print_modal
@repository_rows = @repository.repository_rows.where(id: params[:rows])
@printers = ['test1', 'test2', 'test3']
@printers = []
respond_to do |format|
format.json do
render json: {

View file

@ -1,6 +1,8 @@
<div class="modal fade" id="modal-print-repository-row-label" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<% if @printers.size > 0 %>
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title">
@ -13,7 +15,6 @@
<%= t('repository_row.modal_print_label.head_title_multiple', repository_rows: @repository_rows.size) %>
<% end %>
</h4>
</div>
<div class="modal-body">
<div class=printers-container>
@ -28,6 +29,20 @@
<div class="modal-footer">
<button type="button" class="btn btn-primary" data-dismiss="modal"><%= t('repository_row.modal_print_label.print_label') %></button>
</div>
<% else %>
<div class="modal-body no-printers-container">
<%= image_tag 'printers/no_available_printers' %>
<p class="no-printer-title">
<%= t('repository_row.modal_print_label.no_printers.title') %>
</p>
<p class="no-printer-body">
<%= t('repository_row.modal_print_label.no_printers.description') %>
</p>
</div>
<div class="modal-footer">
<%= link_to t('repository_row.modal_print_label.no_printers.visit_blog'), '', class: "btn btn-primary" %>
</div>
<% end %>
</div>
</div>
</div>

View file

@ -1626,6 +1626,10 @@ en:
printer: "Printer"
number_of_copies: "Number of copies"
print_label: "Print label"
no_printers:
title: "There seems to be no printer available"
description: "To learn more about printing labels and label printers please visit our blog."
visit_blog: "Visit blog"
activities:
index:
global_activities_title: "Global activities"