@extends('layouts.app') @section('page_title') {{ $book->title }} by @if($book->authors && $book->authors->count()) {{ $book->authors->pluck('name')->join(', ') }} @elseif($book->author) {{ $book->author }} @endif - Summary by OpenTextSummaries @endsection @section('meta_description') @php $raw = ''; if ($book->summary && $book->summary->content) { $raw = strip_tags($book->summary->content); } elseif (!empty($book->description)) { $raw = strip_tags($book->description); } else { $authorNames = ''; if ($book->authors && $book->authors->count()) { $authorNames = $book->authors->pluck('name')->join(', '); } elseif (!empty($book->author)) { $authorNames = $book->author; } $raw = trim($book->title . ($authorNames ? ' by ' . $authorNames : '') . ' — summary and key insights.'); } $desc = \Illuminate\Support\Str::limit(preg_replace('/\s+/', ' ', $raw), 160, '…'); @endphp {{ $desc }} @endsection @section('content')
@if($book->cover_image) {{ $book->title }} cover @endif

{{ $book->title }}

@if($book->authors && $book->authors->count()) {{ $book->authors->pluck('name')->join(', ') }} @elseif($book->author) {{ $book->author }} @endif

@if($book->category)

Category: {{ $book->category->name }}

@endif @if($book->publication_date)

Published: {{ $book->publication_date }}

@endif @if($book->description)
{!! nl2br(e($book->description)) !!}
@endif @auth
@php($inReadlist = auth()->user()->readlistBooks()->where('book_id', $book->id)->exists()) @if(!$inReadlist)
@csrf
@else
@csrf @method('DELETE')
@endif
@endauth
@if (session('success'))
{{ session('success') }}
@endif @if ($errors->any())
    @foreach ($errors->all() as $error)
  • {{ $error }}
  • @endforeach
@endif

Summary

@if($book->summary)
{!! nl2br(e($book->summary->content)) !!}
@if($book->summary->key_insights)

Key insights

{!! nl2br(e($book->summary->key_insights)) !!}

@endif @else

No summary available for this book yet.

@auth @else

Want one? Log in to request a summary.

@endauth @endif
@include('layouts.donate_widget')

Is this summary inaccurate?

@auth
@csrf
@else

Please log in to report issues with this summary.

@endauth

Reviews

@for($i=1;$i<=5;$i++) @endfor
{{ $avgRating > 0 ? number_format($avgRating, 1) : 'No ratings yet' }} @if($reviewsCount) • {{ $reviewsCount }} {{ Str::plural('review', $reviewsCount) }} @endif
@auth

{{ $userReview ? 'Update your review' : 'Leave a review' }}

@csrf
@if($userReview)
@csrf @method('DELETE')
@endif
@else

Please log in to leave a review.

@endauth @if($book->reviews->count()) @else

No reviews yet. Be the first to review this summary.

@endif
@endsection