blessing-skin-server/resources/views/user/player.tpl

161 lines
8.2 KiB
PHP
Raw Normal View History

2016-07-21 22:01:57 +08:00
@extends('user.master')
2016-09-15 23:03:58 +08:00
@section('title', trans('general.player-manage'))
2016-07-21 22:01:57 +08:00
@section('content')
<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1>
2016-09-15 23:03:58 +08:00
{{ trans('general.player-manage') }}
2016-07-21 22:01:57 +08:00
</h1>
</section>
<!-- Main content -->
<section class="content">
<div class="row">
<div class="col-md-6">
<div class="box box-primary">
<div class="box-body table-responsive no-padding">
<table class="table table-hover">
<thead>
<tr>
<th>PID</th>
2016-09-15 23:03:58 +08:00
<th>{{ trans('user.player.player-name') }}</th>
2016-10-23 11:41:52 +08:00
<th>{{ trans('user.player.preference.title') }}</th>
2016-09-15 23:03:58 +08:00
<th>{{ trans('user.player.edit') }}</th>
<th>{{ trans('user.player.operation') }}</th>
2016-07-21 22:01:57 +08:00
</tr>
</thead>
<tbody>
@foreach ($players as $player)
<tr class="player" id="{{ $player['pid'] }}">
2016-12-17 18:07:29 +08:00
<td class="pid">{{ $player['pid'] }}</td>
<td class="player-name">{{ $player['player_name'] }}</td>
2016-07-21 22:01:57 +08:00
<td>
<select class="form-control" id="preference" pid="{{ $player['pid'] }}">
<option {{ ($player['preference'] == "default") ? 'selected="selected"' : '' }} value="default">Default</option>
<option {{ ($player['preference'] == "slim") ? 'selected="selected"' : '' }} value="slim">Slim</option>
</select>
</td>
<td>
<a class="btn btn-default btn-sm" onclick="changePlayerName('{{ $player['pid'] }}', '{{ $player['player_name'] }}')">{{ trans('user.player.edit-pname') }}</a>
2016-07-21 22:01:57 +08:00
</td>
<td>
<a class="btn btn-warning btn-sm" onclick="clearTexture('{{ $player['pid'] }}');">{{ trans('user.player.delete-texture') }}</a>
<a class="btn btn-danger btn-sm" onclick="deletePlayer('{{ $player['pid'] }}');">{{ trans('user.player.delete-player') }}</a>
2016-07-21 22:01:57 +08:00
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
<div class="box-footer clearfix">
<button class="btn btn-primary pull-left" data-toggle="modal" data-target="#modal-add-player">
2016-09-15 23:03:58 +08:00
<i class="fa fa-plus" aria-hidden="true"></i> &nbsp;{{ trans('user.player.add-player') }}
2016-07-21 22:01:57 +08:00
</button>
</div>
</div>
2016-08-17 17:00:52 +08:00
<div class="box box-default collapsed-box">
<div class="box-header with-border">
2016-09-15 23:03:58 +08:00
<h3 class="box-title">{{ trans('general.notice') }}</h3>
2016-08-17 17:00:52 +08:00
<div class="box-tools pull-right">
<button class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-plus"></i></button>
</div><!-- /.box-tools -->
</div><!-- /.box-header -->
<div class="box-body">
2016-09-15 23:03:58 +08:00
<p>{{ trans('user.player.login-notice') }}</p>
2016-08-17 17:00:52 +08:00
</div><!-- /.box-body -->
</div><!-- /.box -->
2016-07-21 22:01:57 +08:00
</div>
<div class="col-md-6">
<div class="box">
<div class="box-header with-border">
2016-09-15 23:03:58 +08:00
<h3 class="box-title" style="width: 100%;">{!! trans('user.player.player-info') !!}
2016-07-21 22:01:57 +08:00
<div class="operations">
2016-09-15 23:03:58 +08:00
<i data-toggle="tooltip" data-placement="bottom" title="{{ trans('general.walk') }}" class="fa fa-pause"></i>
<i data-toggle="tooltip" data-placement="bottom" title="{{ trans('general.run') }}" class="fa fa-forward"></i>
<i data-toggle="tooltip" data-placement="bottom" title="{{ trans('general.rotation') }}" class="fa fa-repeat"></i>
2016-07-21 22:01:57 +08:00
</div>
</h3>
</div><!-- /.box-header -->
<div class="box-body">
<div id="skinpreview">
<div id="preview-2d">
2016-09-15 23:03:58 +08:00
<p>{{ trans('user.player.textures.steve') }}<a href=""><img id="steve" class="skin2d" /></a>
<span class="skin2d">{{ trans('user.player.textures.empty') }}</span>
2016-07-21 22:01:57 +08:00
</p>
2016-09-15 23:03:58 +08:00
<p>{{ trans('user.player.textures.alex') }}<a href=""><img id="alex" class="skin2d" /></a>
<span class="skin2d">{{ trans('user.player.textures.empty') }}</span>
2016-07-21 22:01:57 +08:00
</p>
2016-09-15 23:03:58 +08:00
<p>{{ trans('user.player.textures.cape') }}<a href=""><img id="cape" class="skin2d" /></a>
<span class="skin2d">{{ trans('user.player.textures.empty') }}</span>
2016-07-21 22:01:57 +08:00
</p>
</div>
</div>
</div><!-- /.box-body -->
<div class="box-footer">
<button id="preview-switch" class="btn btn-default">{{ trans('general.switch-2d-preview') }}</button>
2016-07-21 22:01:57 +08:00
</div>
</div><!-- /.box -->
</div>
</div>
</section><!-- /.content -->
</div><!-- /.content-wrapper -->
<div id="modal-add-player" class="modal fade" tabindex="-1" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
2016-09-15 23:03:58 +08:00
<h4 class="modal-title">{{ trans('user.player.add-player') }}</h4>
2016-07-21 22:01:57 +08:00
</div>
<div class="modal-body">
<table class="table">
<tbody>
<tr>
<style> td { border-top: 0 !important; } </style>
2016-09-15 23:03:58 +08:00
<td>{{ trans('user.player.player-name') }}</td>
2016-07-21 22:01:57 +08:00
<td>
<input type="text" class="form-control" id="player_name"
2017-01-07 22:15:47 +08:00
placeholder="{{ option('allow_chinese_playername') ? trans('user.player.pname-rule-chinese') : trans('user.player.pname-rule') }}" value="">
2016-07-21 22:01:57 +08:00
</td>
</tr>
</tbody>
</table>
</div>
<div class="modal-footer">
2016-09-15 23:03:58 +08:00
<button type="button" class="btn btn-default" data-dismiss="modal">{{ trans('general.close') }}</button>
<a onclick="addNewPlayer();" class="btn btn-primary">{{ trans('general.submit') }}</a>
2016-07-21 22:01:57 +08:00
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->
2017-07-03 20:54:19 +08:00
<script type="text/javascript" src="{{ assets('js/three.min.js') }}"></script>
<script type="text/javascript" src="{{ assets('js/three.msp.js') }}"></script>
2016-07-21 22:01:57 +08:00
@endsection
@section('script')
<script>
// Default skin image, base64 encoded
var defaultSkin = "data:image/png;base64,{{ App\Http\Controllers\TextureController::getDefaultSkin() }}";
MSP.changeSkin(defaultSkin);
console.log('[3D Preview] Default skin rendered.');
2016-07-21 22:01:57 +08:00
$(document).ready(TexturePreview.init3dPreview);
2016-07-21 22:01:57 +08:00
// Auto resize canvas to fit responsive design
$(window).resize(TexturePreview.init3dPreview);
2016-07-21 22:01:57 +08:00
</script>
@endsection