非公開アカウント対応

This commit is contained in:
shibafu 2017-11-05 21:59:01 +09:00
parent d0c9e3a3af
commit 7e9501ab9d
5 changed files with 114 additions and 81 deletions

View File

@ -1,23 +1,32 @@
<div class="card mb-4"> <div class="card mb-4">
<div class="card-body"> <div class="card-body">
<img src="{{ $user->getProfileImageUrl(64) }}" class="rounded mb-1"> <img src="{{ $user->getProfileImageUrl(64) }}" class="rounded mb-1">
<h4 class="card-title"><a class="text-dark" href="{{ route('user.profile', ['name' => $user->name]) }}">{{ $user->display_name }}</a></h4> <h4 class="card-title">
<h6 class="card-subtitle mb-4"><a class="text-muted" href="{{ route('user.profile', ['name' => $user->name]) }}">&commat;{{ $user->name }}</a></h6> <a class="text-dark" href="{{ route('user.profile', ['name' => $user->name]) }}">{{ $user->display_name }}</a>
</h4>
<h6 class="card-subtitle">
<a class="text-muted" href="{{ route('user.profile', ['name' => $user->name]) }}">&commat;{{ $user->name }}</a>
@if ($user->is_protected)
<span class="oi oi-lock-locked text-muted"></span>
@endif
</h6>
<h6 class="font-weight-bold"><span class="oi oi-timer"></span> 現在のセッション</h6> @if (!$user->is_protected)
@if (isset($currentSession)) <h6 class="font-weight-bold mt-4"><span class="oi oi-timer"></span> 現在のセッション</h6>
<p class="card-text mb-0">{{ $currentSession }}経過</p> @if (isset($currentSession))
<p class="card-text">({{ $latestEjaculation->ejaculated_date->format('Y/m/d H:i') }} にリセット)</p> <p class="card-text mb-0">{{ $currentSession }}経過</p>
@else <p class="card-text">({{ $latestEjaculation->ejaculated_date->format('Y/m/d H:i') }} にリセット)</p>
<p class="card-text mb-0">計測がまだ始まっていません</p> @else
<p class="card-text">(一度チェックインすると始まります)</p> <p class="card-text mb-0">計測がまだ始まっていません</p>
<p class="card-text">(一度チェックインすると始まります)</p>
@endif
<h6 class="font-weight-bold"><span class="oi oi-graph"></span> 概況</h6>
<p class="card-text mb-0">平均記録: {{ Formatter::formatInterval($summary[0]->average) }}</p>
<p class="card-text mb-0">最長記録: {{ Formatter::formatInterval($summary[0]->longest) }}</p>
<p class="card-text mb-0">最短記録: {{ Formatter::formatInterval($summary[0]->shortest) }}</p>
<p class="card-text mb-0">合計時間: {{ Formatter::formatInterval($summary[0]->total_times) }}</p>
<p class="card-text">通算回数: {{ $summary[0]->total_checkins }}</p>
@endif @endif
<h6 class="font-weight-bold"><span class="oi oi-graph"></span> 概況</h6>
<p class="card-text mb-0">平均記録: {{ Formatter::formatInterval($summary[0]->average) }}</p>
<p class="card-text mb-0">最長記録: {{ Formatter::formatInterval($summary[0]->longest) }}</p>
<p class="card-text mb-0">最短記録: {{ Formatter::formatInterval($summary[0]->shortest) }}</p>
<p class="card-text mb-0">合計時間: {{ Formatter::formatInterval($summary[0]->total_times) }}</p>
<p class="card-text">通算回数: {{ $summary[0]->total_checkins }}</p>
</div> </div>
</div> </div>

View File

@ -8,7 +8,13 @@
@endcomponent @endcomponent
</div> </div>
<div class="col-lg-8"> <div class="col-lg-8">
@if ($ejaculation->is_private && !(Auth::check() && $user->id === Auth::user()->id)) @if ($user->is_protected && !(Auth::check() && $user->id === Auth::user()->id))
<div class="card">
<div class="card-body">
<span class="oi oi-lock-locked"></span> このユーザはチェックイン履歴を公開していません。
</div>
</div>
@elseif ($ejaculation->is_private && !(Auth::check() && $user->id === Auth::user()->id))
<div class="card"> <div class="card">
<div class="card-body"> <div class="card-body">
<span class="oi oi-lock-locked"></span> 非公開チェックインのため、表示できません <span class="oi oi-lock-locked"></span> 非公開チェックインのため、表示できません

