Update status views, remove like counts from status embed

pull/2844/head
Daniel Supernault 4 years ago
parent 0e7b2617d4
commit 1a2e41b1e3
No known key found for this signature in database
GPG Key ID: 0DEF1C662C9033F7

@ -2,176 +2,171 @@
<html lang="{{ app()->getLocale() }}"> <html lang="{{ app()->getLocale() }}">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="mobile-web-app-capable" content="yes"> <meta name="mobile-web-app-capable" content="yes">
<title>{{ $title ?? config('app.name', 'Pixelfed') }}</title> <title>{{ $title ?? config('app.name', 'Pixelfed') }}</title>
<meta property="og:site_name" content="{{ config('app.name', 'pixelfed') }}"> <meta property="og:site_name" content="{{ config('app.name', 'pixelfed') }}">
<meta property="og:title" content="{{ $title ?? config('app.name', 'pixelfed') }}"> <meta property="og:title" content="{{ $title ?? config('app.name', 'pixelfed') }}">
<meta property="og:type" content="article"> <meta property="og:type" content="article">
<meta property="og:url" content="{{$status->url()}}"> <meta property="og:url" content="{{$status->url()}}">
<meta name="medium" content="image"> <meta name="medium" content="image">
<meta name="theme-color" content="#10c5f8"> <meta name="theme-color" content="#10c5f8">
<meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-capable" content="yes">
<link rel="shortcut icon" type="image/png" href="/img/favicon.png?v=2"> <link rel="shortcut icon" type="image/png" href="/img/favicon.png?v=2">
<link rel="apple-touch-icon" type="image/png" href="/img/favicon.png?v=2"> <link rel="apple-touch-icon" type="image/png" href="/img/favicon.png?v=2">
<link href="{{ mix('css/app.css') }}" rel="stylesheet"> <link href="{{ mix('css/app.css') }}" rel="stylesheet">
<style type="text/css"> <style type="text/css">
body.embed-card { body.embed-card {
background: #fff !important; background: #fff !important;
margin: 0; margin: 0;
padding-bottom: 0; padding-bottom: 0;
} }
.status-card-embed { .status-card-embed {
box-shadow: none; box-shadow: none;
border-radius: 4px; border-radius: 4px;
overflow: hidden; overflow: hidden;
} }
</style> </style>
</head> </head>
<body class="bg-white"> <body class="bg-white">
<div class="embed-card"> <div class="embed-card">
@php($item = $status) @php($item = $status)
<div class="card status-card-embed card-md-rounded-0 border"> <div class="card status-card-embed card-md-rounded-0 border">
<div class="card-header d-inline-flex align-items-center bg-white"> <div class="card-header d-inline-flex align-items-center bg-white">
<img src="{{$item->profile->avatarUrl()}}" width="32px" height="32px" target="_blank" style="border-radius: 32px;"> <img src="{{$item->profile->avatarUrl()}}" width="32px" height="32px" target="_blank" style="border-radius: 32px;">
<a class="username font-weight-bold pl-2 text-dark" target="_blank" href="{{$item->profile->url()}}"> <a class="username font-weight-bold pl-2 text-dark" target="_blank" href="{{$item->profile->url()}}">
{{$item->profile->username}} {{$item->profile->username}}
</a> </a>
</div> </div>
<a href="{{$status->url()}}" target="_blank"> <a href="{{$status->url()}}" target="_blank">
@php($status = $item) @php($status = $item)
@switch($status->viewType()) @switch($status->viewType())
@case('photo') @case('photo')
@case('image') @case('image')
@if($status->is_nsfw) @if($status->is_nsfw)
<details class="details-animated"> <details class="details-animated">
<summary> <summary>
<p class="mb-0 lead font-weight-bold">CW / NSFW / Hidden Media</p> <p class="mb-0 lead font-weight-bold">CW / NSFW / Hidden Media</p>
<p class="font-weight-light">(click to show)</p> <p class="font-weight-light">(click to show)</p>
</summary> </summary>
<a class="max-hide-overflow {{$status->firstMedia()->filter_class}}" href="{{$status->url()}}" target="_blank"> <a class="max-hide-overflow {{$status->firstMedia()->filter_class}}" href="{{$status->url()}}" target="_blank">
<img class="card-img-top" src="{{$status->mediaUrl()}}"> <img class="card-img-top" src="{{$status->mediaUrl()}}">
</a> </a>
</details> </details>
@else @else
<div class="{{$status->firstMedia()->filter_class}}"> <div class="{{$status->firstMedia()->filter_class}}">
<img src="{{$status->mediaUrl()}}" width="100%"> <img src="{{$status->mediaUrl()}}" width="100%">
</div> </div>
@endif @endif
@break @break
@case('photo:album') @case('photo:album')
<div id="photo-carousel-wrapper-{{$status->id}}" class="carousel slide carousel-fade mb-n3 " data-ride="carousel"> <div id="photo-carousel-wrapper-{{$status->id}}" class="carousel slide carousel-fade mb-n3 " data-ride="carousel">
<ol class="carousel-indicators"> <ol class="carousel-indicators">
@for($i = 0; $i < $status->media_count; $i++) @for($i = 0; $i < $status->media_count; $i++)
<li data-target="#photo-carousel-wrapper-{{$status->id}}" data-slide-to="{{$i}}" class="{{$i == 0 ? 'active' : ''}}"></li> <li data-target="#photo-carousel-wrapper-{{$status->id}}" data-slide-to="{{$i}}" class="{{$i == 0 ? 'active' : ''}}"></li>
@endfor @endfor
</ol> </ol>
<div class="carousel-inner"> <div class="carousel-inner">
@foreach($status->media()->orderBy('order')->get() as $media) @foreach($status->media()->orderBy('order')->get() as $media)
<div class="carousel-item {{$loop->iteration == 1 ? 'active' : ''}}"> <div class="carousel-item {{$loop->iteration == 1 ? 'active' : ''}}">
<figure class="{{$media->filter_class}}"> <figure class="{{$media->filter_class}}">
<div class="float-right mr-3 badge badge-dark border border-secondary rounded-pill p-2" style="position:absolute;top:8px;right:0;margin-bottom:-20px;">{{$loop->iteration}}/{{$loop->count}}</div> <div class="float-right mr-3 badge badge-dark border border-secondary rounded-pill p-2" style="position:absolute;top:8px;right:0;margin-bottom:-20px;">{{$loop->iteration}}/{{$loop->count}}</div>
<img class="d-block w-100" src="{{$media->url()}}" alt="{{$status->caption}}"> <img class="d-block w-100" src="{{$media->url()}}" alt="{{$status->caption}}">
</figure> </figure>
</div> </div>
@endforeach @endforeach
</div> </div>
<a class="carousel-control-prev" href="#photo-carousel-wrapper-{{$status->id}}" role="button" data-slide="prev"> <a class="carousel-control-prev" href="#photo-carousel-wrapper-{{$status->id}}" role="button" data-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span> <span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="sr-only">Previous</span> <span class="sr-only">Previous</span>
</a> </a>
<a class="carousel-control-next" href="#photo-carousel-wrapper-{{$status->id}}" role="button" data-slide="next"> <a class="carousel-control-next" href="#photo-carousel-wrapper-{{$status->id}}" role="button" data-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span> <span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="sr-only">Next</span> <span class="sr-only">Next</span>
</a> </a>
</div> </div>
@break @break
@case('video') @case('video')
@if($status->is_nsfw) @if($status->is_nsfw)
<details class="details-animated"> <details class="details-animated">
<summary> <summary>
<p class="mb-0 lead font-weight-bold">CW / NSFW / Hidden Media</p> <p class="mb-0 lead font-weight-bold">CW / NSFW / Hidden Media</p>
<p class="font-weight-light">(click to show)</p> <p class="font-weight-light">(click to show)</p>
</summary> </summary>
<div class="embed-responsive embed-responsive-16by9"> <div class="embed-responsive embed-responsive-16by9">
<video class="video" preload="none" controls loop> <video class="video" preload="none" controls loop>
<source src="{{$status->firstMedia()->url()}}" type="{{$status->firstMedia()->mime}}"> <source src="{{$status->firstMedia()->url()}}" type="{{$status->firstMedia()->mime}}">
</video> </video>
</div> </div>
</details> </details>
@else @else
<div class="embed-responsive embed-responsive-16by9"> <div class="embed-responsive embed-responsive-16by9">
<video class="video" preload="none" controls loop> <video class="video" preload="none" controls loop>
<source src="{{$status->firstMedia()->url()}}" type="{{$status->firstMedia()->mime}}"> <source src="{{$status->firstMedia()->url()}}" type="{{$status->firstMedia()->mime}}">
</video> </video>
</div> </div>
@endif @endif
@break @break
@case('video-album') @case('video-album')
@if($status->is_nsfw) @if($status->is_nsfw)
<details class="details-animated"> <details class="details-animated">
<summary> <summary>
<p class="mb-0 lead font-weight-bold">CW / NSFW / Hidden Media</p> <p class="mb-0 lead font-weight-bold">CW / NSFW / Hidden Media</p>
<p class="font-weight-light">(click to show)</p> <p class="font-weight-light">(click to show)</p>
</summary> </summary>
<div class="embed-responsive embed-responsive-16by9"> <div class="embed-responsive embed-responsive-16by9">
<video class="video" preload="none" controls loop> <video class="video" preload="none" controls loop>
<source src="{{$status->firstMedia()->url()}}" type="{{$status->firstMedia()->mime}}"> <source src="{{$status->firstMedia()->url()}}" type="{{$status->firstMedia()->mime}}">
</video> </video>
</div> </div>
</details> </details>
@else @else
<div class="embed-responsive embed-responsive-16by9"> <div class="embed-responsive embed-responsive-16by9">
<video class="video" preload="none" controls loop> <video class="video" preload="none" controls loop>
<source src="{{$status->firstMedia()->url()}}" type="{{$status->firstMedia()->mime}}"> <source src="{{$status->firstMedia()->url()}}" type="{{$status->firstMedia()->mime}}">
</video> </video>
</div> </div>
@endif @endif
@break @break
@endswitch @endswitch
</a> </a>
@if($layout != 'compact') @if($layout != 'compact')
<div class="card-body"> <div class="card-body">
<div class="view-more mb-2"> <div class="view-more mb-2">
<a class="font-weight-bold" href="{{$status->url()}}" target="_blank">View More on Pixelfed</a> <a class="font-weight-bold" href="{{$status->url()}}" target="_blank">View More on Pixelfed</a>
</div> </div>
<hr> <hr>
@if($showLikes) <div class="caption">
<div class="likes font-weight-bold pb-2"> <p class="my-0">
<span class="like-count">{{$item->likes_count}}</span> likes <span class="username font-weight-bold">
</div> <bdi><a class="text-dark" href="{{$item->profile->url()}}" target="_blank">{{$item->profile->username}}</a></bdi>
@endif </span>
<div class="caption"> @if($showCaption)
<p class="my-0"> <span class="caption-container">{!! $item->rendered ?? e($item->caption) !!}</span>
<span class="username font-weight-bold"> @endif
<bdi><a class="text-dark" href="{{$item->profile->url()}}" target="_blank">{{$item->profile->username}}</a></bdi> </p>
</span> </div>
@if($showCaption) </div>
<span class="caption-container">{!! $item->rendered ?? e($item->caption) !!}</span> @endif
@endif <div class="card-footer bg-white d-inline-flex justify-content-between align-items-center">
</p> <div class="timestamp">
</div> <p class="small text-uppercase mb-0"><a href="{{$item->url()}}" class="text-muted" target="_blank">{{$item->created_at->diffForHumans()}}</a></p>
</div> </div>
@endif <div>
<div class="card-footer bg-white d-inline-flex justify-content-between align-items-center"> <a class="small font-weight-bold text-muted pr-1" href="{{config('app.url')}}" target="_blank">{{config('pixelfed.domain.app')}}</a>
<div class="timestamp"> <img src="/img/pixelfed-icon-color.svg" width="26px">
<p class="small text-uppercase mb-0"><a href="{{$item->url()}}" class="text-muted" target="_blank">{{$item->created_at->diffForHumans()}}</a></p> </div>
</div> </div>
<div> </div>
<a class="small font-weight-bold text-muted pr-1" href="{{config('app.url')}}" target="_blank">{{config('pixelfed.domain.app')}}</a> </div>
<img src="/img/pixelfed-icon-color.svg" width="26px"> <script type="text/javascript">window.addEventListener("message",e=>{const t=e.data||{};window.parent&&"setHeight"===t.type&&window.parent.postMessage({type:"setHeight",id:t.id,height:document.getElementsByTagName("html")[0].scrollHeight},"*")});</script>
</div> <script type="text/javascript">document.querySelectorAll('.caption-container a').forEach(function(i) {i.setAttribute('target', '_blank');});</script>
</div> <script type="text/javascript" src="{{ mix('js/manifest.js') }}"></script>
</div> <script type="text/javascript" src="{{ mix('js/vendor.js') }}"></script>
</div> <script type="text/javascript" src="{{ mix('js/app.js') }}"></script>
<script type="text/javascript">window.addEventListener("message",e=>{const t=e.data||{};window.parent&&"setHeight"===t.type&&window.parent.postMessage({type:"setHeight",id:t.id,height:document.getElementsByTagName("html")[0].scrollHeight},"*")});</script>
<script type="text/javascript">document.querySelectorAll('.caption-container a').forEach(function(i) {i.setAttribute('target', '_blank');});</script>
<script type="text/javascript" src="{{ mix('js/manifest.js') }}"></script>
<script type="text/javascript" src="{{ mix('js/vendor.js') }}"></script>
<script type="text/javascript" src="{{ mix('js/app.js') }}"></script>
</body> </body>
</html> </html>

@ -25,11 +25,5 @@
@push('scripts') @push('scripts')
<script type="text/javascript" src="{{ mix('js/status.js') }}"></script> <script type="text/javascript" src="{{ mix('js/status.js') }}"></script>
<script type="text/javascript"> <script type="text/javascript">App.boot();</script>
$(document).ready(function() {
new Vue({
el: '#content'
});
});
</script>
@endpush @endpush

Loading…
Cancel
Save