Skip to content

Commit

Permalink
Update layout on discussion and user profil
Browse files Browse the repository at this point in the history
  • Loading branch information
mckenziearts committed Jan 6, 2024
1 parent 78f779a commit 6325392
Show file tree
Hide file tree
Showing 9 changed files with 203 additions and 203 deletions.
10 changes: 6 additions & 4 deletions resources/views/components/user/breadcrumb.blade.php
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
@props(['section'])

<nav class="flex mb-3" aria-label="Breadcrumb">
<ol role="list" class="flex items-center space-x-4">
<ol role="list" class="flex items-center space-x-2">
<li>
<div>
<a href="{{ route('dashboard') }}" class="text-skin-muted hover:text-skin-base">
<x-heroicon-s-home class="shrink-0 h-5 w-5" />
<x-untitledui-home class="shrink-0 h-5 w-5" />
<span class="sr-only">Accueil</span>
</a>
</div>
</li>

<li>
<div class="flex items-center">
<svg class="shrink-0 h-5 w-5 text-gray-300" xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 20 20" aria-hidden="true">
<svg class="shrink-0 h-5 w-5 text-skin-muted" xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 20 20" aria-hidden="true">
<path d="M5.555 17.776l8-16 .894.448-8 16-.894-.448z" />
</svg>
<span href="#" class="ml-4 text-sm font-medium text-skin-base" aria-current="page">{{ $section }}</span>
<span class="ml-2 text-sm font-medium text-skin-base" aria-current="page">
{{ $section }}
</span>
</div>
</li>
</ol>
Expand Down
17 changes: 13 additions & 4 deletions resources/views/discussions/_contributions.blade.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
<x-sticky-content class="space-y-12">
<div>
<h4 class="text-lg font-semibold text-skin-inverted font-sans leading-6">{{ __('Top Contributeurs') }}</h4>
<p class="mt-3 font-normal text-skin-base text-sm">{{ __('Les personnes qui ont lancé le plus de discussions sur le site.') }}</p>
<h4 class="text-lg font-semibold text-skin-inverted font-sans leading-6">
Top Contributeurs
</h4>
<p class="mt-3 font-normal text-skin-base text-sm">
Les personnes qui ont lancé le plus de discussions sur le site.
</p>
<div class="mt-6">
<ul role="list" class="divide-y divide-skin-base">
@foreach($topContributors as $contributor)
Expand Down Expand Up @@ -36,8 +40,13 @@
</div>

<div>
<h4 class="text-lg font-semibold text-skin-inverted font-sans leading-6">{{ __('Discussions sans commentaires') }}</h4>
<p class="mt-3 font-normal text-skin-base text-sm">{{ __('Les discussions/sujets qui n’ont pas encore eu de commentaires. Soyez le premier à apporter votre contribution.') }}</p>
<h4 class="text-lg font-semibold text-skin-inverted font-sans leading-6">
Discussions sans commentaires
</h4>
<p class="mt-3 font-normal text-skin-base text-sm">
Les discussions / sujets qui n’ont pas encore eu de commentaires.
Soyez le premier à apporter votre contribution.
</p>

<div class="mt-6">
<ul role="list" class="divide-y divide-skin-base">
Expand Down
10 changes: 3 additions & 7 deletions resources/views/discussions/edit.blade.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
@title(__('Modifier la discussion > :subject', ['subject' => $discussion->subject()]))
<x-app-layout :title="'Modifier la discussion > ' . $discussion->subject()">

@extends('layouts.default')

@section('body')

<div class="max-w-4xl mx-auto">
<div class="max-w-4xl mx-auto py-12">
<div class="space-y-8 divide-y divide-skin-base sm:space-y-5">
<div>
<h3 class="text-lg leading-6 font-medium text-skin-inverted font-heading">
Expand All @@ -19,4 +15,4 @@
</div>
</div>

