Просмотр файла resources/views/admin/files/index.blade.php

Размер файла: 3.3Kb
  1. @extends('layout')
  2.  
  3. @section('title', $path ?? __('index.page_editor'))
  4.  
  5. @section('header')
  6. @if (getUser())
  7. <div class="float-end">
  8. <a class="btn btn-success" href="/admin/files/create?path={{ $path }}">{{ __('main.create') }}</a><br>
  9. </div>
  10. @endif
  11.  
  12. <h1>{{ $path ?? __('index.page_editor') }}</h1>
  13. @stop
  14.  
  15. @section('breadcrumb')
  16. <nav>
  17. <ol class="breadcrumb">
  18. <li class="breadcrumb-item"><a href="/"><i class="fas fa-home"></i></a></li>
  19. <li class="breadcrumb-item"><a href="/admin">{{ __('index.panel') }}</a></li>
  20.  
  21. @if ($path)
  22. <li class="breadcrumb-item"><a href="/admin/files">{{ __('index.page_editor') }}</a></li>
  23.  
  24. <?php $dirNames = []; ?>
  25. @foreach ($directories as $directory)
  26. <?php $dirNames[] = $directory; ?>
  27. @if ($path !== implode('/', $dirNames))
  28. <li class="breadcrumb-item"><a href="/admin/files?path={{ implode('/', $dirNames) }}">{{ implode('/', $dirNames) }}</a></li>
  29. @endif
  30. @endforeach
  31. @endif
  32.  
  33. <li class="breadcrumb-item active">{{ $path ?? __('index.page_editor') }}</li>
  34. </ol>
  35. </nav>
  36. @stop
  37.  
  38. @section('content')
  39. @if ($files)
  40. <ul class="list-group">
  41. @foreach ($files as $file)
  42. <?php $fileName = $path ? '/' . $file : $file; ?>
  43. @if (is_dir(RESOURCES . '/views/' . $path . $fileName))
  44. <li class="list-group-item">
  45. <div class="float-end">
  46. <a href="/admin/files/delete?path={{ $path }}&amp;dirname={{ $file }}&amp;token={{ $_SESSION['token'] }}" onclick="return confirm('{{ __('admin.files.confirm_delete_dir') }}')"><i class="fa fa-times"></i></a>
  47. </div>
  48.  
  49. <i class="fa fa-folder"></i> <b><a href="/admin/files?path={{ $path . $fileName }}">{{ $file }}</a></b><br>
  50. {{ __('admin.files.objects') }}: {{ count(array_diff(scandir(RESOURCES . '/views/' . $path . $fileName), ['.', '..'])) }}
  51. </li>
  52. @else
  53. <?php $size = formatSize(filesize(RESOURCES . '/views/' . $path . $fileName)); ?>
  54. <?php $string = count(file(RESOURCES . '/views/' . $path . $fileName)); ?>
  55.  
  56. <li class="list-group-item">
  57. <div class="float-end">
  58. <a href="/admin/files/delete?path={{ $path }}&amp;filename={{ basename($file, '.blade.php') }}&amp;token={{ $_SESSION['token'] }}" onclick="return confirm('{{ __('admin.files.confirm_delete_file') }}')"><i class="fa fa-times"></i></a>
  59. </div>
  60.  
  61. <i class="fa fa-file"></i>
  62. <b><a href="/admin/files/edit?path={{ $path }}&amp;file={{ basename($file, '.blade.php') }}">{{ $file }}</a></b> ({{ $size }})<br>
  63. {{ __('admin.files.lines') }}: {{ $string }} /
  64. {{ __('admin.files.changed') }}: {{ dateFixed(filemtime(RESOURCES . '/views/' . $path . $fileName)) }}
  65. </li>
  66. @endif
  67. @endforeach
  68. </ul>
  69. @else
  70. {{ showError(__('admin.files.empty_objects')) }}
  71. @endif
  72. @stop