tweaked performance of user manage page

This commit is contained in:
printempw 2016-04-03 11:44:43 +08:00
parent e220018413
commit 36eea7e767
2 changed files with 24 additions and 18 deletions

View File

@ -2,23 +2,11 @@
* @Author: printempw
* @Date: 2016-02-04 16:48:42
* @Last Modified by: printempw
* @Last Modified time: 2016-04-03 09:12:46
* @Last Modified time: 2016-04-03 11:42:38
*/
'use strict';
function uploadSkin(uname) {
Ply.dialog("confirm", {
text: "更改该用户对应哪个模型的皮肤?",
ok: "Steve",
cancel: "Alex"
}).done(function(){
uploadTexture(uname, 'steve');
}).fail(function(){
uploadTexture(uname, 'alex');
});
}
function uploadTexture(uname, type) {
var ply = new Ply({
el: '<h2>为该用户上传新的 ' + type + ' 材质:</h2>'+

View File

@ -57,13 +57,31 @@
<img id="<?php echo $row['username']; ?>-cape" width="64" <?php if ($row['hash_cape']): ?>src="../cape/<?php echo $row['username']; ?>.png"<?php endif; ?> />
</td>
<td>
<a href="javascript:uploadSkin('<?php echo $row['username']; ?>');" class="btn btn-primary btn-sm">皮肤</a>
<a href="javascript:uploadTexture('<?php echo $row['username']; ?>', 'cape');" class="btn btn-primary btn-sm">披风</a>
<div class="btn-group">
<button type="button" class="btn btn-sm btn-primary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
上传材质 <span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li><a href="javascript:uploadTexture('<?php echo $row['username']; ?>', 'steve');">皮肤Steve 模型)</a></li>
<li><a href="javascript:uploadTexture('<?php echo $row['username']; ?>', 'alex' );">皮肤Alex 模型)</a></li>
<li><a href="javascript:uploadTexture('<?php echo $row['username']; ?>', 'cape' );">披风</a></li>
</ul>
</div>
<a href="javascript:deleteTexture('<?php echo $row['username'] ?>');" class="btn btn-warning btn-sm">删除材质</a>
</td>
<td>
<a href="manage.php?show=<?php echo $row['uid']; ?>" class="btn btn-default btn-sm">材质预览</a>
<a href="javascript:deleteTexture('<?php echo $row['username'] ?>');" class="btn btn-warning btn-sm">删除材质</a>
<a href="javascript:changePasswd('<?php echo $row['username'] ?>');" class="btn btn-default btn-sm">更改密码</a>
<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="manage.php?show=<?php echo $row['uid']; ?>">修改用户名</a></li>
<li><a href="javascript:changePasswd('<?php echo $row['username'] ?>');">更改密码</a></li>
<li><a href="manage.php?show=<?php echo $row['uid']; ?>">修改优先模型</a></li>
<li role="separator" class="divider"></li>
<li><a href="manage.php?show=<?php echo $row['uid']; ?>">材质预览</a></li>
</ul>
</div>
<a class="btn btn-danger btn-sm"
<?php if ($row['uid'] == 1)
echo 'disabled="disabled" data-toggle="tooltip" data-placement="bottom" title="少年,不要作死哦"';