@endsection
</x-app-layout>
12 changes: 5 additions & 7 deletions resources/views/discussions/index.blade.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
@title('Tous les sujets de discussion')
<x-app-layout title="Tous les sujets de discussion">

@extends('layouts.default')
<x-container class="py-12">
<livewire:discussions.browse />
</x-container>

@section('body')

<livewire:discussions.browse />

@endsection
</x-app-layout>
10 changes: 3 additions & 7 deletions resources/views/discussions/new.blade.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
@title('Créer un nouveau sujet de discussion')
<x-app-layout title="Créer un nouveau sujet de discussion">

@extends('layouts.default')

@section('body')

<div class="max-w-4xl mx-auto">
<div class="max-w-4xl mx-auto py-12">
<div class="space-y-8 divide-y divide-skin-base sm:space-y-5">
<div>
<h3 class="text-lg leading-6 font-medium text-skin-inverted font-heading">
Expand All @@ -19,4 +15,4 @@
</div>
</div>

@endsection
</x-app-layout>
180 changes: 90 additions & 90 deletions resources/views/discussions/show.blade.php
Original file line number Diff line number Diff line change
@@ -1,102 +1,102 @@
@title($discussion->title)
<x-app-layout :title="$discussion->title">

@extends('layouts.default')

@section('body')

