更新数据列表页面样式,增加按来源,近条件排序。
This commit is contained in:
parent
5539454526
commit
3a4cd9585c
|
@ -116,6 +116,8 @@ class IndexController extends AbstractActionController
|
|||
$metadata->opt->order = "m.ts_created";
|
||||
if($order == "title")
|
||||
$metadata->opt->order = "m.title";
|
||||
if($order == "viewed")
|
||||
$metadata->opt->order = "m.viewedcount";
|
||||
}
|
||||
|
||||
if(!empty($sort))
|
||||
|
@ -135,6 +137,7 @@ class IndexController extends AbstractActionController
|
|||
$metadata->opt->where = array(" ol.host='http://www.sanjiangyuan.org.cn' ");
|
||||
}
|
||||
|
||||
|
||||
view::addPaginator($metadata->fetchAll(),$this,10,'layout/metadata/pagination/browse');
|
||||
|
||||
return $this->ViewModel;
|
||||
|
|
|
@ -3,6 +3,7 @@ if (!empty($this->codename)) $this->headTitle($this->codename);
|
|||
$theme = new \Sookon\Helpers\Theme;
|
||||
$theme->AppendPlus($this,'colorbox');
|
||||
?>
|
||||
|
||||
<div class="container">
|
||||
<div id="row">
|
||||
<?= $this->partial('layout/metadata/subnav'); ?>
|
||||
|
@ -13,21 +14,28 @@ $theme->AppendPlus($this,'colorbox');
|
|||
<?php if (!empty($this->paginator)) : ?>
|
||||
<div id='metacontent'>
|
||||
<?php echo $this->paginator; ?>
|
||||
<hr />
|
||||
<?php foreach($this->paginator as $md) : ?>
|
||||
<div class="mditem" style="border-bottom:1px dashed #DFDFDF; overflow:hidden">
|
||||
<div class="thumb" >
|
||||
<a href="/service/thumb/id/<?php echo $md['id'];?>" class="colorbox pull-left">
|
||||
<img src="/service/thumb/id/<?php echo $md['id'];?>" style="padding-right:20px" />
|
||||
</a>
|
||||
</div>
|
||||
<div >
|
||||
<h2><a href="/data/<?php echo $md['uuid']; ?>"><?php echo $md['title'];?></a></h2>
|
||||
<p><?php echo mb_strlen($md['description'])>400? mb_substr($md['description'],0,400,'UTF-8').'...':$md['description'];?></p>
|
||||
<div class="box">
|
||||
|
||||
<?php foreach($this->paginator as $md) : ?>
|
||||
|
||||
<div class="clearfix" style="border-bottom:1px dashed #DFDFDF; overflow:hidden">
|
||||
|
||||
<div class="pull-left">
|
||||
<a href="/service/thumb/id/<?php echo $md['id'];?>" class="colorbox">
|
||||
<img class="img-rounded img-polaroid" src="/service/thumb/id/<?php echo $md['id'];?>" style="margin:20px 20px" width="140" height="80" />
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div style="display:block; padding-left:180px;">
|
||||
<h3><a href="/data/<?php echo $md['uuid']; ?>"><?php echo $md['title'];?></a></h3>
|
||||
<p class=""><?php echo mb_strlen($md['description'])>400? mb_substr($md['description'],0,400,'UTF-8').'...':$md['description'];?></p>
|
||||
<p class="text-right"><strong>UUID: </strong><small><?= $md['uuid'] ?></small> , <small><?= $md['filesize']."MB" ?></small></p>
|
||||
<p class="pull-right"><strong class="badge badge-info ">查阅数: <?= $md['viewed'] ?></strong> , <small><?= date("Y-m-d H:i",strtotime($md['ts_created'])) ?></small></p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php echo $this->paginator; ?>
|
||||
<?php endif ?>
|
||||
|
@ -37,4 +45,4 @@ $(document).ready(function(){
|
|||
$(".colorbox").colorbox({rel:"colorbox",photo:"true",transition:"fade"});
|
||||
$(".colorbox").colorbox({photo:"true"});
|
||||
});
|
||||
</script>
|
||||
</script>
|
|
@ -4,8 +4,20 @@
|
|||
<a href="/data/browse" class="badge badge-info ">全部浏览</a>
|
||||
<a href="/data/onlinelist" class="badge badge-info ">在线数据清单</a>
|
||||
<a href="/data/offlinelist" class="badge badge-info ">离线数据清单</a>
|
||||
<a href="/data/browse?order=title&sort=asc&source=青海湖" class="badge badge-info ">青海湖数据</a>
|
||||
<a href="/data/browse?order=title&sort=asc&source=三江源" class="badge badge-info ">三江源数据</a>
|
||||
<a href="?source=青海湖" class="badge badge-info ">青海湖数据</a>
|
||||
<a href="?source=三江源" class="badge badge-info ">三江源数据</a>
|
||||
<div class="btn-group">
|
||||
<button class="btn dropdown-toggle" data-toggle="dropdown">
|
||||
按条件排序
|
||||
<span class="caret"></span>
|
||||
</button>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a href="?order=ts_created&sort=asc">时间顺序</a></li>
|
||||
<li><a href="?order=ts_created&sort=desc">时间倒序</a></li>
|
||||
<li><a href="?order=viewedcount&sort=desc">热门程度</a></li>
|
||||
<li><a href="?order=title&sort=asc">标题首字母</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<?php if(!empty($this->keyword)){?>
|
||||
<strong class="badge badge-info" style="margin-left:20px;"> <?= $this->keyword ?></strong><small class=""> 的搜索结果</small>
|
||||
<?php }?>
|
Loading…
Reference in New Issue