-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9a30536
commit 5f52e31
Showing
8 changed files
with
169 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
{ | ||
"/js/app.js": "/js/app.js?id=36bfe725c8692a7363939a4c176b4bfd", | ||
"/css/app.css": "/css/app.css?id=d1575ba29784e610931c0de7bf01e362" | ||
"/css/app.css": "/css/app.css?id=df92c9da99f58166339e209103301635" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<div class="card "> | ||
<div class="card-body"> | ||
右边导航栏 | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
@if (count($topics)) | ||
<ul class="list-unstyled"> | ||
@foreach ($topics as $topic) | ||
<li class="d-flex"> | ||
<div class=""> | ||
<a href="{{ route('users.show', [$topic->user_id]) }}"> | ||
<img class="media-object img-thumbnail mr-3" style="width: 52px; height: 52px;" src="{{ $topic->user->avatar }}" title="{{ $topic->user->name }}"> | ||
</a> | ||
</div> | ||
|
||
<div class="flex-grow-1 ms-2"> | ||
|
||
<div class="mt-0 mb-1"> | ||
<a href="{{ route('topics.show', [$topic->id]) }}" title="{{ $topic->title }}"> | ||
{{ $topic->title }} | ||
</a> | ||
<a class="float-end" href="{{ route('topics.show', [$topic->id]) }}"> | ||
<span class="badge bg-secondary rounded-pill"> {{ $topic->reply_count }} </span> | ||
</a> | ||
</div> | ||
|
||
<small class="media-body meta text-secondary"> | ||
|
||
<a class="text-secondary" href="#" title="{{ $topic->category->name }}"> | ||
<i class="far fa-folder"></i> | ||
{{ $topic->category->name }} | ||
</a> | ||
|
||
<span> • </span> | ||
<a class="text-secondary" href="{{ route('users.show', [$topic->user_id]) }}" title="{{ $topic->user->name }}"> | ||
<i class="far fa-user"></i> | ||
{{ $topic->user->name }} | ||
</a> | ||
<span> • </span> | ||
<i class="far fa-clock"></i> | ||
<span class="timeago" title="最后活跃于:{{ $topic->updated_at }}">{{ $topic->updated_at->diffForHumans() }}</span> | ||
</small> | ||
|
||
</div> | ||
</li> | ||
|
||
@if ( ! $loop->last) | ||
<hr> | ||
@endif | ||
|
||
@endforeach | ||
</ul> | ||
|
||
@else | ||
<div class="empty-block">暂无数据 ~_~ </div> | ||
@endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,61 +1,34 @@ | ||
@extends('layouts.app') | ||
|
||
@section('title', '话题列表') | ||
|
||
@section('content') | ||
<div class="container"> | ||
<div class="col-md-10 offset-md-1"> | ||
|
||
<div class="row mb-5"> | ||
<div class="col-lg-9 col-md-9 topic-list"> | ||
<div class="card "> | ||
<div class="card-header"> | ||
<h1> | ||
Topic | ||
<a class="btn btn-success float-xs-right" href="{{ route('topics.create') }}">Create</a> | ||
</h1> | ||
|
||
<div class="card-header bg-transparent"> | ||
<ul class="nav nav-pills"> | ||
<li class="nav-item"><a class="nav-link active" href="#">最后回复</a></li> | ||
<li class="nav-item"><a class="nav-link" href="#">最新发布</a></li> | ||
</ul> | ||
</div> | ||
|
||
<div class="card-body"> | ||
@if($topics->count()) | ||
<table class="table table-sm table-striped"> | ||
<thead> | ||
<tr> | ||
<th class="text-xs-center">#</th> | ||
<th>Title</th> <th>Body</th> <th>User_id</th> <th>Category_id</th> <th>Reply_count</th> <th>View_count</th> <th>Last_reply_user_id</th> <th>Order</th> <th>Excerpt</th> <th>Slug</th> | ||
<th class="text-xs-right">OPTIONS</th> | ||
</tr> | ||
</thead> | ||
|
||
<tbody> | ||
@foreach($topics as $topic) | ||
<tr> | ||
<td class="text-xs-center"><strong>{{$topic->id}}</strong></td> | ||
|
||
<td>{{$topic->title}}</td> <td>{{$topic->body}}</td> <td>{{$topic->user_id}}</td> <td>{{$topic->category_id}}</td> <td>{{$topic->reply_count}}</td> <td>{{$topic->view_count}}</td> <td>{{$topic->last_reply_user_id}}</td> <td>{{$topic->order}}</td> <td>{{$topic->excerpt}}</td> <td>{{$topic->slug}}</td> | ||
|
||
<td class="text-xs-right"> | ||
<a class="btn btn-sm btn-primary" href="{{ route('topics.show', $topic->id) }}"> | ||
V | ||
</a> | ||
|
||
<a class="btn btn-sm btn-warning" href="{{ route('topics.edit', $topic->id) }}"> | ||
E | ||
</a> | ||
|
||
<form action="{{ route('topics.destroy', $topic->id) }}" method="POST" style="display: inline;" onsubmit="return confirm('Delete? Are you sure?');"> | ||
{{csrf_field()}} | ||
<input type="hidden" name="_method" value="DELETE"> | ||
|
||
<button type="submit" class="btn btn-sm btn-danger">D </button> | ||
</form> | ||
</td> | ||
</tr> | ||
@endforeach | ||
</tbody> | ||
</table> | ||
{!! $topics->render() !!} | ||
@else | ||
<h3 class="text-xs-center alert alert-info">Empty!</h3> | ||
@endif | ||
{{-- 话题列表 --}} | ||
@include('topics._topic_list', ['topics' => $topics]) | ||
{{-- 分页 --}} | ||
<div class="mt-5"> | ||
{!! $topics->appends(Request::except('page'))->render() !!} | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<div class="col-lg-3 col-md-3 sidebar"> | ||
@include('topics._sidebar') | ||
</div> | ||
</div> | ||
|
||
@endsection |