View File

@ -1,4 +1,10 @@
@extends('user.base') @extends('user.base')
@section('tab-content') @section('tab-content')
@if ($user->is_protected && !(Auth::check() && $user->id === Auth::user()->id))
<p class="mt-4">
<span class="oi oi-lock-locked"></span> このユーザはチェックイン履歴を公開していません。
</p>
@else
@endif
@endsection @endsection

View File

@ -1,73 +1,79 @@
@extends('user.base') @extends('user.base')
@section('tab-content') @section('tab-content')
<ul class="list-group"> @if ($user->is_protected && !(Auth::check() && $user->id === Auth::user()->id))
@forelse ($ejaculations as $ejaculation) <p class="mt-4">
<li class="list-group-item border-bottom-only pt-3 pb-3"> <span class="oi oi-lock-locked"></span> このユーザはチェックイン履歴を公開していません。
<!-- span --> </p>
<div class="d-flex justify-content-between"> @else
<h5>{{ $ejaculation->ejaculated_span ?? '精通' }} <a href="{{ route('checkin.show', ['id' => $ejaculation->id]) }}" class="text-muted"><small>{{ $ejaculation->before_date }}{{ !empty($ejaculation->before_date) ? ' ' : '' }}{{ $ejaculation->ejaculated_date->format('Y/m/d H:i') }}</small></a></h5> <ul class="list-group">
@if (Auth::check() && $user->id === Auth::user()->id) @forelse ($ejaculations as $ejaculation)
<div> <li class="list-group-item border-bottom-only pt-3 pb-3">
<a class="text-secondary timeline-action-item" href="#"><span class="oi oi-pencil" data-toggle="tooltip" data-placement="bottom" title="修正"></span></a> <!-- span -->
<a class="text-secondary timeline-action-item" href="#" data-toggle="modal" data-target="#deleteCheckinModal" data-id="{{ $ejaculation->id }}" data-date="{{ $ejaculation->ejaculated_date }}"><span class="oi oi-trash" data-toggle="tooltip" data-placement="bottom" title="削除"></span></a> <div class="d-flex justify-content-between">
</div> <h5>{{ $ejaculation->ejaculated_span ?? '精通' }} <a href="{{ route('checkin.show', ['id' => $ejaculation->id]) }}" class="text-muted"><small>{{ $ejaculation->before_date }}{{ !empty($ejaculation->before_date) ? ' ' : '' }}{{ $ejaculation->ejaculated_date->format('Y/m/d H:i') }}</small></a></h5>
@endif @if (Auth::check() && $user->id === Auth::user()->id)
</div> <div>
<!-- tags --> <a class="text-secondary timeline-action-item" href="#"><span class="oi oi-pencil" data-toggle="tooltip" data-placement="bottom" title="修正"></span></a>
@if ($ejaculation->is_private) {{-- TODO: タグを付けたら、タグが空じゃないかも判定に加える --}} <a class="text-secondary timeline-action-item" href="#" data-toggle="modal" data-target="#deleteCheckinModal" data-id="{{ $ejaculation->id }}" data-date="{{ $ejaculation->ejaculated_date }}"><span class="oi oi-trash" data-toggle="tooltip" data-placement="bottom" title="削除"></span></a>
<p class="mb-2">
@if ($ejaculation->is_private)
<span class="badge badge-warning"><span class="oi oi-lock-locked"></span> 非公開</span>
@endif
{{--
<span class="badge badge-secondary"><span class="oi oi-tag"></span> 催眠音声</span>
<span class="badge badge-secondary"><span class="oi oi-tag"></span> 適当なタグ</span>
--}}
</p>
@endif
<!-- okazu link -->
{{--
<div class="card mb-2 w-50" style="font-size: small;">
<a class="text-dark card-link" href="#">
<img src="holder.js/320x240" alt="Thumbnail" class="card-img-top">
<div class="card-body">
<h6 class="card-title">タイトル</h6>
<p class="card-text">コンテンツの説明文</p>
</div> </div>
</a> @endif
</div> </div>
--}} <!-- tags -->
<!-- note --> @if ($ejaculation->is_private) {{-- TODO: タグを付けたら、タグが空じゃないかも判定に加える --}}
@if (!empty($ejaculation->note)) <p class="mb-2">
<p class="mb-0 tis-word-wrap"> @if ($ejaculation->is_private)
{!! Formatter::linkify(nl2br(e($ejaculation->note))) !!} <span class="badge badge-warning"><span class="oi oi-lock-locked"></span> 非公開</span>
</p> @endif
@endif {{--
<span class="badge badge-secondary"><span class="oi oi-tag"></span> 催眠音声</span>
<span class="badge badge-secondary"><span class="oi oi-tag"></span> 適当なタグ</span>
--}}
</p>
@endif
<!-- okazu link -->
{{--
<div class="card mb-2 w-50" style="font-size: small;">
<a class="text-dark card-link" href="#">
<img src="holder.js/320x240" alt="Thumbnail" class="card-img-top">
<div class="card-body">
<h6 class="card-title">タイトル</h6>
<p class="card-text">コンテンツの説明文</p>
</div>
</a>
</div>
--}}
<!-- note -->
@if (!empty($ejaculation->note))
<p class="mb-0 tis-word-wrap">
{!! Formatter::linkify(nl2br(e($ejaculation->note))) !!}
</p>
@endif
</li>
@empty
<li class="list-group-item border-bottom-only">
<p>まだチェックインしていません。</p>
</li>
@endforelse
</ul>
<ul class="pagination mt-4 justify-content-center">
<li class="page-item {{ $ejaculations->currentPage() === 1 ? 'disabled' : '' }}">
<a class="page-link" href="{{ $ejaculations->previousPageUrl() }}" aria-label="Previous">
<span aria-hidden="true">&laquo;</span>
<span class="sr-only">Previous</span>
</a>
</li> </li>
@empty @for ($i = 1; $i <= $ejaculations->lastPage(); $i++)
<li class="list-group-item border-bottom-only"> <li class="page-item {{ $i === $ejaculations->currentPage() ? 'active' : '' }}"><a href="{{ $ejaculations->url($i) }}" class="page-link">{{ $i }}</a></li>
<p>まだチェックインしていません。</p> @endfor
<li class="page-item {{ $ejaculations->currentPage() === $ejaculations->lastPage() ? 'disabled' : '' }}">
<a class="page-link" href="{{ $ejaculations->nextPageUrl() }}" aria-label="Next">
<span aria-hidden="true">&raquo;</span>
<span class="sr-only">Next</span>
</a>
</li> </li>
@endforelse </ul>
</ul> @endif
<ul class="pagination mt-4 justify-content-center">
<li class="page-item {{ $ejaculations->currentPage() === 1 ? 'disabled' : '' }}">
<a class="page-link" href="{{ $ejaculations->previousPageUrl() }}" aria-label="Previous">
<span aria-hidden="true">&laquo;</span>
<span class="sr-only">Previous</span>
</a>
</li>
@for ($i = 1; $i <= $ejaculations->lastPage(); $i++)
<li class="page-item {{ $i === $ejaculations->currentPage() ? 'active' : '' }}"><a href="{{ $ejaculations->url($i) }}" class="page-link">{{ $i }}</a></li>
@endfor
<li class="page-item {{ $ejaculations->currentPage() === $ejaculations->lastPage() ? 'disabled' : '' }}">
<a class="page-link" href="{{ $ejaculations->nextPageUrl() }}" aria-label="Next">
<span aria-hidden="true">&raquo;</span>
<span class="sr-only">Next</span>
</a>
</li>
</ul>
@component('components.modal', ['id' => 'deleteCheckinModal']) @component('components.modal', ['id' => 'deleteCheckinModal'])
@slot('title') @slot('title')

View File

@ -1,4 +1,10 @@
@extends('user.base') @extends('user.base')
@section('tab-content') @section('tab-content')
@if ($user->is_protected && !(Auth::check() && $user->id === Auth::user()->id))
<p class="mt-4">
<span class="oi oi-lock-locked"></span> このユーザはチェックイン履歴を公開していません。
</p>
@else
@endif
@endsection @endsection