Răsfoiți Sursa

styles moved to scss

Alexander Musikhin 3 săptămâni în urmă
părinte
comite
336d430b9f

+ 147 - 0
resources/sass/app.scss

@@ -216,3 +216,150 @@
     margin: 1rem 0;
   }
 }
+
+.is-hidden {
+  display: none;
+}
+
+.max-h-50vh {
+  max-height: 50vh;
+}
+
+.table-initial-hidden {
+  display: none;
+  min-height: 380px;
+}
+
+.img-max-40 {
+  max-height: 40px;
+}
+
+.img-max-50 {
+  max-width: 50px;
+}
+
+.img-max-150 {
+  max-width: 150px;
+}
+
+.img-max-200 {
+  max-width: 200px;
+}
+
+.color-input {
+  height: 32px;
+}
+
+.week-number-input {
+  width: 3rem;
+}
+
+.filter-menu-compact {
+  width: 170px;
+}
+
+.filter-menu-wide {
+  width: 300px;
+}
+
+.filter-list-scroll {
+  max-height: 200px;
+  overflow-y: scroll;
+}
+
+.tooltip-help {
+  cursor: help;
+  text-decoration: underline dotted;
+}
+
+.autocomplete-dropdown {
+  position: absolute;
+  top: 100%;
+  left: 0;
+  right: 0;
+  z-index: 1050;
+  background: white;
+  border: 1px solid #dee2e6;
+  border-top: none;
+  border-radius: 0 0 0.375rem 0.375rem;
+  max-height: 250px;
+  overflow-y: auto;
+  display: none;
+  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
+}
+
+.autocomplete-dropdown.autocomplete-dropdown--order {
+  max-height: 300px;
+}
+
+.autocomplete-dropdown .autocomplete-item {
+  padding: 8px 12px;
+  cursor: pointer;
+  border-bottom: 1px solid #f0f0f0;
+}
+
+.autocomplete-dropdown.autocomplete-dropdown--order .autocomplete-item {
+  padding: 10px 12px;
+}
+
+.autocomplete-dropdown .autocomplete-item:last-child {
+  border-bottom: none;
+}
+
+.autocomplete-dropdown .autocomplete-item:hover,
+.autocomplete-dropdown .autocomplete-item.active {
+  background-color: #e9ecef;
+}
+
+.autocomplete-dropdown .autocomplete-item .code,
+.autocomplete-dropdown .autocomplete-item .article {
+  font-weight: 600;
+  color: #495057;
+}
+
+.autocomplete-dropdown .autocomplete-item .description,
+.autocomplete-dropdown .autocomplete-item .used-in-maf {
+  font-size: 0.875em;
+  color: #6c757d;
+}
+
+.spare-part-dropdown {
+  position: absolute;
+  top: 100%;
+  left: 0;
+  right: 0;
+  z-index: 1050;
+  background: white;
+  border: 1px solid #dee2e6;
+  border-top: none;
+  border-radius: 0 0 0.375rem 0.375rem;
+  max-height: 250px;
+  overflow-y: auto;
+  display: none;
+  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
+}
+
+.spare-part-dropdown .sp-item {
+  padding: 8px 12px;
+  cursor: pointer;
+  border-bottom: 1px solid #f0f0f0;
+}
+
+.spare-part-dropdown .sp-item:last-child {
+  border-bottom: none;
+}
+
+.spare-part-dropdown .sp-item:hover,
+.spare-part-dropdown .sp-item.active {
+  background-color: #e9ecef;
+}
+
+.spare-part-dropdown .sp-item .sp-article {
+  font-weight: 600;
+  color: #495057;
+}
+
+.spare-part-dropdown .sp-item .sp-used {
+  font-size: 0.875em;
+  color: #6c757d;
+}

+ 1 - 1
resources/views/catalog/edit.blade.php

@@ -10,7 +10,7 @@
                 @if(isset($product) && hasRole('admin'))
                     @if($product->image)
                         <a href="{{ $product->image }}" data-toggle="lightbox" data-gallery="photos" data-size="fullscreen">
