2012-03-26 04:16:36 +00:00
<?php
$this->headTitle($this->config->title->site);
$this->headTitle($this->config->title->author);
$this->headTitle()->setSeparator(' - ');
2013-03-28 07:12:10 +00:00
$this->theme->AppendPlus($this,'colorbox');
2012-03-26 04:16:36 +00:00
$this->headLink()->appendStylesheet('/css/author.css');
2014-09-02 13:06:16 +00:00
$this->breadcrumb('< a href = "/" > Home< / a > ');
$this->breadcrumb('< a href = "/author" > Author< / a > ');
$this->breadcrumb('Versions');
2012-03-26 04:16:36 +00:00
$this->breadcrumb()->setSeparator(' > ');
?>
2013-03-28 07:12:10 +00:00
< div class = "row" >
< div class = "span3" >
<? = $this -> partial ( 'author/navi.phtml' ); ?>
2012-03-26 04:16:36 +00:00
< / div >
2013-03-28 07:12:10 +00:00
< div class = "span9" >
< div >
< ul class = "nav nav-pills" >
2014-09-02 13:06:16 +00:00
< li class = " <?php if ( ! $this -> mdtitle ) echo "active" ; ?> " >< a class = "" href = "/author/version" > All versions</ a ></ li >
< li class = "" > < a class = "" href = "/author/version/ac/bydata" > By datasets< / a > < / li >
2013-03-28 07:12:10 +00:00
< / ul >
< / div >
< div >
<?php
if (count($this->paginator)):
2014-09-02 13:06:16 +00:00
if ($this->mdtitle) echo "< h2 > Dataset: ".$this->mdtitle."< / h2 > ";
2013-03-28 07:12:10 +00:00
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 >
2014-09-02 13:06:16 +00:00
[< a href = "/author/version/uuid/ <?php echo $item [ 'uuid' ]; ?> " > All versions</ a > ]</ p >
< p > Created: <?php echo date ( "Y-m-d H:i" , strtotime ( $item [ 'ts_created' ])); ?>
2013-03-28 07:12:10 +00:00
<?php if ( $item [ 'userid' ]) :
2014-09-02 13:06:16 +00:00
echo "Releaser ".(empty($item['realname'])?$item['username']:$item['realname'])." 【";
2013-03-28 07:12:10 +00:00
else :
?>
2014-09-02 13:06:16 +00:00
[< a onclick = "return confirm('Sure to delete this version?');" href = "javascript:action('delete',' <?php echo $item [ 'id' ]; ?> ');" class = "more" > Delete</ a >
2013-03-28 07:12:10 +00:00
<?php endif ; ?>
2014-09-02 13:06:16 +00:00
< a onclick = "return confirm('Sure to restore this version to Geonetwork? ');" href = "javascript:action('restore',' <?php echo $item [ 'id' ]; ?> ');" class = "more" > Restore to Geonetwork</ a >
< a href = "/author/version/ac/diff/id/ <?php echo $item [ 'id' ]; ?> " class = "more" > Diff with previous version</ a >
< a onclick = "$('#commit_submit').attr('onclick','commit(\' <?php echo $item [ 'id' ]; ?> \');');" href = "#commitform" class = "more inline" > Commit this version</ a >
]< / p >
2013-03-28 07:12:10 +00:00
<?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 >
2012-03-26 04:16:36 +00:00
< / div >
< / div >
< script >
2012-03-27 10:17:51 +00:00
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();});}
2012-03-28 08:29:07 +00:00
if(typeof(data.commited)!='undefined')
{$('#changelog').val('');$('#commit_submit').attr('onclick','');}
2012-03-27 10:17:51 +00:00
}
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 > '});
}
});
}
2012-03-28 08:29:07 +00:00
$(".inline").colorbox({inline:true, width:"50%"});
function commit(id){
action('commit&changelog='+$('#changelog').val(),id);
}
2012-03-27 10:17:51 +00:00
< / script >
< div class = "colorbox" style = "display:none;" >
2012-03-28 08:29:07 +00:00
< div id = "commitform" >
< form >
< p >
2014-09-02 13:06:16 +00:00
< label > Changelog:< / label > < br / >
2013-06-01 09:13:53 +00:00
< textarea class = "input-block-level" style = "resize:none;height:200px;" id = "changelog" > < / textarea >
2014-09-02 13:06:16 +00:00
< br / > < small > Please input the difference of the version< / small >
2012-03-28 08:29:07 +00:00
< / p >
< input type = "button" onclick = "" id = "commit_submit" class = "btn btn-green big" value = "提交" / >
< / form >
< / div >
2012-03-27 10:17:51 +00:00
< 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 >
2012-03-28 08:29:07 +00:00
< / div >