laravel-learn-bbs/resources/views/users/show.blade.php

62 lines
2.6 KiB
PHP
Raw Permalink Normal View History

2017-12-30 20:23:09 +00:00
@extends('layouts.app')
@section('title', $user->name . ' 的个人中心')
@section('content')
<div class="row">
<div class="col-lg-3 col-md-3 hidden-sm hidden-xs user-info">
<div class="panel panel-default">
<div class="panel-body">
<div class="media">
<div align="center">
<img class="thumbnail img-responsive" src="{{$user->header}}" width="300px" height="300px">
</div>
<div class="media-body">
<hr>
<h4><strong>个人简介</strong></h4>
<p>{{ $user->introduction }}</p>
<hr>
<h4><strong>注册于</strong></h4>
<p>{{ $user->created_at->diffForHumans() }}</p>
<h4><strong>最后活跃</strong></h4>
<p title="{{ $user->last_actived_at }}">{{ $user->last_active_at->diffForHumans() }}</p>
2017-12-30 20:23:09 +00:00
</div>
</div>
</div>
</div>
</div>
<div class="col-lg-9 col-md-9 col-sm-12 col-xs-12">
<div class="panel panel-default">
<div class="panel-body">
<span>
<h1 class="panel-title pull-left" style="font-size:30px;">{{ $user->name }}
<small>{{ $user->email }}</small></h1>
</span>
</div>
</div>
<hr>
{{-- 用户发布的内容 --}}
<div class="panel panel-default">
<div class="panel-body">
2018-01-01 07:32:35 +00:00
<ul class="nav nav-tabs">
2018-01-15 15:24:11 +00:00
<li class="{{ active_class(if_query('tab', null)) }}">
<a href="{{ route('users.show', $user->id) }}">Ta 的话题</a>
</li>
<li class="{{ active_class(if_query('tab', 'replies')) }}">
<a href="{{ route('users.show', [$user->id, 'tab' => 'replies']) }}">Ta 的回复</a>
</li>
2018-01-01 07:32:35 +00:00
</ul>
2018-01-15 15:24:11 +00:00
@if(if_query('tab','replies'))
@include('users._replies', ['replies' => $user->replies()->recent()->paginate(5)])
@else
@include('users._topics', ['topics' => $user->topics()->recent()->paginate(5)])
@endif
2017-12-30 20:23:09 +00:00
</div>
</div>
</div>
</div>
@stop