-                            <img src="{{ $product->image }}" alt="Миниатюра" class="img-thumbnail" style="max-height: 40px;">
+                            <img src="{{ $product->image }}" alt="Миниатюра" class="img-thumbnail img-max-40">
                         </a>
                     @endif
                     <button class="btn btn-sm text-success" onclick="$('#upl-thumb').trigger('click');" title="Загрузить изображение"><i class="bi bi-image"></i> Изображение</button>

+ 1 - 1
resources/views/clear-data/index.blade.php

@@ -37,7 +37,7 @@
             </div>
         </div>
 
-        <div class="col-md-6" id="statsBlock" style="display: none;">
+        <div class="col-md-6 is-hidden" id="statsBlock">
             <div class="card">
                 <div class="card-header">
                     Статистика удаляемых данных за <span id="statsYear"></span> год

+ 1 - 1
resources/views/maf_orders/index.blade.php

@@ -40,7 +40,7 @@
                             <input type="text" class="form-control mb-2" placeholder="Поиск номенклатуры" id="search_maf">
                             <select id="select_maf" class="form-select mb-3" multiple></select>
                         </div>
-                        <div style="display:none;" id="sku_form">
+                        <div class="is-hidden" id="sku_form">
                             <a href="#" onclick="$('#sku_form').slideUp(); $('#select_maf_form').slideDown()">назад</a>
                             <input type="hidden" id="product_id" name="product_id" value="">
                             @include('partials.input', ['name' => 'product_name', 'title' => 'МАФ', 'disabled' => true])

+ 2 - 2
resources/views/partials/color.blade.php

@@ -5,8 +5,8 @@
     </label>
     <div class="@if(!($right ?? null)) col-md-8 @endif ">
         <div class="input-group">
-            <input type="color" name="{{ $name }}" id="{{ $name }}" style="height: 32px"
-                   class="form-control @error($name) is-invalid @enderror" @disabled($disabled ?? null) @required($required ?? null)
+            <input type="color" name="{{ $name }}" id="{{ $name }}"
+                   class="form-control color-input @error($name) is-invalid @enderror" @disabled($disabled ?? null) @required($required ?? null)
                    @isset($min) min="{{ $min }}" @endisset
                    @isset($max) max="{{ $max }}" @endisset
                    @isset($pattern) pattern="{{ $pattern }}" @endisset

+ 1 - 1
resources/views/partials/filterElement.blade.php

@@ -1,4 +1,4 @@
-<div class="dropdown-menu" style="width: 170px;" aria-labelledby="{{$id}}">
+<div class="dropdown-menu filter-menu-compact" aria-labelledby="{{$id}}">
     <div class="px-1">
         <form class="dropdown-filter_{{$id}}">
             @if($type === 'filters')

+ 2 - 2
resources/views/partials/newFilterElement.blade.php

@@ -1,4 +1,4 @@
-<div class="dropdown-menu" style="width: 300px;" aria-labelledby="{{$id}}">
+<div class="dropdown-menu filter-menu-wide" aria-labelledby="{{$id}}">
     <div class="px-1">
         <div class="d-flex mb-2 {{ $isSort ? '' : 'd-none' }}">
             <div class="me-3">Сортировка</div>
@@ -43,7 +43,7 @@
                     <button type="button" class="btn btn-outline-secondary btn-sm w-50" id="check-all_{{$id}}">Выбрать все</button>
                     <button type="button" class="btn btn-outline-secondary btn-sm w-50" id="uncheck-all_{{$id}}">Снять все</button>
                 </div>
-                <div class="ps-1" id="filter-list-{{$id}}" style="max-height: 200px; overflow-y: scroll;">
+                <div class="ps-1 filter-list-scroll" id="filter-list-{{$id}}">
                 </div>
             </form>
             <div class="modal-footer d-flex justify-content-between" id="modal-footer_{{$id}}">

+ 4 - 4
resources/views/partials/table.blade.php

