layout.blade.php 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <!DOCTYPE html>
  2. <html lang="ru">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <title>My Simple Blog</title>
  7. <script src="https://cdn.tailwindcss.com"></script>
  8. <link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700&display=swap" rel="stylesheet">
  9. <style>
  10. body { font-family: 'Inter', sans-serif; }
  11. </style>
  12. </head>
  13. <body class="bg-gray-50 text-gray-800 flex flex-col min-h-screen">
  14. <nav class="bg-white shadow-sm border-b border-gray-100">
  15. <div class="max-w-4xl mx-auto px-4 sm:px-6 lg:px-8">
  16. <div class="flex justify-between h-16">
  17. <div class="flex">
  18. <a href="{{ route('home') }}" class="flex-shrink-0 flex items-center font-bold text-xl text-indigo-600">
  19. BlogApp
  20. </a>
  21. </div>
  22. <div class="flex items-center space-x-6">
  23. <a href="{{ route('admin.posts.index') }}" class="text-sm text-gray-600 hover:text-indigo-600 font-medium transition">
  24. Управление статьями
  25. </a>
  26. <a href="{{ route('admin.comments.index') }}" class="text-sm text-gray-600 hover:text-indigo-600 font-medium transition flex items-center">
  27. Модерация
  28. @php
  29. $pendingCount = \App\Models\Comment::where('is_approved', false)->count();
  30. @endphp
  31. @if($pendingCount > 0)
  32. <span class="ml-2 bg-red-100 text-red-600 text-xs font-bold px-2 py-0.5 rounded-full border border-red-200">
  33. {{ $pendingCount }}
  34. </span>
  35. @endif
  36. </a>
  37. </div>
  38. </div>
  39. </div>
  40. </nav>
  41. <main class="flex-grow">
  42. <div class="max-w-4xl mx-auto py-10 px-4 sm:px-6 lg:px-8">
  43. @if(session('success'))
  44. <div class="mb-6 bg-green-50 border-l-4 border-green-400 p-4 rounded-md shadow-sm">
  45. <div class="flex">
  46. <div class="flex-shrink-0">
  47. <svg class="h-5 w-5 text-green-400" fill="currentColor" viewBox="0 0 20 20"><path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z" clip-rule="evenodd"/></svg>
  48. </div>
  49. <div class="ml-3">
  50. <p class="text-sm text-green-700 font-medium">{{ session('success') }}</p>
  51. </div>
  52. </div>
  53. </div>
  54. @endif
  55. @yield('content')
  56. </div>
  57. </main>
  58. <footer class="bg-white border-t border-gray-200 mt-12">
  59. <div class="max-w-4xl mx-auto py-6 px-4 overflow-hidden sm:px-6 lg:px-8">
  60. <p class="text-center text-base text-gray-400">
  61. &copy; {{ date('Y') }} Simple Blog. Сделано на Laravel.
  62. </p>
  63. </div>
  64. </footer>
  65. </body>
  66. </html>