2012-05-30 09:55:33 +00:00
|
|
|
|
<?php
|
2014-07-23 08:38:32 +00:00
|
|
|
|
$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');
|
2014-07-25 06:16:53 +00:00
|
|
|
|
$this->headLink()->appendStylesheet('/js/lib/colorbox/colorbox.css');
|
|
|
|
|
$this->headScript()->appendFile('/js/lib/colorbox/jquery.colorbox-min.js');
|
2014-07-23 08:38:32 +00:00
|
|
|
|
$this->breadcrumb('<a href="/">首页</a>');
|
|
|
|
|
$this->breadcrumb('<a href="/admin/data">数据管理</a>');
|
|
|
|
|
$this->breadcrumb('数据作者管理');
|
|
|
|
|
$this->breadcrumb()->setSeparator(' > ');
|
2012-05-30 09:55:33 +00:00
|
|
|
|
?>
|
2014-07-23 08:38:32 +00:00
|
|
|
|
<div class="row">
|
|
|
|
|
<!-- 左侧导航 -->
|
|
|
|
|
<div class="hidden-sm hidden-xs col-md-2">
|
|
|
|
|
<?= $this->partial('data/left.phtml'); ?>
|
|
|
|
|
</div>
|
|
|
|
|
<!-- //左侧导航 -->
|
2012-05-30 09:55:33 +00:00
|
|
|
|
|
2014-07-23 08:38:32 +00:00
|
|
|
|
<!-- 页面内容 -->
|
|
|
|
|
<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">
|
2014-09-23 13:50:03 +00:00
|
|
|
|
<form id="datasearch" class="search_form input-group" action="/admin/data/author">
|
2014-07-23 08:38:32 +00:00
|
|
|
|
<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>
|
2012-06-11 07:56:02 +00:00
|
|
|
|
</div>
|
2012-05-30 09:55:33 +00:00
|
|
|
|
</div>
|
2014-07-23 08:38:32 +00:00
|
|
|
|
<script type="text/javascript">
|
2012-05-30 09:55:33 +00:00
|
|
|
|
function AddAuthor(id,uuid){
|
2014-07-23 08:38:32 +00:00
|
|
|
|
$('#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>');
|
2012-05-30 09:55:33 +00:00
|
|
|
|
}
|
|
|
|
|
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')
|
2014-07-23 08:38:32 +00:00
|
|
|
|
{alert(data.error);return false;}
|
2012-05-30 09:55:33 +00:00
|
|
|
|
if(typeof(data.msg)!='undefined')
|
2014-07-23 08:38:32 +00:00
|
|
|
|
{alert(data.msg);}
|
2012-11-29 01:48:47 +00:00
|
|
|
|
if(typeof(data.status)!='undefined')
|
2012-05-30 09:55:33 +00:00
|
|
|
|
{$('#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>
|
2014-07-23 08:38:32 +00:00
|
|
|
|
|