@@ -17,7 +17,7 @@
             <i class="bi bi-gear-fill"></i>
         </button>
     </div>
-    <table class="table table-interactive" id="tbl" data-table-name="{{ $id }}" style="display: none; min-height: 380px;">
+    <table class="table table-interactive table-initial-hidden" id="tbl" data-table-name="{{ $id }}">
         <thead>
         <tr>
             @foreach($header as $headerName => $headerTitle)
@@ -159,14 +159,14 @@
                             <span data-bs-toggle="tooltip"
                                   data-bs-placement="top"
                                   title="{{ $string->tsn_number_description ?? 'Нет расшифровки' }}"
-                                  style="cursor: help; text-decoration: underline dotted;">
+                                  class="tooltip-help">
                                 {{ $string->$headerName }}
                             </span>
                         @elseif($headerName === 'pricing_code' && $string->$headerName)
                             <span data-bs-toggle="tooltip"
                                   data-bs-placement="top"
                                   title="{{ $string->pricing_code_description ?? 'Нет расшифровки' }}"
-                                  style="cursor: help; text-decoration: underline dotted;">
+                                  class="tooltip-help">
                                 {{ $string->$headerName }}
                             </span>
                         @elseif($headerName === 'pricing_codes_list' && $string->pricingCodes->count() > 0)
@@ -174,7 +174,7 @@
                                 <span data-bs-toggle="tooltip"
                                       data-bs-placement="top"
                                       title="{{ $pricingCode->description ?? 'Нет расшифровки' }}"
-                                      style="cursor: help; text-decoration: underline dotted;">
+                                      class="tooltip-help">
                                     {{ $pricingCode->code }}
                                 </span>@if(!$loop->last)<br>@endif
                             @endforeach

+ 1 - 1
resources/views/pricing_codes/index.blade.php

@@ -88,7 +88,7 @@
                                                 <i class="bi bi-pencil"></i>
                                             </button>
                                         </div>
-                                        <form action="{{ route('pricing_codes.update', $code) }}" method="POST" class="edit-form-{{ $code->id }}" style="display: none;">
+                                        <form action="{{ route('pricing_codes.update', $code) }}" method="POST" class="edit-form-{{ $code->id }} is-hidden">
                                             @csrf
                                             @method('PUT')
                                             <div class="input-group input-group-sm">

+ 0 - 40
resources/views/reclamations/edit.blade.php

@@ -598,46 +598,6 @@
     </div>
 @endsection
 
