journal-intime/resources/views/home.blade.php

129 lines
5.1 KiB
PHP

@extends('layouts.connected')
@inject('tag_detector', 'App\Services\TagDetectorService)
@section('content')
<div class="container">
<div class="page-header">
<h1 class="page-title">
{{ __('Dashboard') }}
</h1>
@if (session('status'))
<div class="alert alert-success" role="alert">
{{ session('status') }}
</div>
@endif
</div>
<div class="row flex-fill">
<div class="col-sm-6 col-lg-3">
<div class="card p-3">
<div class="d-flex align-items-center">
<span class="stamp stamp-md bg-blue mr-3">
<i class="fe fe-activity"></i>
</span>
<div>
<h4 class="m-0">{{ $all_counts }}</h4>
<small class="text-muted">{{ __('Jours Écrits') }}</small>
</div>
</div>
</div>
</div>
<div class="col-sm-6 col-lg-3">
<div class="card p-3">
<div class="d-flex align-items-center">
<span class="stamp stamp-md bg-green mr-3">
<i class="fe fe-calendar"></i>
</span>
<div>
<h4 class="m-0">{{ $year_counts }}</h4>
<small class="text-muted">{{ __('Cette Année') }}</small>
</div>
</div>
</div>
</div>
<div class="col-sm-6 col-lg-3">
<div class="card p-3">
<div class="d-flex align-items-center">
<span class="stamp stamp-md bg-red mr-3">
<i class="fe fe-grid"></i>
</span>
<div>
<h4 class="m-0">{{ $month_counts }}</h4>
<small class="text-muted">{{ __('Ce Mois') }}</small>
</div>
</div>
</div>
</div>
<div class="col-sm-6 col-lg-3">
<div class="card p-3">
<div class="d-flex align-items-center">
<span class="stamp stamp-md bg-yellow mr-3">
<i class="fe fe-image"></i>
</span>
<div>
<h4 class="m-0">{{ $image_counts }}</h4>
<small class="text-muted">{{ __('Images Envoyées') }}</small>
</div>
</div>
</div>
</div>
<div class="col-md-12">
@if($already)
<div class="alert alert-primary">L'activité du jour a déjà été entrée.</div>
<div id="store">
@component('components/app', [
'route' => url('store'),
'crsf' => csrf_field(),
'mustencrypt' => $must_encrypt,
'possible' => false,
])
@endcomponent
</div>
@else
<div class="row">
<div class="col-sm-12">
<div class="card">
<div class="card-header">
<h3 class="card-title">{{ strftime('%B %G', $today->format('U')) }}</h3>
</div>
<div class="card-body">
<div id="store">
@component('components/app', [
'route' => url('store'),
'crsf' => csrf_field(),
'mustencrypt' => $must_encrypt,
'possible' => !$already,
])
@endcomponent
</div>
</div>
</div>
</div>
</div>
@endif
</div>
@foreach($posts as $post)
<div class="col-md-6 col-xl-4">
<div class="card">
<div class="card-status bg-blue"></div>
<div class="card-header">
<h3 class="card-title">{{ ucfirst(\Carbon\Carbon::instance($post->date_post)->diffForHumans()) }}</h3>
<div class="card-options">
<a href="#" class="card-options-collapse" data-toggle="card-collapse"><i class="fe fe-chevron-up"></i></a>
<a href="#" class="card-options-remove" data-toggle="card-remove"><i class="fe fe-x"></i></a>
</div>
</div>
<div class="card-body" data-encrypt>
{!! $tag_detector->linkTagFrom($post->content) !!}
</div>
<div class="card-footer">
{{ \Carbon\Carbon::instance($post->date_post)->format('d F Y') }}
</div>
</div>
</div>
@endforeach
</div>
</div>
@endsection