Skip to content

A free open source IT asset/license management system

adds custom label table, adds more to the jank editor debug screen

Godfrey Mb4224eb3fae7
diff --git a/database/migrations/2026_03_23_184904_create_custom_labels_table.php b/database/migrations/2026_03_23_184904_create_custom_labels_table.php
new file mode 100644
index 0000000000..8bb933fef0
--- /dev/null
+++ b/database/migrations/2026_03_23_184904_create_custom_labels_table.php
@@ -0,0 +1,33 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+return new class extends Migration
+{
+ /**
+ * Run the migrations.
+ */
+ public function up(): void
+ {
+ Schema::create('custom_labels', function (Blueprint $table) {
+ $table->id();
+ $table->string('name');
+ $table->string('base_label')->nullable();
+ $table->string('type')->default('sheet');
+ $table->json('overrides')->nullable();
+ $table->json('config_snapshot')->nullable();
+ $table->boolean('is_default')->default(false);
+ $table->timestamps();
+ });
+ }
+
+ /**
+ * Reverse the migrations.
+ */
+ public function down(): void
+ {
+ Schema::dropIfExists('custom_labels');
+ }
+};
diff --git a/resources/views/settings/label-edit.blade.php b/resources/views/settings/label-edit.blade.php
index 69e94466b0..9460f1d784 100644
--- a/resources/views/settings/label-edit.blade.php
+++ b/resources/views/settings/label-edit.blade.php
@@ -13,95 +13,269 @@
{{-- Page content --}}
@section('content')
- <form method="POST" action="#">
- @csrf
-
- <h2>{{ $selectedLabel ?: 'Default Label' }}</h2>
- <p>Unit: {{ $config['unit'] }}</p>
-
- @if(!empty($config['page']))
- <h3>Page</h3>
- @foreach($config['page'] as $key => $value)
- <div>
- <label>{{ $key }}</label>
- <input type="number" step="0.001" name="page[{{ $key }}]" value="{{ $value }}">
- </div>
- @endforeach
- @endif
-
- @if(!empty($config['grid']))
- <h3>Grid</h3>
- @foreach($config['grid'] as $key => $value)
- <div>
- <label>{{ $key }}</label>
- <input type="number" step="0.001" name="grid[{{ $key }}]" value="{{ $value }}">
- </div>
- @endforeach
- @endif
-
- @if(!empty($config['label']))
- <h3>Label</h3>
- @foreach($config['label'] as $key => $value)
- <div>
- <label>{{ $key }}</label>
- <input type="number" step="0.001" name="label[{{ $key }}]" value="{{ $value }}">
- </div>
- @endforeach
- @endif
-
- @if(!empty($config['label_printable_area'] ?? null))
- <h3>Printable Area</h3>
- @foreach($config['label_printable_area'] as $key => $value)
- <div>
- <label>{{ $key }}</label>
- <input type="number" step="0.001" value="{{ $value }}" disabled>
- </div>
- @endforeach
- @elseif(!empty($config['printable_area']))
- <h3>Printable Area</h3>
- @foreach($config['printable_area'] as $key => $value)
- <div>
- <label>{{ $key }}</label>
- <input type="number" step="0.001" value="{{ $value }}" disabled>
- </div>
- @endforeach
- @endif
-
- @if(!empty($config['content']))
- <h3>Content</h3>
- @foreach($config['content'] as $key => $value)
- <div>
- <label>{{ $key }}</label>
- <input type="number" step="0.001" name="content[{{ $key }}]" value="{{ $value }}">
+ <style>
+ .label-customizer-layout {
+ display: flex;
+ flex-direction: column;
+ height: calc(100vh - 140px);
+ min-height: 600px;
+ }
+
+ .label-preview-panel {
+ position: sticky;
+ top: 0;
+ z-index: 10;
+ background: #fff;
+ padding-bottom: 12px;
+ border-bottom: 1px solid #ddd;
+ flex-shrink: 0;
+ }
+
+ .label-form-panel {
+ flex: 1 1 auto;
+ overflow-y: auto;
+ padding-top: 15px;
+ min-height: 0;
+ }
+
+ .label-config-section {
+ margin-bottom: 24px;
+ }
+
+ .label-config-section h3 {
+ margin-top: 0;
+ margin-bottom: 12px;
+ }
+
+ .label-config-row {
+ display: flex;
+ align-items: center;
+ gap: 12px;
+ margin-bottom: 10px;
+ }
+
+ .label-config-row label {
+ min-width: 180px;
+ margin-bottom: 0;
+ font-weight: 600;
+ }
+
+ .label-config-row input[type="number"],
+ .label-config-row input[type="text"] {
+ max-width: 220px;
+ }
+ </style>
+ <div class="col-sm-8 col-sm-offset-2 col-md-8 col-md-offset-2">
+ <div class="label-customizer-layout">
+ <fieldset name="label-preview" class="label-preview-panel">
+ <div class="col-md-12" style="margin-bottom: 10px;">
+ @include('partials.label2-preview')
</div>
- @endforeach
- @endif
-
- @if(!empty($config['supports']))
- <h3>Supports</h3>
- @foreach($config['supports'] as $key => $value)
- <div>
- <label>{{ $key }}</label>
-
- @if(is_bool($value))
- <input type="checkbox" name="supports[{{ $key }}]" value="1" {{ $value ? 'checked' : '' }}>
- @else
- <input type="number" step="1" name="supports[{{ $key }}]" value="{{ $value }}">
+ </fieldset>
+
+ <div class="label-form-panel">
+ <form method="POST" action="#">
+ @csrf
+
+ <h2>{{ $selectedLabel ?: 'Default Label' }}</h2>
+ <p>Unit: {{ $config['unit'] }}</p>
+
+ @if(!empty($config['page']))
+ <div class="label-config-section panel panel-default">
+ <div class="panel-heading" style="padding: 0;">
+ <button type="button"
+ class="btn btn-link btn-block text-left"
+ data-toggle="collapse"
+ data-target="#page-config"
+ aria-expanded="true"
+ aria-controls="page-config"
+ style="padding: 12px 15px; text-decoration: none;">
+ <strong>Page</strong>
+ </button>
+ </div>
+ <div id="page-config" class="panel-collapse collapse in">
+ <div class="panel-body">
+ @foreach($config['page'] as $key => $value)
+ <div class="label-config-row">
+ <label>{{ $key }}</label>
+ <input type="number" step="0.001" name="page[{{ $key }}]"
+ value="{{ $value }}" class="form-control">
+ </div>
+ @endforeach
+ </div>
+ </div>
+ </div>
+ @endif
+
+ @if(!empty($config['grid']))
+ <div class="label-config-section panel panel-default">
+ <div class="panel-heading" style="padding: 0;">
+ <button type="button"
+ class="btn btn-link btn-block text-left"
+ data-toggle="collapse"
+ data-target="#grid-config"
+ aria-expanded="false"
+ aria-controls="grid-config"
+ style="padding: 12px 15px; text-decoration: none;">
+ <strong>Grid</strong>
+ </button>
+ </div>
+ <div id="grid-config" class="panel-collapse collapse in">
+ <div class="panel-body">
+ @foreach($config['grid'] as $key => $value)
+ <div class="label-config-row">
+ <label>{{ $key }}</label>
+ <input type="number" step="0.001" name="grid[{{ $key }}]"
+ value="{{ $value }}" class="form-control">
+ </div>
+ @endforeach
+ </div>
+ </div>
+ </div>
+ @endif
+
+ @if(!empty($config['label']))
+ <div class="label-config-section panel panel-default">
+ <div class="panel-heading" style="padding: 0;">
+ <button type="button"
+ class="btn btn-link btn-block text-left"
+ data-toggle="collapse"
+ data-target="#label-config"
+ aria-expanded="false"
+ aria-controls="label-config"
+ style="padding: 12px 15px; text-decoration: none;">
+ <strong>Label</strong>
+ </button>
+ </div>
+ <div id="label-config" class="panel-collapse collapse in">
+ <div class="panel-body">
+ @foreach($config['label'] as $key => $value)
+ <div class="label-config-row">
+ <label>{{ $key }}</label>
+ <input type="number" step="0.001" name="label[{{ $key }}]"
+ value="{{ $value }}" class="form-control">
+ </div>
+ @endforeach
+ </div>
+ </div>
+ </div>
+ @endif
+
+ @if(!empty($config['label_printable_area'] ?? null))
+ <div class="label-config-section panel panel-default">
+ <div class="panel-heading" style="padding: 0;">
+ <button type="button"
+ class="btn btn-link btn-block text-left"
+ data-toggle="collapse"
+ data-target="#printable-area-config"
+ aria-expanded="false"
+ aria-controls="printable-area-config"
+ style="padding: 12px 15px; text-decoration: none;">
+ <strong>Printable Area</strong>
+ </button>
+ </div>
+ <div id="printable-area-config" class="panel-collapse collapse in">
+ <div class="panel-body">
+ @foreach($config['label_printable_area'] as $key => $value)
+ <div class="label-config-row">
+ <label>{{ $key }}</label>
+ <input type="number" step="0.001" value="{{ $value }}" class="form-control"
+ disabled>
+ </div>
+ @endforeach
+ </div>
+ </div>
+ </div>
+ @elseif(!empty($config['printable_area']))
+ <div class="label-config-section panel panel-default">
+ <div class="panel-heading" style="padding: 0;">
+ <button type="button"
+ class="btn btn-link btn-block text-left"
+ data-toggle="collapse"
+ data-target="#printable-area-config"
+ aria-expanded="false"
+ aria-controls="printable-area-config"
+ style="padding: 12px 15px; text-decoration: none;">
+ <strong>Printable Area</strong>
+ </button>
+ </div>
+ <div id="printable-area-config" class="panel-collapse collapse in">
+ <div class="panel-body">
+ @foreach($config['printable_area'] as $key => $value)
+ <div class="label-config-row">
+ <label>{{ $key }}</label>
+ <input type="number" step="0.001" value="{{ $value }}" class="form-control"
+ disabled>
+ </div>
+ @endforeach
+ </div>
+ </div>
+ </div>
+ @endif
+
+ @if(!empty($config['content']))
+ <div class="label-config-section panel panel-default">
+ <div class="panel-heading" style="padding: 0;">
+ <button type="button"
+ class="btn btn-link btn-block text-left"
+ data-toggle="collapse"
+ data-target="#content-config"
+ aria-expanded="false"
+ aria-controls="content-config"
+ style="padding: 12px 15px; text-decoration: none;">
+ <strong>Content</strong>
+ </button>
+ </div>
+ <div id="content-config" class="panel-collapse collapse in">
+ <div class="panel-body">
+ @foreach($config['content'] as $key => $value)
+ <div class="label-config-row">
+ <label>{{ $key }}</label>
+ <input type="number" step="0.001" name="content[{{ $key }}]"
+ value="{{ $value }}" class="form-control">
+ </div>
+ @endforeach
+ </div>
+ </div>
+ </div>
+ @endif
+
+ @if(!empty($config['supports']))
+ <div class="label-config-section panel panel-default">
+ <div class="panel-heading" style="padding: 0;">
+ <button type="button"
+ class="btn btn-link btn-block text-left"
+ data-toggle="collapse"
+ data-target="#supports-config"
+ aria-expanded="false"
+ aria-controls="supports-config"
+ style="padding: 12px 15px; text-decoration: none;">
+ <strong>Supports</strong>
+ </button>
+ </div>
+ <div id="supports-config" class="panel-collapse collapse in">
+ <div class="panel-body">
+ @foreach($config['supports'] as $key => $value)
+ <div class="label-config-row">
+ <label>{{ $key }}</label>
+
+ @if(is_bool($value))
+ <input type="checkbox" name="supports[{{ $key }}]"
+ value="1" {{ $value ? 'checked' : '' }}>
+ @else
+ <input type="number" step="1" name="supports[{{ $key }}]"
+ value="{{ $value }}" class="form-control">
+ @endif
+ </div>
+ @endforeach
+ </div>
+ </div>
+ </div>
@endif
- </div>
- @endforeach
- @endif
-
- @if(!empty($config['meta']))
- <h3>Meta</h3>
- @foreach($config['meta'] as $key => $value)
- <div>
- <label>{{ $key }}</label>
- <input type="text" value="{{ $value }}" disabled>
- </div>
- @endforeach
- @endif
- <button type="submit">Save</button>
- </form>
+ <button type="submit" class="btn btn-primary">Save</button>
+ </form>
+ </div>
+ </div>
+ </div>
@stop
\ No newline at end of file