-@push('styles')
-<style>
-.spare-part-dropdown {
-    position: absolute;
-    top: 100%;
-    left: 0;
-    right: 0;
-    z-index: 1050;
-    background: white;
-    border: 1px solid #dee2e6;
-    border-top: none;
-    border-radius: 0 0 .375rem .375rem;
-    max-height: 250px;
-    overflow-y: auto;
-    display: none;
-    box-shadow: 0 4px 6px rgba(0,0,0,.1);
-}
-.spare-part-dropdown .sp-item {
-    padding: 8px 12px;
-    cursor: pointer;
-    border-bottom: 1px solid #f0f0f0;
-}
-.spare-part-dropdown .sp-item:last-child {
-    border-bottom: none;
-}
-.spare-part-dropdown .sp-item:hover,
-.spare-part-dropdown .sp-item.active {
-    background-color: #e9ecef;
-}
-.spare-part-dropdown .sp-item .sp-article {
-    font-weight: 600;
-    color: #495057;
-}
-.spare-part-dropdown .sp-item .sp-used {
-    font-size: 0.875em;
-    color: #6c757d;
-}
-</style>
-@endpush
-
 @push('scripts')
     <script type="module">
         $('#createScheduleButton').on('click', function () {

+ 3 - 3
resources/views/reports/index.blade.php

@@ -79,14 +79,14 @@
             <div class="col-12 border-top my-3"></div>
             <div class="row align-items-center">
                 <div class="col-xl-6">
-                    <div class="ms-md-5 ps-md-5" style="max-height: 50vh">
+                    <div class="ms-md-5 ps-md-5 max-h-50vh">
                         <canvas id="total_orders" class="mx-4"></canvas>
                     </div>
                 </div>
 
                 <div class="col-xl-6 ">
                     <div class=" mb-3">
-                        <canvas id="order_types" style="max-height: 50vh" class="mx-4"></canvas>
+                        <canvas id="order_types" class="mx-4 max-h-50vh"></canvas>
                     </div>
                 </div>
             </div>
@@ -128,7 +128,7 @@
 
             <div class="row align-items-center">
                 <div class="col-xl-6 align-middle">
-                    <div class="ms-md-5 ps-md-5" style="max-height: 50vh">
+                    <div class="ms-md-5 ps-md-5 max-h-50vh">
                         <canvas id="done_orders" class="mx-4"></canvas>
                     </div>
                 </div>

+ 3 - 3
resources/views/schedule/index.blade.php

@@ -16,8 +16,8 @@
                     </div>
                     <label class="p-2 d-none d-mb-block small mt-1" for="fromDate">Неделя №</label>
                     <div class="p-2">
-                        <input type="number" style="width: 3rem" value="{{ $weekNumber }}"
-                               class="form-control form-control-sm" name="weekNumber"
+                        <input type="number" value="{{ $weekNumber }}"
+                               class="form-control form-control-sm week-number-input" name="weekNumber"
                                onchange="document.location = '{{ route('schedule.index') }}?week='+this.value"
                                min="1" max="53" title="№ недели">
                     </div>
@@ -281,4 +281,4 @@
             return Math.ceil((((d - yearStart) / 86400000) + 1) / 7);
         }
     </script>
-@endpush
+@endpush

+ 2 - 39
resources/views/spare_part_orders/edit.blade.php

@@ -17,7 +17,7 @@
 
                 @if($spare_part_order && $spare_part_order->sparePart && $spare_part_order->sparePart->image)
                     <div class="mb-3">
-                        <img src="{{ $spare_part_order->sparePart->image }}" alt="{{ $spare_part_order->sparePart->article }}" class="img-fluid" style="max-width: 150px;">
+                        <img src="{{ $spare_part_order->sparePart->image }}" alt="{{ $spare_part_order->sparePart->article }}" class="img-fluid img-max-150">
                     </div>
                 @endif
 
@@ -34,7 +34,7 @@
                                    placeholder="Введите артикул или наименование..."
                                    autocomplete="off" required>
                             <input type="hidden" name="spare_part_id" id="spare_part_id" value="{{ old('spare_part_id', '') }}" required>
-                            <div class="autocomplete-dropdown" id="spare_part_dropdown"></div>
+                            <div class="autocomplete-dropdown autocomplete-dropdown--order" id="spare_part_dropdown"></div>
                         </div>
                         <div class="form-text" id="spare_part_hint"></div>
                     @endif
@@ -322,43 +322,6 @@
 @endif
 
 @push('scripts')
-<style>
-.autocomplete-dropdown {
-    position: absolute;
-    top: 100%;
-    left: 0;
-    right: 0;
-    z-index: 1050;
-    background: white;
-    border: 1px solid #dee2e6;
-    border-top: none;
-    border-radius: 0 0 .375rem .375rem;
-    max-height: 300px;
-    overflow-y: auto;
-    display: none;
-    box-shadow: 0 4px 6px rgba(0,0,0,.1);
-}
-.autocomplete-dropdown .autocomplete-item {
-    padding: 10px 12px;
-    cursor: pointer;
-    border-bottom: 1px solid #f0f0f0;
-}
-.autocomplete-dropdown .autocomplete-item:last-child {
-    border-bottom: none;
-}
-.autocomplete-dropdown .autocomplete-item:hover,
-.autocomplete-dropdown .autocomplete-item.active {
-    background-color: #e9ecef;
-}
-.autocomplete-dropdown .autocomplete-item .article {
-    font-weight: 600;
-    color: #495057;
-}
-.autocomplete-dropdown .autocomplete-item .used-in-maf {
-    font-size: 0.875em;
-    color: #6c757d;
-}
-</style>
 <script>
 document.addEventListener('DOMContentLoaded', function() {
     const $input = document.getElementById('spare_part_search');

+ 1 - 38
resources/views/spare_parts/edit.blade.php

@@ -34,7 +34,7 @@
                     <div class="col-md-6">
                         @if($spare_part && $spare_part->image)
                             <div class="mb-3">
-                                <img src="{{ $spare_part->image }}" alt="{{ $spare_part->article }}" class="img-fluid" style="max-width: 200px;">
+                                <img src="{{ $spare_part->image }}" alt="{{ $spare_part->article }}" class="img-fluid img-max-200">
                             </div>
                         @endif
 
@@ -539,43 +539,6 @@
 @endif
 
 @push('scripts')
-<style>
-.autocomplete-dropdown {
-    position: absolute;
-    top: 100%;
-    left: 0;
-    right: 0;
-    z-index: 1050;
-    background: white;
-    border: 1px solid #dee2e6;
-    border-top: none;
-    border-radius: 0 0 .375rem .375rem;
-    max-height: 250px;
-    overflow-y: auto;
-    display: none;
-    box-shadow: 0 4px 6px rgba(0,0,0,.1);
-}
-.autocomplete-dropdown .autocomplete-item {
-    padding: 8px 12px;
-    cursor: pointer;
-    border-bottom: 1px solid #f0f0f0;
-}
-.autocomplete-dropdown .autocomplete-item:last-child {
-    border-bottom: none;
-}
-.autocomplete-dropdown .autocomplete-item:hover,
-.autocomplete-dropdown .autocomplete-item.active {
-    background-color: #e9ecef;
-}
-.autocomplete-dropdown .autocomplete-item .code {
-    font-weight: 600;
-    color: #495057;
-}
-.autocomplete-dropdown .autocomplete-item .description {
-    font-size: 0.875em;
-    color: #6c757d;
-}
-</style>
 <script>
 function waitForJQuery(callback) {
     if (typeof $ !== 'undefined') {

+ 3 - 3
resources/views/spare_parts/index.blade.php

@@ -128,7 +128,7 @@
                                     <tr>
                                         <td>
                                             @if($shortage->sparePart && $shortage->sparePart->image)
-                                                <img src="{{ $shortage->sparePart->image }}" alt="{{ $shortage->sparePart->article }}" style="max-width: 50px;">
+                                                <img src="{{ $shortage->sparePart->image }}" alt="{{ $shortage->sparePart->article }}" class="img-max-50">
                                             @endif
                                         </td>
                                         <td>
@@ -187,7 +187,7 @@
                                     <tr>
                                         <td>
                                             @if($sp->image)
-                                                <img src="{{ $sp->image }}" alt="{{ $sp->article }}" style="max-width: 50px;">
+                                                <img src="{{ $sp->image }}" alt="{{ $sp->article }}" class="img-max-50">
                                             @endif
                                         </td>
                                         <td>
@@ -240,7 +240,7 @@
                                     <tr>
                                         <td>
                                             @if($sp->image)
-                                                <img src="{{ $sp->image }}" alt="{{ $sp->article }}" style="max-width: 50px;">
+                                                <img src="{{ $sp->image }}" alt="{{ $sp->article }}" class="img-max-50">
                                             @endif
                                         </td>
                                         <td>

+ 1 - 1
resources/views/year-data/index.blade.php

@@ -32,7 +32,7 @@
                             Показать статистику
                         </button>
 
-                        <div id="exportStatsBlock" class="mt-3" style="display: none;">
+                        <div id="exportStatsBlock" class="mt-3 is-hidden">
                             <h6>Данные для экспорта за <span id="exportStatsYear"></span> год:</h6>
                             <table class="table table-sm table-striped" id="exportStatsTable">
                                 <thead>