105 lines
4.6 KiB
PHTML
105 lines
4.6 KiB
PHTML
<?php
|
||
$this->headTitle($this->config->title->site);
|
||
$this->headTitle($this->config->title->author);
|
||
$this->headTitle()->setSeparator(' - ');
|
||
$this->theme->AppendPlus($this,'colorbox');
|
||
$this->headLink()->appendStylesheet('/css/author.css');
|
||
$this->breadcrumb('<a href="/">首页</a>');
|
||
$this->breadcrumb('<a href="/author">数据作者</a>');
|
||
$this->breadcrumb('数据版本管理');
|
||
$this->breadcrumb()->setSeparator(' > ');
|
||
?>
|
||
<div class="row">
|
||
<div class="span3">
|
||
<?= $this->partial('author/navi.phtml'); ?>
|
||
</div>
|
||
<div class="span9">
|
||
|
||
<div>
|
||
<ul class="nav nav-pills">
|
||
<li class="<?php if(!$this->mdtitle) echo "active";?>"><a class="" href="/author/version">所有版本概况</a></li>
|
||
<li class=""><a class="" href="/author/version/ac/bydata">逐数据浏览</a></li>
|
||
</ul>
|
||
</div>
|
||
|
||
<div>
|
||
<?php
|
||
if (count($this->paginator)):
|
||
if ($this->mdtitle) echo "<h2>元数据:".$this->mdtitle."</h2>";
|
||
echo '<ul class="unstyled">';
|
||
$autoindex=0;
|
||
foreach ($this->paginator as $item):
|
||
$autoindex++;?>
|
||
<li class="well" id="list_<?php echo $item['id'];?>">
|
||
<p><a href="/data/<?php echo $item['uuid'];?>" target="_blank"><?php echo $item['title'];?></a>
|
||
【<a href="/author/version/uuid/<?php echo $item['uuid']; ?>">查看此数据所有版本</a>】</p>
|
||
<p>版本创建时间: <?php echo date("Y-m-d H:i",strtotime($item['ts_created']));?>
|
||
<?php if ($item['userid']) :
|
||
echo "发布人: ".(empty($item['realname'])?$item['username']:$item['realname'])." 【";
|
||
else :
|
||
?>
|
||
【<a onclick="return confirm('是否确定删除该版本?');" href="javascript:action('delete','<?php echo $item['id'];?>');" class="more">删除</a>
|
||
<?php endif; ?>
|
||
<a onclick="return confirm('是否确定将这个版本恢复到geonetwork?');" href="javascript:action('restore','<?php echo $item['id'];?>');" class="more">恢复到geonetwork</a>
|
||
<a href="/author/version/ac/diff/id/<?php echo $item['id'];?>" class="more">与前一版对比</a>
|
||
<a onclick="$('#commit_submit').attr('onclick','commit(\'<?php echo $item['id'];?>\');');" href="#commitform" class="more inline">提交评审发布</a>
|
||
】</p>
|
||
<?php if ($item['changelog']) : ?>
|
||
<p><?php echo $item['changelog']; ?></p>
|
||
<?php endif; ?>
|
||
</li>
|
||
<?php endforeach;
|
||
echo "</ul>";
|
||
endif; ?>
|
||
<div class="pagenavi"><?= $this->paginator; ?></div>
|
||
</div>
|
||
|
||
</div>
|
||
</div>
|
||
<script>
|
||
function action(ac,id){
|
||
$.ajax({
|
||
'type':"POST",
|
||
'url':'/author/version/',
|
||
'data':'ac='+ ac +'&id='+id,
|
||
'success':function(data){
|
||
if (typeof(data)=='object')
|
||
{
|
||
if(typeof(data.error)!='undefined')
|
||
{$.colorbox({'innerWidth':'50%','html':data.error});}
|
||
if(typeof(data.deleted)!='undefined')
|
||
{$('#list_'+data.deleted).fadeOut("slow",function(){$(this).remove();});}
|
||
if(typeof(data.commited)!='undefined')
|
||
{$('#changelog').val('');$('#commit_submit').attr('onclick','');}
|
||
}
|
||
else{
|
||
$.colorbox({'innerWidth':'50%','html':'<img src="/images/alert_big_warning.png" /><h4>出现错误,请稍候再试</h4>'});
|
||
}
|
||
},
|
||
'timeout': 30000,
|
||
'error': function(){
|
||
$.colorbox({'innerWidth':'50%','html':'<img src="/images/alert_big_error.png" /><h4>处理中出现错误,请刷新页面后重试</h4>'});
|
||
}
|
||
});
|
||
}
|
||
$(".inline").colorbox({inline:true, width:"50%"});
|
||
function commit(id){
|
||
action('commit&changelog='+$('#changelog').val(),id);
|
||
}
|
||
</script>
|
||
<div class="colorbox" style="display:none;">
|
||
<div id="commitform">
|
||
<form>
|
||
<p>
|
||
<label>版本改动:</label><br />
|
||
<textarea class="input-block-level" style="resize:none;height:200px;" id="changelog"></textarea>
|
||
<br /><small>请输入此版本与之前版本的差别</small>
|
||
</p>
|
||
<input type="button" onclick="" id="commit_submit" class="btn btn-green big" value="提交"/>
|
||
</form>
|
||
</div>
|
||
<div class="error"><img src="/images/alert_big_error.png" /><span></span></div>
|
||
<div class="ok"><img src="/images/alert_big_ok.png" /><span></span></div>
|
||
<div class="warning"><img src="/images/alert_big_warning.png" /><span></span></div>
|
||
</div>
|