diff --git a/app/assets/stylesheets/repository/print_progress_modal.scss b/app/assets/stylesheets/repository/print_progress_modal.scss new file mode 100644 index 000000000..99670fde0 --- /dev/null +++ b/app/assets/stylesheets/repository/print_progress_modal.scss @@ -0,0 +1,60 @@ +.label-printing-progress-modal { + background: $color-white; + bottom: 1em; + box-shadow: $modal-shadow; + min-width: 300px; + position: fixed; + right: 1em; + z-index: 9999; + + .modal-header { + align-items: center; + display: flex; + padding: .5em; + + .title { + @include font-h3; + } + + .printer-status { + border: $border-default; + color: $color-silver-chalice; + margin-left: .5em; + margin-right: auto; + padding: .25em; + + &[data-status="ready"] { + background: $brand-success; + border-color: $brand-success; + color: $color-white; + } + + &[data-status="out_of_labels"] { + background: $brand-warning; + border-color: $brand-warning; + color: $color-white; + } + } + } + + .modal-body { + .printing-items { + .id-label { + margin-left: .5em; + opacity: .5; + } + } + + .printing-status { + color: $brand-primary; + + &[data-status="done"] { + color: $brand-success; + } + + &[data-status="waiting_labels"] { + color: $brand-danger; + } + } + } +} diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index c23c347f1..6857e006d 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -49,6 +49,12 @@ class RepositoriesController < ApplicationController @display_delete_button = can_delete_repository_rows?(@repository) @display_duplicate_button = can_create_repository_rows?(@repository) @snapshot_provisioning = @repository.repository_snapshots.provisioning.any? + @printing = { + printer_name: 'Fluics label printer', + printer_status: :out_of_labels, + items: RepositoryRow.all, + printing_status: :waiting_labels + } end def table_toolbar diff --git a/app/views/repositories/_print_progress_modal.html.erb b/app/views/repositories/_print_progress_modal.html.erb new file mode 100644 index 000000000..3909b882e --- /dev/null +++ b/app/views/repositories/_print_progress_modal.html.erb @@ -0,0 +1,38 @@ +
+ + +
diff --git a/app/views/repositories/show.html.erb b/app/views/repositories/show.html.erb index 14aa43137..78b02df41 100644 --- a/app/views/repositories/show.html.erb +++ b/app/views/repositories/show.html.erb @@ -159,6 +159,8 @@ <%= render partial: 'repositories/import_repository_records_modal', locals: { repository: @repository } %> +<%= render partial: 'repositories/print_progress_modal' %> + <%= render partial: "repositories/delete_record_modal" %> <%= render partial: 'repositories/export_repository_modal', locals: { repository: @repository } %> diff --git a/config/locales/en.yml b/config/locales/en.yml index 7ca120229..71ffab2ee 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1630,6 +1630,17 @@ en: 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" + modal_printing_status: + printer_status: + ready: "Ready" + not_ready: "Not Ready" + out_of_labels: "Out of labels" + id_label: "ID: %{repository_row_id}" + multiple_items: "%{repository_rows_count} labels" + printing_status: + done: "Done" + printing: "Printing" + waiting_labels: "Waiting for labels. Please, insert labels." activities: index: global_activities_title: "Global activities"