Bladeren bron

tg button

Alexander Musikhin 1 maand geleden
bovenliggende
commit
e4a2ade98f
2 gewijzigde bestanden met toevoegingen van 7 en 3 verwijderingen
  1. 5 1
      resources/views/orders/show.blade.php
  2. 2 2
      resources/views/partials/input.blade.php

+ 5 - 1
resources/views/orders/show.blade.php

@@ -66,7 +66,7 @@
                 @include('partials.select', ['name' => 'brigadier_id', 'title' => 'Бригадир', 'options' => $brigadiers, 'value' => $order->brigadier_id ?? old('brigadier_id'), 'first_empty' => true, 'disabled' => !hasRole('admin'), 'classes' => ['update-once']])
                 @include('partials.select', ['name' => 'user_id', 'title' => 'Менеджер', 'options' => $users, 'value' => $order->user_id ?? old('user_id') ?? auth()->user()->id, 'disabled' => !hasRole('admin'), 'classes' => ['update-once']])
                 @include('partials.input', ['name' => 'tg_group_name', 'title' => 'Название группы в ТГ', 'value' => $order->tg_group_name ?? old('tg_group_name'), 'classes' => ['update-once']])
-                @include('partials.input', ['name' => 'tg_group_link', 'title' => 'Ссылка на группу в ТГ', 'value' => $order->tg_group_link ?? old('tg_group_link'), 'classes' => ['update-once']])
+                @include('partials.input', ['name' => 'tg_group_link', 'title' => 'https://t.me/', 'value' => $order->tg_group_link ?? old('tg_group_link'), 'classes' => ['update-once'], 'button' => (!empty($order->tg_group_link)) ? 'tg' : null, 'buttonText' => '<i class="bi bi-telegram"></i>'])
 
                 <hr>
                 <div class="reclamations">
@@ -386,6 +386,10 @@
 
 @push('scripts')
     <script type="module">
+        $('#tg').on('click', function () {
+            window.open('https://t.me/{{ $order->tg_group_link }}', '_blank');
+        });
+
         // select order
         $('#search_order').on('keyup', function () {
             // search products on backend

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

@@ -28,8 +28,8 @@
             @endisset
 
             @isset($button)
-                <button class="btn btn-outline-info" type="button"
-                        id="{{ $button }}">{{ $buttonText ?? 'Имя' }}</button>
+                <button class="btn btn-outline-secondary" type="button"
+                        id="{{ $button }}">{!! $buttonText ?? 'Имя' !!}</button>
             @endisset
         </div>
         @if(($type ?? 'text') === 'range')