notification-settings-table.blade.php 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <div class="table-responsive">
  2. <table class="table table-bordered">
  3. <thead>
  4. <tr>
  5. <th>Статус/Источник</th>
  6. @foreach($channels as $channelKey => $channelName)
  7. <th class="text-center">
  8. {{ $channelName }}
  9. @if(!empty($disabledChannels[$channelKey]))
  10. <br><small class="text-muted">недоступен</small>
  11. @endif
  12. </th>
  13. @endforeach
  14. </tr>
  15. </thead>
  16. <tbody>
  17. @foreach($sections as $section)
  18. <tr>
  19. <td colspan="{{ count($channels) + 1 }}" style="background-color: #d4edda;">
  20. <strong>{{ $section['title'] }}</strong>
  21. </td>
  22. </tr>
  23. @foreach($section['options'] as $optionKey => $optionName)
  24. <tr>
  25. <td>
  26. @if(!empty($section['colors'][$optionKey]))
  27. <span class="badge fs-6 text-bg-{{ $section['colors'][$optionKey] }}">{{ $optionName }}</span>
  28. @else
  29. {{ $optionName }}
  30. @endif
  31. </td>
  32. @foreach($channels as $channelKey => $channelName)
  33. @php($isDisabled = !empty($disabledChannels[$channelKey]))
  34. <td class="text-center">
  35. <input class="form-check-input" type="checkbox"
  36. name="notification_settings[{{ $section['settingsKey'] }}][{{ $optionKey }}][{{ $channelKey }}]"
  37. value="1"
  38. @disabled($isDisabled)
  39. @if(!$isDisabled)
  40. @checked(old("notification_settings.{$section['settingsKey']}.{$optionKey}.{$channelKey}", $section['settings'][$optionKey][$channelKey] ?? false))
  41. @endif
  42. >
  43. </td>
  44. @endforeach
  45. </tr>
  46. @endforeach
  47. @endforeach
  48. </tbody>
  49. </table>
  50. </div>