96 lines
4.0 KiB
PHTML
96 lines
4.0 KiB
PHTML
<?php
|
||
$this->headTitle($this->config->title->site);
|
||
$this->headTitle($this->config->title->author);
|
||
$this->headTitle()->setSeparator(' - ');
|
||
$this->headLink()->appendStylesheet('/css/admin.css');
|
||
$this->headScript()->appendFile('/js/modal.js');
|
||
$this->headLink()->appendStylesheet('/css/author.css');
|
||
$this->headLink()->appendStylesheet('/js/lib/colorbox/colorbox.css');
|
||
$this->headScript()->appendFile('/js/lib/colorbox/jquery.colorbox-min.js');
|
||
$this->breadcrumb('<a href="/">首页</a>');
|
||
$this->breadcrumb('<a href="/admin/data">数据管理</a>');
|
||
$this->breadcrumb('数据作者管理');
|
||
$this->breadcrumb()->setSeparator(' > ');
|
||
?>
|
||
<div class="row">
|
||
<!-- 左侧导航 -->
|
||
<div class="hidden-sm hidden-xs col-md-2">
|
||
<?= $this->partial('data/left.phtml'); ?>
|
||
</div>
|
||
<!-- //左侧导航 -->
|
||
|
||
<!-- 页面内容 -->
|
||
<div class="col-md-10 col-sm-12">
|
||
<div class="form-group">
|
||
<a class="btn btn-primary btn-sm" href="/admin/data/author">作者管理</a>
|
||
<a class="btn btn-primary btn-sm" href="/admin/data/author/ac/list">查看所有数据作者</a>
|
||
<a class="btn btn-primary btn-sm" href="/admin/data/author/ac/datas">所有数据</a>
|
||
</div>
|
||
<div class="input-group form-group">
|
||
<form id="datasearch" class="search_form input-group" action="/admin/data/author">
|
||
<input type="text" id="keyword" name="q" value="<?php if(!empty($this->q)) echo $this->q; ?>" class="form-control" placeholder="搜索关键字" />
|
||
<span class="input-group-btn"><button type="submit" class="btn btn-default" id="search_btn">搜索</button></span>
|
||
</form>
|
||
</div>
|
||
<div id="datalistZ" >
|
||
<?php
|
||
if (count($this->paginator)):
|
||
if ($this->mdtitle) echo "<h2>元数据:".$this->mdtitle."</h2>";
|
||
echo "<ul class=list-unstyled>";
|
||
$autoindex=0;
|
||
foreach ($this->paginator as $item):
|
||
$autoindex++;?>
|
||
<li id="list_<?php echo $item['id'];?>" class="well well-sm">
|
||
<h4><a href="/data/<?php echo $item['uuid'];?>" target="_blank"><?php echo $item['title'];?></a> </h4>
|
||
<p></p>
|
||
<h5>
|
||
<?php if ($item['c']) : ?>
|
||
作者数量 :<span id="sumAuthor_<?php echo $item['id'];?>"><?php echo $item['c']; ?></span>
|
||
<a class="label label-info" data-trigger="modal" data-title="作者" href="/admin/data/author/ac/edit/uuid/<?php echo $item['uuid']; ?>/window/iframe" class="iframe">
|
||
<span class="glyphicon glyphicon-user"></span> 作者管理</a>
|
||
<?php endif; ?>
|
||
<span class="form-inline" id="addauthor_<?php echo $item['id'];?>">
|
||
<a class="label label-success" href="javascript:;" onclick="AddAuthor(<?php echo $item['id']; ?>,'<?php echo $item['uuid']; ?>')">
|
||
<span class="glyphicon glyphicon-plus"></span> 添加作者</a>
|
||
</span>
|
||
</h5>
|
||
</li>
|
||
<?php endforeach;
|
||
echo "</ul>";
|
||
endif; ?>
|
||
<div class="pagenavi"><?= $this->paginator; ?></div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<script type="text/javascript">
|
||
function AddAuthor(id,uuid){
|
||
$('#addauthor_'+id).html('用户名:<input class="form-control input-sm" type="text" id="authorInp_'+id+'"/> <button class="btn btn-success btn-sm" onclick="addAuthor('+id+',\''+uuid+'\')">添加</button>');
|
||
}
|
||
function addAuthor(id,uuid){
|
||
$.ajax({
|
||
'type':"POST",
|
||
'url':'/admin/data/author',
|
||
'data':'ac=add&uuid='+uuid+'&username='+$('#authorInp_'+id).val(),
|
||
'success':function(data){
|
||
if (typeof(data)=='object')
|
||
{
|
||
if(typeof(data.error)!='undefined')
|
||
{alert(data.error);return false;}
|
||
if(typeof(data.msg)!='undefined')
|
||
{alert(data.msg);}
|
||
if(typeof(data.status)!='undefined')
|
||
{$('#addauthor_'+id).html('<a href="javascript:;" onclick="AddAuthor('+id+',\''+uuid+'\')">添加作者</a>');}
|
||
}
|
||
else{
|
||
Alert('出现错误,请稍后再试');
|
||
}
|
||
},
|
||
'timeout': 30000,
|
||
'error': function(){
|
||
$.colorbox({'innerWidth':'50%','html':'<img src="/images/alert_big_error.png" /><h4>处理中出现错误,请刷新页面后重试</h4>'});
|
||
}
|
||
});
|
||
}
|
||
</script>
|
||
|