diff --git a/resources/views/communities/create.blade.php b/resources/views/communities/create.blade.php new file mode 100644 index 0000000..de43527 --- /dev/null +++ b/resources/views/communities/create.blade.php @@ -0,0 +1,39 @@ +@extends('layout') + +@section('title', 'Create Community') + +@section('content') +
+

Create a Community

+ +
+ @csrf + +
+ +
+ r/ + +
+

Community names cannot be changed

+ @error('name') +

{{ $message }}

+ @enderror +
+ +
+ + + @error('description') +

{{ $message }}

+ @enderror +
+ + +
+
+@endsection diff --git a/resources/views/communities/index.blade.php b/resources/views/communities/index.blade.php new file mode 100644 index 0000000..ef04ad4 --- /dev/null +++ b/resources/views/communities/index.blade.php @@ -0,0 +1,35 @@ +@extends('layout') + +@section('title', 'Communities') + +@section('content') +
+
+

Communities

+ @auth + Create Community + @endauth +
+ + @forelse($communities as $community) +
+

+ r/{{ $community->name }} +

+ @if($community->description) +

{{ $community->description }}

+ @endif +
+ {{ $community->posts_count }} posts • {{ $community->subscribers_count }} subscribers + • Created {{ $community->created_at->diffForHumans() }} +
+
+ @empty +

No communities yet. Be the first to create one!

+ @endforelse + +
+ {{ $communities->links() }} +
+
+@endsection diff --git a/resources/views/communities/show.blade.php b/resources/views/communities/show.blade.php new file mode 100644 index 0000000..d8292d0 --- /dev/null +++ b/resources/views/communities/show.blade.php @@ -0,0 +1,94 @@ +@extends('layout') + +@section('title', 'r/' . $community->name) + +@section('content') +
+
+

r/{{ $community->name }}

+ + @forelse($posts as $post) +
+
+ @auth +
+ @csrf + + +
+ @else + + @endauth + + + {{ $post->votes }} + + + @auth +
+ @csrf + + +
+ @else + + @endauth +
+ +
+

+ {{ $post->title }} +

+
+ Posted by u/{{ $post->user->name }} + • {{ $post->created_at->diffForHumans() }} +
+ @if($post->content) +

{{ Str::limit($post->content, 200) }}

+ @endif + @if($post->url) + {{ $post->url }} + @endif + +
+
+ @empty +

No posts yet. Be the first to post!

+ @endforelse + +
+ {{ $posts->links() }} +
+
+ +
+
+

About r/{{ $community->name }}

+ @if($community->description) +

{{ $community->description }}

+ @endif +
+ Created by u/{{ $community->creator->name }} + • {{ $community->created_at->diffForHumans() }} +
+ @auth + @if(auth()->user()->subscribedCommunities->contains($community)) +
+ @csrf + +
+ @else +
+ @csrf + +
+ @endif + @endauth +
+
+
+@endsection diff --git a/resources/views/home.blade.php b/resources/views/home.blade.php new file mode 100644 index 0000000..d069a70 --- /dev/null +++ b/resources/views/home.blade.php @@ -0,0 +1,81 @@ +@extends('layout') + +@section('title', 'Home') + +@section('content') +
+
+

Popular Posts

+ + @forelse($posts as $post) +
+
+ @auth +
+ @csrf + + +
+ @else + + @endauth + + + {{ $post->votes }} + + + @auth +
+ @csrf + + +
+ @else + + @endauth +
+ +
+

+ {{ $post->title }} +

+
+ r/{{ $post->community->name }} + • Posted by u/{{ $post->user->name }} + • {{ $post->created_at->diffForHumans() }} +
+ @if($post->content) +

{{ Str::limit($post->content, 200) }}

+ @endif + @if($post->url) + {{ $post->url }} + @endif + +
+
+ @empty +

No posts yet. Be the first to create one!

+ @endforelse + +
+ {{ $posts->links() }} +
+
+ +
+
+

About

+

Welcome to our Reddit-like community forum! Share your thoughts, engage in discussions, and connect with others.

+ @auth + Create Post + @else + Sign Up + @endauth +
+
+
+@endsection