blessing-skin-server/resources/views/admin/players.tpl

167 lines
7.2 KiB
PHP
Raw Normal View History

2016-07-23 15:20:10 +08:00
@extends('admin.master')
2016-09-25 10:02:40 +08:00
@section('title', trans('general.player-manage'))
2016-07-23 15:20:10 +08:00
@section('content')
<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1>
@if (isset($_GET['q']))
搜索结果:{{ $_GET['q'] }}
@else
2016-09-25 10:02:40 +08:00
{{ trans('general.player-manage') }}
2016-07-23 15:20:10 +08:00
@endif
<small>Player Management</small>
2016-09-10 17:02:47 +08:00
<!-- Search Form -->
2016-07-23 15:20:10 +08:00
<form method="get" action="" class="user-search-form">
<input type="text" name="q" class="form-control user-search-input" placeholder="输入,回车搜索。" value="{{ $q }}">
<select name="filter" class="form-control pull-right user-search-input">
<option value='uid' selected="{{ $filter == 'nickname' ? 'selected' : '' }}">根据角色拥有者搜索</option>
<option value='player_name' selected="{{ $filter == 'email' ? 'selected' : '' }}">搜索角色名</option>
2016-07-23 15:20:10 +08:00
</select>
</form>
</h1>
</section>
<!-- Main content -->
<section class="content">
<div class="box">
<div class="box-body table-responsive no-padding">
<table class="table table-hover">
<thead>
<tr>
<th>PID</th>
<th>拥有者 UID</th>
<th>角色名</th>
<th>优先模型</th>
<th>预览材质</th>
<th>修改时间</th>
<th>操作</th>
</tr>
</thead>
<tbody>
@forelse($players as $player)
<tr id="{{ $player->pid }}">
<td>{{ $player->pid }}</td>
<td><a href="?filter=uid&q={{ $player->uid }}">{{ $player->uid }}</a></td>
<td id="player-name">{{ $player->player_name }}</td>
<td>
<select class="form-control" id="preference">
2016-07-23 21:46:20 +08:00
<option {{ ($player->preference == "default") ? 'selected=selected' : '' }} value="default">Default</option>
<option {{ ($player->preference == "slim") ? 'selected=selected' : '' }} value="slim">Slim</option>
2016-07-23 15:20:10 +08:00
</select>
</td>
<td>
@if ($player->tid_steve == '0')
<img id="{{ $player->pid }}-steve" width="64" />
@else
2016-09-10 17:02:47 +08:00
<a href="{{ url('skinlib/show?tid='.$player->tid_steve) }}">
<img id="{{ $player->pid }}-steve" width="64" src="{{ url('preview/64/'.$player->tid_steve) }}.png" />
2016-07-23 15:20:10 +08:00
</a>
@endif
@if ($player->tid_alex == '0')
<img id="{{ $player->pid }}-alex" width="64" />
@else
2016-09-10 17:02:47 +08:00
<a href="{{ url('skinlib/show?tid='.$player->tid_alex) }}">
<img id="{{ $player->pid }}-alex" width="64" src="{{ url('preview/64/'.$player->tid_alex) }}.png" />
2016-07-23 15:20:10 +08:00
</a>
@endif
@if ($player->tid_cape == '0')
<img id="{{ $player->pid }}-cape" width="64" />
@else
2016-09-10 17:02:47 +08:00
<a href="{{ url('skinlib/show?tid='.$player->tid_cape) }}">
<img id="{{ $player->pid }}-cape" width="64" src="{{ url('preview/64/'.$player->tid_cape) }}.png" />
2016-07-23 15:20:10 +08:00
</a>
@endif
</td>
<td>{{ $player->last_modified }}</td>
<td>
<div class="btn-group">
<button type="button" class="btn btn-sm btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
更多操作 <span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li><a href="javascript:changeTexture('{{ $player->pid }}');">更换材质</a></li>
<li><a href="javascript:changeOwner('{{ $player->pid }}');">更换角色拥有者</a></li>
</ul>
</div>
<a class="btn btn-danger btn-sm" href="javascript:deletePlayer('{{ $player->pid }}');">删除角色</a>
</td>
</tr>
@empty
<tr>
<td>0</td>
<td>无结果</td>
<td>(´・ω・`)</td>
</tr>
@endforelse
</tbody>
</table>
</div>
<div class="box-footer">
<!-- Pagination -->
<ul class="pagination pagination-sm no-margin pull-right">
<?php $base_url = ($filter != "" && $q != "") ? "?filter=$filter&q=$q&" : "?"; ?>
<li><a href="?page=1">«</a></li>
@if ($page != 1)
<li><a href="{{ $base_url }}page={{ $page-1 }}">{{ $page - 1 }}</a></li>
@endif
<li><a href="{{ $base_url }}page={{ $page }}" class="active">{{ $page }}</a></li>
@if ($total_pages > $page)
<li><a href="{{ $base_url }}page={{ $page+1 }}">{{ $page+1 }}</a></li>
@endif
<li><a href="{{ $base_url }}page={{ $total_pages }}">»</a></li>
</ul>
<select id="page-select" class="pull-right">
@for ($i = 1; $i <= $total_pages; $i++)
@if ($i == $page)
<option value='{{ $i }}' selected="selected">{{ $i }}</option>
@else
<option value='{{ $i }}'>{{ $i }}</option>
@endif
@endfor
</select>
<p class="pull-right"> {{ $page }} 页,共 {{ $total_pages }} </p>
</div>
</div>
</section><!-- /.content -->
</div><!-- /.content-wrapper -->
@endsection
@section('style')
<style>
@media (max-width: 767px) {
.content-header > h1 > small {
display: none;
}
}
</style>
@endsection
@section('script')
<script type="text/javascript">
$(document).ready(function() {
$('.box-body').css('min-height', $('.content-wrapper').height() - $('.content-header').outerHeight() - 120);
});
</script>
@endsection