Skip to content

A free open source IT asset/license management system

adds translations to Create label modal

Godfrey Mba0c856e51e4
diff --git a/resources/lang/en-US/admin/labels/general.php b/resources/lang/en-US/admin/labels/general.php
index 46c48770f8..02f2b945e5 100644
--- a/resources/lang/en-US/admin/labels/general.php
+++ b/resources/lang/en-US/admin/labels/general.php
@@ -75,4 +75,11 @@ return [
'middle' => 'Middle',
'bottom' => 'Bottom',
],
+ 'create_label' => 'Create Label',
+ 'label_type' => 'Label Type',
+ 'tape_labels' => 'Tape Labels',
+ 'sheet_labels' => 'Sheet Labels',
+ 'page_size' => 'Page Size',
+
+
];
\ No newline at end of file
diff --git a/resources/lang/en-US/general.php b/resources/lang/en-US/general.php
index d1ed715844..bc697c2ab6 100644
--- a/resources/lang/en-US/general.php
+++ b/resources/lang/en-US/general.php
@@ -91,6 +91,7 @@ return [
'complete' => 'Complete',
'consumable' => 'Consumable',
'consumables' => 'Consumables',
+ 'continue' => 'Continue',
'country' => 'Country',
'could_not_restore' => 'Error restoring :item_type: :error',
'not_deleted' => 'The :item_type was not deleted and therefore cannot be restored',
diff --git a/resources/views/modals/new-label-setup.blade.php b/resources/views/modals/new-label-setup.blade.php
index 6d09240ad7..a75d626733 100644
--- a/resources/views/modals/new-label-setup.blade.php
+++ b/resources/views/modals/new-label-setup.blade.php
@@ -10,21 +10,21 @@
</button>
<h4 class="modal-title" id="newLabelModalLabel">
- Create New Label
+ {{trans('admin/labels/general.create_label')}}
</h4>
</div>
<div class="modal-body">
<div class="form-group">
- <label>Label Type</label>
+ <label>{{trans('admin/labels/general.label_type')}}</label>
<div class="row label-type-selector">
<div class="col-xs-6">
<label class="label-type-card active">
<input type="radio" name="type" value="sheet" checked>
<i class="fa-regular fa-file-lines"></i>
- <span>Sheet Labels</span>
+ <span>{{trans('admin/labels/general.sheet_labels')}}</span>
</label>
</div>
@@ -32,7 +32,7 @@
<label class="label-type-card">
<input type="radio" name="type" value="tape">
<i class="fa-solid fa-tape"></i>
- <span>Tape Labels</span>
+ <span>{{trans('admin/labels/general.tape_labels')}}</span>
</label>
</div>
</div>
@@ -40,12 +40,15 @@
<div id="sheet-options">
<div class="form-group">
- <label>Page Size</label>
+ <label>{{trans('admin/labels/general.page_size')}}</label>
<select name="page_size" class="form-control">
@foreach(\App\Models\Labels\RectangleSheet::supportedPageSizes() as $key => $page)
- <option value="{{ $key }}">
- {{ $page['name'] }}
+ <option value="{{ $key }}"
+ data-width="{{ $page['width'] }}"
+ data-height="{{ $page['name'] }}"
+ >
+
</option>
@endforeach
</select>
@@ -54,7 +57,7 @@
<div class="row">
<div class="col-md-6">
- <label>Width (mm)</label>
+ <label>{{trans('admin/labels/general.fields.width')}}</label>
<input
type="number"
step="0.1"
@@ -66,7 +69,7 @@
</div>
<div class="col-md-6">
- <label>Height (mm)</label>
+ <label>{{trans('admin/labels/general.fields.height')}}</label>
<input
type="number"
step="0.1"
@@ -79,14 +82,24 @@
</div>
</div>
+ <div id="sheet-summary" class="text-center">
+ <strong>{{ trans('admin/labels/general.labels_per_sheet') }}</strong>
+
+ <div class="huge text-primary">
+ <span id="labels-per-sheet">0</span>
+ </div>
+ <small class="text-muted">
+ {{ trans('admin/labels/general.based_on_label_dimensions') }}
+ </small>
+ </div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">
- Cancel
+ {{trans('general.cancel')}}
</button>
<button type="submit" class="btn btn-primary">
- Continue
+ {{trans('general.continue')}}
</button>
</div>
@@ -94,15 +107,4 @@
</div>
</div>
-</div>
-<script>
- $('.label-type-card').on('click', function () {
- $('.label-type-card').removeClass('active');
-
- $(this)
- .addClass('active')
- .find('input')
- .prop('checked', true)
- .trigger('change');
- });
-</script>
\ No newline at end of file
+</div>
\ No newline at end of file
diff --git a/resources/views/partials/bootstrap-table.blade.php b/resources/views/partials/bootstrap-table.blade.php
index 02ea5e610d..10678c5ac6 100644
--- a/resources/views/partials/bootstrap-table.blade.php
+++ b/resources/views/partials/bootstrap-table.blade.php
@@ -1241,9 +1241,7 @@
text: 'Create New Label',
title: 'Create New Label',
event() {
- console.log('create label clicked');
$('#new-label-modal').modal('show');
-
},
attributes: {
class: 'btn-info',
@@ -2380,7 +2378,7 @@
const createUrl = '{{ route('settings.labels.create') }}';
// Clone Button
let cloneHref;
- console.log(row.name);
+
if (row.source === 'custom') {
cloneHref = createUrl + '?custom_label_id=' + row.custom_label_id;
} else {
diff --git a/resources/views/settings/labels.blade.php b/resources/views/settings/labels.blade.php
index fefb9f104f..60c3e6cb3a 100644
--- a/resources/views/settings/labels.blade.php
+++ b/resources/views/settings/labels.blade.php
@@ -923,6 +923,19 @@
.text('Invalid JSON');
}
});
+ $(document).on('click', '.label-type-card', function () {
+ $('.label-type-card').removeClass('active');
+ $(this)
+ .addClass('active')
+ .find('input[type="radio"]')
+ .prop('checked', true)
+ .trigger('change');
+ });
+ $(document).on('change', 'input[name="type"]', function () {
+ $('#sheet-options').toggle(this.value === 'sheet');
+ });
+ $('#sheet-summary').toggle(this.value === 'sheet');
+ $('#labels-per-sheet').text(total);
</script>
{{-- Can't use @script here because we're not in a livewire component so let's manually load --}}