openclassify/resources/views/layouts/app.blade.php
GitHub Copilot 22fcd68ed0 Rewrite as Laravel 12 classified ads site (OpenClassify)
- Complete rewrite using Laravel 12 framework
- Modular architecture with nwidart/laravel-modules v11
- Modules: Category, Listing, Location, Profile
- 8 top-level categories with 33 subcategories seeded
- 6 sample listings seeded
- 5 countries, 13 cities, districts seeded
- Multi-language support: en, tr, ar, zh, es, fr, de, pt, ru, ja
- Auth scaffolding via Laravel Breeze
- Partner dashboard for user listing management
- Tailwind CSS via CDN for styling
- SQLite database for development
- RTL support for Arabic locale

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-02 23:34:07 +00:00

101 lines
6.6 KiB
PHP

<!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}" dir="{{ in_array(app()->getLocale(), ['ar']) ? 'rtl' : 'ltr' }}">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="csrf-token" content="{{ csrf_token() }}">
<title>{{ config('app.name', 'OpenClassify') }} @hasSection('title') - @yield('title') @endif</title>
<script src="https://cdn.tailwindcss.com"></script>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
<style>body { font-family: 'Inter', sans-serif; } [dir="rtl"] { text-align: right; }</style>
</head>
<body class="bg-gray-50">
<nav class="bg-white shadow-sm border-b sticky top-0 z-50">
<div class="container mx-auto px-4">
<div class="flex items-center justify-between h-16">
<a href="{{ route('home') }}" class="text-2xl font-bold text-blue-600">OpenClassify</a>
<div class="hidden md:flex items-center space-x-6">
<a href="{{ route('home') }}" class="text-gray-600 hover:text-blue-600 transition">{{ __('messages.home') }}</a>
<a href="{{ route('categories.index') }}" class="text-gray-600 hover:text-blue-600 transition">{{ __('messages.categories') }}</a>
<a href="{{ route('listings.index') }}" class="text-gray-600 hover:text-blue-600 transition">{{ __('messages.listings') }}</a>
</div>
<div class="flex items-center space-x-4">
<div class="relative group">
<button class="flex items-center text-gray-600 hover:text-blue-600 transition px-2 py-1 rounded border text-sm">
🌐 {{ strtoupper(app()->getLocale()) }}
</button>
<div class="absolute right-0 mt-1 bg-white shadow-lg rounded-lg border hidden group-hover:block z-50 w-32">
@foreach(config('app.available_locales', ['en']) as $locale)
<a href="{{ route('lang.switch', $locale) }}" class="block px-4 py-2 text-sm hover:bg-gray-50 {{ app()->getLocale() === $locale ? 'font-bold text-blue-600' : 'text-gray-700' }}">
{{ ['en'=>'English','tr'=>'Türkçe','ar'=>'العربية','zh'=>'中文','es'=>'Español','fr'=>'Français','de'=>'Deutsch','pt'=>'Português','ru'=>'Русский','ja'=>'日本語'][$locale] ?? $locale }}
</a>
@endforeach
</div>
</div>
@auth
<a href="{{ route('listings.create') }}" class="bg-orange-500 text-white px-4 py-2 rounded-lg hover:bg-orange-600 transition font-medium text-sm">+ Post Ad</a>
<div class="relative group">
<button class="text-gray-600 hover:text-blue-600">{{ auth()->user()->name }}</button>
<div class="absolute right-0 mt-1 bg-white shadow-lg rounded-lg border hidden group-hover:block z-50 w-40">
<a href="{{ route('profile.show') }}" class="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-50">My Profile</a>
<a href="{{ route('partner.dashboard') }}" class="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-50">Dashboard</a>
<form method="POST" action="{{ route('logout') }}">
@csrf
<button type="submit" class="w-full text-left px-4 py-2 text-sm text-red-600 hover:bg-gray-50">Logout</button>
</form>
</div>
</div>
@else
<a href="{{ route('login') }}" class="text-gray-600 hover:text-blue-600 transition">{{ __('messages.login') }}</a>
<a href="{{ route('register') }}" class="bg-blue-600 text-white px-4 py-2 rounded-lg hover:bg-blue-700 transition text-sm">{{ __('messages.register') }}</a>
@endauth
</div>
</div>
</div>
</nav>
@if(session('success'))
<div class="bg-green-100 border border-green-400 text-green-700 px-4 py-3 text-center">{{ session('success') }}</div>
@endif
@if(session('error'))
<div class="bg-red-100 border border-red-400 text-red-700 px-4 py-3 text-center">{{ session('error') }}</div>
@endif
<main>@yield('content')</main>
<footer class="bg-gray-800 text-gray-400 mt-16 py-12">
<div class="container mx-auto px-4">
<div class="grid grid-cols-1 md:grid-cols-4 gap-8">
<div>
<h3 class="text-white font-bold text-lg mb-4">OpenClassify</h3>
<p class="text-sm">The marketplace for buying and selling everything.</p>
</div>
<div>
<h4 class="text-white font-medium mb-4">Quick Links</h4>
<ul class="space-y-2 text-sm">
<li><a href="{{ route('home') }}" class="hover:text-white transition">Home</a></li>
<li><a href="{{ route('categories.index') }}" class="hover:text-white transition">Categories</a></li>
<li><a href="{{ route('listings.index') }}" class="hover:text-white transition">All Listings</a></li>
</ul>
</div>
<div>
<h4 class="text-white font-medium mb-4">Account</h4>
<ul class="space-y-2 text-sm">
<li><a href="{{ route('login') }}" class="hover:text-white transition">Login</a></li>
<li><a href="{{ route('register') }}" class="hover:text-white transition">Register</a></li>
</ul>
</div>
<div>
<h4 class="text-white font-medium mb-4">Languages</h4>
<div class="flex flex-wrap gap-2">
@foreach(config('app.available_locales', ['en']) as $locale)
<a href="{{ route('lang.switch', $locale) }}" class="text-xs {{ app()->getLocale() === $locale ? 'text-white' : 'hover:text-white' }} transition">{{ strtoupper($locale) }}</a>
@endforeach
</div>
</div>
</div>
<div class="border-t border-gray-700 mt-8 pt-8 text-center text-sm">
<p>© {{ date('Y') }} OpenClassify. All rights reserved.</p>
</div>
</div>
</footer>
</body>
</html>