<div class="relative lg:grid lg:grid-cols-12 lg:gap-8">
<div class="lg:col-span-8">
<header class="space-y-5 border-b border-skin-base">
<div>
<h1 class="text-2xl font-extrabold text-skin-inverted tracking-tight font-heading sm:text-3xl sm:leading-8">{{ $discussion->title }}</h1>
<div class="mt-2 sm:flex sm:items-center space-x-4">
<span class="inline-flex items-center justify-center text-skin-base bg-skin-card-gray h-8 w-8 rounded-full">
<x-heroicon-s-tag class="h-5 w-5" />
</span>
@if ($discussion->tags->isNotEmpty())
<div class="flex items-center space-x-2">
@foreach ($discussion->tags as $tag)
<x-tag :tag="$tag" />
@endforeach
</div>
@endif
</div>
</div>
<div class="relative pb-8">
<div class="relative sm:flex sm:space-x-3">
<div class="flex items-center sm:items-start">
<div class="relative">
<img class="h-10 w-10 object-cover rounded-full bg-skin-card-gray ring-8 ring-body" src="{{ $discussion->user->profile_photo_url }}" alt="{{ $discussion->user->name }}">
<span class="absolute top-5 -right-1 bg-skin-body rounded-tl px-0.5 py-px">
<svg class="h-5 w-5 text-skin-muted" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
<path fill-rule="evenodd" d="M12 2.25c-2.429 0-4.817.178-7.152.521C2.87 3.061 1.5 4.795 1.5 6.741v6.018c0 1.946 1.37 3.68 3.348 3.97.877.129 1.761.234 2.652.316V21a.75.75 0 001.28.53l4.184-4.183a.39.39 0 01.266-.112c2.006-.05 3.982-.22 5.922-.506 1.978-.29 3.348-2.023 3.348-3.97V6.741c0-1.947-1.37-3.68-3.348-3.97A49.145 49.145 0 0012 2.25zM8.25 8.625a1.125 1.125 0 100 2.25 1.125 1.125 0 000-2.25zm2.625 1.125a1.125 1.125 0 112.25 0 1.125 1.125 0 01-2.25 0zm4.875-1.125a1.125 1.125 0 100 2.25 1.125 1.125 0 000-2.25z" clip-rule="evenodd" />
</svg>
</span>
</div>
<div class="ml-4 sm:hidden">
<a href="{{ route('profile', $discussion->user->username) }}">
<h4 class="inline-flex items-center text-sm text-skin-inverted font-medium">
{{ $discussion->user->name }}
@if($discussion->user->hasAnyRole('admin', 'moderator'))
<x-user.status />
@endif
</h4>
</a>
<div class="text-sm whitespace-nowrap text-skin-muted font-normal">
<time class="sr-only" datetime="{{ $discussion->created_at->format('Y-m-d') }}">{{ $discussion->created_at->diffForHumans() }}</time>
Crée <time-ago time="{{ $discussion->created_at->getTimestamp() }}"/>
<x-container class="py-12">
<div class="relative lg:grid lg:grid-cols-12 lg:gap-8">
<div class="lg:col-span-8">
<header class="space-y-5 border-b border-skin-base">
<div>
<h1 class="text-2xl font-extrabold text-skin-inverted tracking-tight font-heading sm:text-3xl sm:leading-8">{{ $discussion->title }}</h1>
<div class="mt-2 sm:flex sm:items-center space-x-4">
<span class="inline-flex items-center justify-center text-skin-base bg-skin-card-gray h-8 w-8 rounded-full">
<x-heroicon-s-tag class="h-5 w-5" />
</span>
@if ($discussion->tags->isNotEmpty())
<div class="flex items-center space-x-2">
@foreach ($discussion->tags as $tag)
<x-tag :tag="$tag" />
@endforeach
</div>
</div>
@endif
</div>
<div class="min-w-0 flex-1">
<div class="hidden sm:block">
<a href="{{ route('profile', $discussion->user->username) }}">
<h4 class="inline-flex items-center text-sm text-skin-inverted font-medium">
{{ $discussion->user->name }}
@if($discussion->user->hasAnyRole('admin', 'moderator'))
<x-user.status />
@endif
</h4>
</a>
<div class="text-sm whitespace-nowrap text-skin-muted font-normal">
<time class="sr-only" datetime="{{ $discussion->created_at->format('Y-m-d') }}">
{{ $discussion->created_at->diffForHumans() }}
</time>
{{ __('Crée') }} <time-ago time="{{ $discussion->created_at->getTimestamp() }}"/>
</div>
<div class="relative pb-8">
<div class="relative sm:flex sm:space-x-3">
<div class="flex items-center sm:items-start">
<div class="relative">
<img class="h-10 w-10 object-cover rounded-full bg-skin-card-gray ring-8 ring-body" src="{{ $discussion->user->profile_photo_url }}" alt="{{ $discussion->user->name }}">
<span class="absolute top-5 -right-1 bg-skin-body rounded-tl px-0.5 py-px">
<svg class="h-5 w-5 text-skin-muted" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
<path fill-rule="evenodd" d="M12 2.25c-2.429 0-4.817.178-7.152.521C2.87 3.061 1.5 4.795 1.5 6.741v6.018c0 1.946 1.37 3.68 3.348 3.97.877.129 1.761.234 2.652.316V21a.75.75 0 001.28.53l4.184-4.183a.39.39 0 01.266-.112c2.006-.05 3.982-.22 5.922-.506 1.978-.29 3.348-2.023 3.348-3.97V6.741c0-1.947-1.37-3.68-3.348-3.97A49.145 49.145 0 0012 2.25zM8.25 8.625a1.125 1.125 0 100 2.25 1.125 1.125 0 000-2.25zm2.625 1.125a1.125 1.125 0 112.25 0 1.125 1.125 0 01-2.25 0zm4.875-1.125a1.125 1.125 0 100 2.25 1.125 1.125 0 000-2.25z" clip-rule="evenodd" />
</svg>
</span>
</div>
<div class="ml-4 sm:hidden">
<a href="{{ route('profile', $discussion->user->username) }}">
<h4 class="inline-flex items-center text-sm text-skin-inverted font-medium">
{{ $discussion->user->name }}
@if($discussion->user->hasAnyRole('admin', 'moderator'))
<x-user.status />
@endif
</h4>
</a>
<div class="text-sm whitespace-nowrap text-skin-muted font-normal">
<time class="sr-only" datetime="{{ $discussion->created_at->format('Y-m-d') }}">{{ $discussion->created_at->diffForHumans() }}</time>
Crée <time-ago time="{{ $discussion->created_at->getTimestamp() }}"/>
</div>
</div>
</div>
<x-markdown-content class="mt-3 text-sm prose md:prose-lg prose-green text-skin-base mx-auto max-w-none" :content="$discussion->body" />
<div class="mt-3 relative inline-flex">
<livewire:reactions
wire:key="{{ $discussion->id }}"
:model="$discussion"
:with-place-holder="false"
:with-background="false"
/>
</div>
@can(App\Policies\DiscussionPolicy::UPDATE, $discussion)
<div class="mt-2 flex items-center space-x-2">
<a href="{{ route('discussions.edit', $discussion) }}" class="text-sm leading-5 font-sans text-skin-base focus:outline-none hover:underline">{{ __('Éditer') }}</a>
<span class="text-skin-base font-medium">·</span>
<button onclick="Livewire.emit('openModal', 'modals.delete-discussion', {{ json_encode([$discussion->id]) }})" type="button" class="text-sm leading-5 font-sans text-red-500 focus:outline-none hover:underline">{{ __('Supprimer') }}</button>
<div class="min-w-0 flex-1">
<div class="hidden sm:block">
<a href="{{ route('profile', $discussion->user->username) }}">
<h4 class="inline-flex items-center text-sm text-skin-inverted font-medium">
{{ $discussion->user->name }}
@if($discussion->user->hasAnyRole('admin', 'moderator'))
<x-user.status />
@endif
</h4>
</a>
<div class="text-sm whitespace-nowrap text-skin-muted font-normal">
<time class="sr-only" datetime="{{ $discussion->created_at->format('Y-m-d') }}">
{{ $discussion->created_at->diffForHumans() }}
</time>
Crée <time-ago time="{{ $discussion->created_at->getTimestamp() }}"/>
</div>
</div>
@endcan
<x-markdown-content class="mt-3 text-sm prose md:prose-lg prose-green text-skin-base mx-auto max-w-none" :content="$discussion->body" />
<div class="mt-3 relative inline-flex">
<livewire:reactions
wire:key="{{ $discussion->id }}"
:model="$discussion"
:with-place-holder="false"
:with-background="false"
/>
</div>
@can(App\Policies\DiscussionPolicy::UPDATE, $discussion)
<div class="mt-2 flex items-center space-x-2">
<a href="{{ route('discussions.edit', $discussion) }}" class="text-sm leading-5 font-sans text-skin-base focus:outline-none hover:underline">{{ __('Éditer') }}</a>
<span class="text-skin-base font-medium">·</span>
<button onclick="Livewire.emit('openModal', 'modals.delete-discussion', {{ json_encode([$discussion->id]) }})" type="button" class="text-sm leading-5 font-sans text-red-500 focus:outline-none hover:underline">{{ __('Supprimer') }}</button>
</div>
@endcan
</div>
</div>
</div>
</header>
<div class="py-6 flex items-center justify-between">
<p class="text-skin-inverted font-semibold font-sans" id="comments-count">
{{ __('Commentaires (:count)', ['count' => $discussion->count_all_replies_with_child]) }}
</p>
@auth
<livewire:discussions.subscribe :discussion="$discussion" />
@endauth
</div>
</header>
<div class="py-6 flex items-center justify-between">
<p class="text-skin-inverted font-semibold font-sans" id="comments-count">{{ __('Commentaires (:count)', ['count' => $discussion->count_all_replies_with_child]) }}</p>
@auth
<livewire:discussions.subscribe :discussion="$discussion" />
@endauth
</div>

<livewire:discussions.comments :discussion="$discussion" />
</div>
<div class="hidden lg:block lg:col-start-10 lg:col-span-3">
@include('discussions._contributions')
<livewire:discussions.comments :discussion="$discussion" />
</div>
<div class="hidden lg:block lg:col-start-10 lg:col-span-3">
@include('discussions._contributions')
</div>
</div>
</div>
</x-container>

@endsection
</x-app-layout>
Loading

0 comments on commit 6325392

Please sign in to comment.