update pages

This commit is contained in:
jack 2018-02-04 17:46:00 +08:00
parent 6b3ee40107
commit b8053090f1
16 changed files with 365 additions and 144 deletions

View File

@ -190,6 +190,8 @@ class DataController extends Zend_Controller_Action
*/
function browseAction()
{
$this->_helper->layout->setLayout('layout-sanji');
$page=(int)$this->_request->getParam('page');
if (empty($page)) $page=1;
$limit=10;
@ -199,8 +201,17 @@ class DataController extends Zend_Controller_Action
$sum=$row[0]['count'];
$select=$this->db->select();
$select->from('metadata','*')->order('id desc')->limitPage($page,$limit);
$this->view->metadata = $this->db->fetchAll($select);
$this->view->page=new Pagination($sum,$page,$limit);
// $this->view->metadata = $this->db->fetchAll($select);
// Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination_text.phtml');
// $this->view->page=new Pagination($sum,$page,$limit);
$paginator = Zend_Paginator::factory($select);
$paginator->setCurrentPageNumber($page);
$paginator->setItemCountPerPage($this->view->config->page->max);
$paginator->setView($this->view);
Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination_text.phtml');
$this->view->paginator=$paginator;
}
function tagAction()
{
@ -547,6 +558,8 @@ class DataController extends Zend_Controller_Action
*/
function viewAction()
{
$this->_helper->layout->setLayout('layout-sanji');
$id = (int)$this->_request->getParam('id');
$sql="select m.*,s.status,g.id as gid,t.filename,i.doi as datadoi,i.authors,i.author_en,i.publisher,i.publisher_en, date_part('year',i.ts_published) as publish_year from normalmetadata m left join mdstatus s on m.uuid=s.uuid
left join thumbnail t on t.id=m.id left join geonetworkmetadata g on m.uuid=g.uuid left join datadoi i on i.uuid=m.uuid where ";

View File

@ -3,35 +3,55 @@
$this->headTitle($this->config->title->data);
$this->headTitle('全部浏览');
$this->headTitle()->setSeparator(' - ');
$this->headLink()->appendStylesheet('/css/metadata.css');
$this->headLink()->appendStylesheet('/static-sanji/css/data-list.css');
$this->nav[] = array('link'=>"/data/browse",'title'=>'全部浏览');
$this->theme->AppendPlus($this,'colorbox');
?>
<div class="row-fluid">
<?= $this->render('breadcrumbs.phtml'); ?>
<hr class="c-f">
<?= $this->partial('data/tools.phtml'); ?>
<hr class="c-f">
<div class="container">
<?php foreach($this->paginator as $md) : ?>
<div class="row c-list">
<div class="col-md-4 c-img-box">
<div class="c-img" href="/service/bigthumb/uuid/<?= $md['uuid'] ?>" style="background:url('/service/thumb/id/<?php echo $md['id'];?>') no-repeat center"></div>
<!-- <a href="/service/bigthumb/uuid/--><?//= $md['uuid'] ?><!--" class="pull-left colorbox">-->
<!-- <img class="media-object" src="/service/thumb/id/--><?php //echo $md['id'];?><!--">-->
<!-- </a>-->
</div>
<div class="col-md-8 c-list-box">
<h4><a href="/data/<?php echo $md['uuid'];?>"><?php echo $this->escape($md['title']);?></a></h4>
<p class="c-info"><span class="c-author"></span><i>Admin</i> | &nbsp;<span class="c-click"></span><i>100</i> | &nbsp;<span class="c-time"></span><i><?php echo date("d,M,Y",strtotime( $md['ts_published'] )); ?></i></p>
<p class="c-con">
<?php echo str_replace(array("\r\n", "\n", "\r"),'<br />',mb_strlen($md['description'])>200 ? $this->escape(mb_substr($md['description'],0,200,'UTF-8').'...'):$this->escape($md['description']));?>
</p>
<div class="dam clear">
<div class="c-left">
<i>文件大小</i>
<em><?php echo round($md['filesize'] / 2014, 2)?>MB</em>
</div>
<a class="c-right" href="">更多</a>
</div>
<?php echo $this->page->getNavigation(); ?>
<hr />
<?php foreach($this->metadata as $md) : ?>
<div class="media well well-small">
<a href="/service/bigthumb/uuid/<?= $md['uuid'] ?>" class="pull-left colorbox">
<img class="media-object" src="/service/thumb/id/<?php echo $md['id'];?>">
</a>
<div class="media-body">
<h4 class="media-heading"><a href="/data/<?php echo $md['uuid'];?>"><?php echo $this->escape($md['title']);?></a></h4>
<div class="summary"><?php echo str_replace(array("\r\n", "\n", "\r"),'<br />',mb_strlen($md['description'])>400?$this->escape(mb_substr($md['description'],0,400,'UTF-8').'...'):$this->escape($md['description']));?></div>
</div>
</div>
<?php endforeach; ?>
<?php echo $this->page->getNavigation(); ?>
</div>
<div class="container">
<div class="row">
<div class="col-xs-12">
<div class="page">
<div class="pagenavi"><?= $this->paginator; ?></div>
</div>
</div>
</div>
</div>
<script src="/static-sanji/js/data-list.js"></script>
<script type="text/javascript" charset="utf-8">
$(document).ready(function(){
$(".colorbox").colorbox({rel:"colorbox",photo:"true",transition:"fade"});
$(".colorbox").colorbox({photo:"true"});
});
$('#container').masonry({
itemSelector : '.items',
});
//$(document).ready(function(){
// $(".colorbox").colorbox({rel:"colorbox",photo:"true",transition:"fade"});
// $(".colorbox").colorbox({photo:"true"});
//});
</script>

View File

@ -5,51 +5,51 @@ $this->headTitle()->setSeparator(' - ');
$this->headLink()->appendStylesheet('/static-sanji/css/data-index.css');
?>
<div class="data-warp">
<div class="top-special-nav">
<div class="title">专题数据集</div>
<div class="container">
<div class="col-sm-4">
<div>
<p>黑河计划</p>
</div>
<img src="/news/images/data_01.png" alt="">
</div>
<div class="col-sm-4">
<div>
<p>HiWATER</p>
<p>克里斯蒂几个垃圾规范可结果看了几个集都十分广泛</p>
</div>
<img src="/news/images/data_01.png" alt="">
</div>
<div class="col-sm-4">
<div>
<p>HiWATER</p>
<p>克里斯蒂几个垃圾规范可结果看了几个集都十分广泛</p>
</div>
<img src="/news/images/data_01.png" alt="">
</div>
<div class="col-sm-4">
<div>
<p>黑河计划</p>
</div>
<img src="/news/images/data_01.png" alt="">
</div>
<div class="col-sm-4">
<div>
<p>HiWATER</p>
<p>克里斯蒂几个垃圾规范可结果看了几个集都十分广泛</p>
</div>
<img src="/news/images/data_01.png" alt="">
</div>
<div class="col-sm-4">
<div>
<p>HiWATER</p>
<p>克里斯蒂几个垃圾规范可结果看了几个集都十分广泛</p>
</div>
<img src="/news/images/data_01.png" alt="">
</div>
</div>
</div>
<!-- <div class="top-special-nav">-->
<!-- <div class="title">专题数据集</div>-->
<!-- <div class="container">-->
<!-- <div class="col-sm-4">-->
<!-- <div>-->
<!-- <p>黑河计划</p>-->
<!-- </div>-->
<!-- <img src="/news/images/data_01.png" alt="">-->
<!-- </div>-->
<!-- <div class="col-sm-4">-->
<!-- <div>-->
<!-- <p>HiWATER</p>-->
<!-- <p>克里斯蒂几个垃圾规范可结果看了几个集都十分广泛</p>-->
<!-- </div>-->
<!-- <img src="/news/images/data_01.png" alt="">-->
<!-- </div>-->
<!-- <div class="col-sm-4">-->
<!-- <div>-->
<!-- <p>HiWATER</p>-->
<!-- <p>克里斯蒂几个垃圾规范可结果看了几个集都十分广泛</p>-->
<!-- </div>-->
<!-- <img src="/news/images/data_01.png" alt="">-->
<!-- </div>-->
<!-- <div class="col-sm-4">-->
<!-- <div>-->
<!-- <p>黑河计划</p>-->
<!-- </div>-->
<!-- <img src="/news/images/data_01.png" alt="">-->
<!-- </div>-->
<!-- <div class="col-sm-4">-->
<!-- <div>-->
<!-- <p>HiWATER</p>-->
<!-- <p>克里斯蒂几个垃圾规范可结果看了几个集都十分广泛</p>-->
<!-- </div>-->
<!-- <img src="/news/images/data_01.png" alt="">-->
<!-- </div>-->
<!-- <div class="col-sm-4">-->
<!-- <div>-->
<!-- <p>HiWATER</p>-->
<!-- <p>克里斯蒂几个垃圾规范可结果看了几个集都十分广泛</p>-->
<!-- </div>-->
<!-- <img src="/news/images/data_01.png" alt="">-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<div class="data-nav">
<div class="title">数据导航</div>
<div class="container">
@ -59,16 +59,9 @@ $this->headLink()->appendStylesheet('/static-sanji/css/data-index.css');
foreach ($list as $cg){
if($type == 'category'){
$name = empty($cg['name_zh']) ? $cg['name'] : $cg['name_zh'];
$content .= '<button type="button" class="btn btn-default col-sm-3">' .
'<a href="/data/category/code/'.$cg['code'].'">'.
$name.
'</a></button>';
$content .= '<a class="btn a-btn btn-default col-sm-3" href="/data/category/code/'.$cg['code'].'">'.$name.'</a>';
}else{
$content .= '<button type="button" class="btn btn-default col-sm-3">' .
'<a href="/data/series/'. $cg['id']. '">'.
$cg['name'].
'</a></button>';
$content .= '<a class="btn a-btn btn-default col-sm-3" href="/data/series/'. $cg['id']. '">'.$cg['name'].'</a>';
}
}
@ -121,18 +114,18 @@ $this->headLink()->appendStylesheet('/static-sanji/css/data-index.css');
</form>
</div>
<div class="col-sm-12">
<button type="button" class="btn splBtn btn-default col-sm-2"><a href="/search/advance">高级搜索</a></button>
<button type="button" class="btn splBtn btn-default col-sm-2"><a href="/data/browse">数据列表浏览</a></button>
<button type="button" class="btn splBtn btn-default col-sm-2"><a href="/data/onlinelist">在线数据清单</a></button>
<button type="button" class="btn splBtn btn-default col-sm-2"><a href="/data/offlinelist">离线数据清单</a></button>
<button type="button" class="btn splBtn btn-default col-sm-2"><a href="/data/thumb">缩略图浏览</a></button>
<button type="button" class="btn splBtn btn-default col-sm-2"><a href="/data/timeline">时间轴浏览</a></button>
<button type="button" class="btn splBtn btn-default col-sm-2"><a href="/data/extent">空间浏览</a></button>
<button type="button" class="btn splBtn btn-default col-sm-2"><a href="/data/timemap">时空浏览</a></button>
<button type="button" class="btn splBtn btn-default col-sm-2"><a href="/data/organization">单位浏览</a></button>
<button type="button" class="btn splBtn btn-default col-sm-2"><a href="/data/fund">项目浏览</a></button>
<button type="button" class="btn splBtn btn-default col-sm-2"><a href="/data/author">作者浏览</a></button>
<button type="button" class="btn splBtn btn-default col-sm-2"><a href="/knowledge">文献浏览</a></button>
<a class="btn splBtn btn-default col-sm-2" href="/search/advance">高级搜索</a>
<a class="btn splBtn btn-default col-sm-2" href="/data/browse">数据列表浏览</a>
<a class="btn splBtn btn-default col-sm-2" href="/data/onlinelist">在线数据清单</a>
<a class="btn splBtn btn-default col-sm-2" href="/data/offlinelist">离线数据清单</a>
<a class="btn splBtn btn-default col-sm-2" href="/data/thumb">缩略图浏览</a>
<a class="btn splBtn btn-default col-sm-2" href="/data/timeline">时间轴浏览</a>
<a class="btn splBtn btn-default col-sm-2" href="/data/extent">空间浏览</a>
<a class="btn splBtn btn-default col-sm-2" href="/data/timemap">时空浏览</a>
<a class="btn splBtn btn-default col-sm-2" href="/data/organization">单位浏览</a>
<a class="btn splBtn btn-default col-sm-2" href="/data/fund">项目浏览</a>
<a class="btn splBtn btn-default col-sm-2" href="/data/author">作者浏览</a>
<a class="btn splBtn btn-default col-sm-2" href="/knowledge">文献浏览</a>
<!-- <button type="button" class="btn splBtn btn-default col-sm-2"><a href="/data/doi">DOI浏览</a></button>-->
</div>
<p style="clear: both"></p>
@ -140,7 +133,7 @@ $this->headLink()->appendStylesheet('/static-sanji/css/data-index.css');
function genCol($keywords){
$content = "";
foreach ($keywords as $keyword){
$content .= '<button type="button" class="btn btn-default col-sm-3"><a href="/data/tag/'.$keyword[1].'">' . $keyword[0] . '</a></button>';
$content .= '<a class="btn a-btn btn-default col-sm-3" href="/data/tag/'.$keyword[1].'">' . $keyword[0] . '</a>';
}
return '<div class="col-sm-6">'. $content . '</div>';
}

View File

@ -1,11 +1,15 @@
<ul class="nav nav-pills">
<li class="nav-header">特色导航方式</li>
<div class="container product-nav">
<div class="row">
<div class="col-xs-12">
<ul class="clear fication">
<li>分类:</li>
<li><a href="/data/tag"><i class="icon-tags"></i>关键词浏览</a></li>
<li><a href="/data/series"><i class="icon-th-list"></i>序列浏览</a></li>
<li><a href="/data/category"><i class="icon-th"></i>分类浏览</a></li>
<li><a href="/data/timeline"><i class="icon-tasks"></i>时间轴浏览</a></li>
<!-- <li><a href="/data/extent"><i class="icon-globe"></i>空间浏览</a></li> -->
<li><a href="/data/timemap"><i class="icon-film"></i>时空浏览</a></li>
<li><a href="/data/browse"><i class="icon-align-justify"></i>全部浏览</a></li>
<!-- <li><a href="/data/advancesearch"><i class="icon-search"></i>高级搜索</a></li> -->
</ul>
</div>
</div>
</div>

View File

@ -74,3 +74,34 @@ footer p .footer-link{
font-size: 14px;
line-height: 66px;
}
.page{
margin: 0px;
width: 100%;
text-align: center;
}
.page span{
margin-right: 7px;
font-size: 14px;
color:#000;
font-weight: lighter;
}
.page span:nth-child(4),.page span:nth-child(5),.page span:nth-child(6),.page span:nth-child(7){
margin: 0 10px;
}
.page span a{
color:#000;
}
.navClass{
display: inline-block;
width: 100%;
height: 56px;
border-bottom: 2px solid #7e7e7e;
color: #7e7e7e !important;
}
.pageClass{
color: #d31919 !important;
font-weight: normal;
text-decoration: none !important;
}

View File

@ -39,7 +39,7 @@
.data-nav,.special-nav{
padding: 0 0 20px 0;
border-top:2px solid #f3f3f3;
border-bottom:2px solid #f3f3f3;
/*border-bottom:2px solid #f3f3f3;*/
}
.title{
width: 200px;
@ -75,11 +75,13 @@
color: #959595;
text-decoration: none;
}
.data-warp button{
.data-warp .a-btn{
display: inline-block;
margin-right: 11px !important;
margin-bottom: 10px;
font-size: 14px;
height: 46px;
line-height: 46px;
padding-left: 8px;
padding-right: 8px;
padding-top: 0;
@ -90,16 +92,15 @@
white-space:nowrap;
border-radius: 0;
border: 2px solid #f4f4f4;
}
.data-warp button a{
width: 100%;
color: #7e7e7e;
text-decoration: none;
}
.data-warp button:hover{
.data-warp .a-btn:hover{
border: 2px solid #f4f4f4;
background: #eee;
}
.data-warp button:hover a{
.data-warp .a-btn:hover{
color: #7e7e7e;
}
.data-warp .col-sm-6,.data-warp .col-sm-12{
@ -125,7 +126,7 @@
}
.data-warp .splBtn:hover{
background: none;
border: 2px solid #f4f4f4;
border: 1px solid #f4f4f4;
}
.data-warp .col-sm-12 .col-sm-2{
width: 14.5% !important;
@ -156,6 +157,7 @@
}
.data-serves{
padding-bottom: 20px;
border-bottom: none;
}
.server-title{
height: 30px;
@ -168,8 +170,6 @@
height: 50px;
line-height: 50px;
font-size: 14px;
padding-left: 2%;
background: url("../images/data_03_06.jpg") no-repeat left center;
}
.data-serves .col-sm-4 a{
color: #959595;

View File

@ -0,0 +1,178 @@
h1,h2,h3,h4,h5,h6,p,ul,li,dl,dt,dd,body,ul,li,hr{
padding:0;
margin:0;
}
li{
list-style: none;
}
.clear:after{
display: block;
content: '';
clear: both;
}
a:hover{
text-decoration: none;
}
.c-f{
margin: 28px 0;
}
.product-nav .fication{
background: #f4f4f4;
height: 56px;
}
.product-nav .fication:nth-child(2){
margin-top: 1px;
padding-right:28px;
position: relative;
overflow: hidden;
}
.product-nav ul.fication:nth-child(2) span{
width:20px;
height: 20px;
cursor: pointer;
position: absolute;
right:10px;
top:18px;
background: url('./images/c-down.png') no-repeat center;
background-size: contain;
}
.product-nav ul.fication li{
line-height: 56px;
margin-left: 20px;
word-break: break-all;
display: -webkit-box;
-webkit-line-clamp: 2; /*限制在一个块元素显示的文本的行数*/
-webkit-box-orient: vertical;
overflow: hidden4px;
float: left;
color:#a8a8a8;
}
.product-nav ul.fication li a{
color: #a8a8a8;
font-size: 14px;
}
.product-nav ul.fication li a:hover{
color:#000;
}
.dropdown{
margin-top: 30px;
color:#a8a8a8;
font-size: 14px;
}
.pro-list{
margin:20px 0;
}
.btn-default{
border-color:transparent !important;
color:#a8a8a8;
font-size: 14px;
}
/* 列表 */
.c-img{
width:240px;
height:220px;
background-size:contain;
}
.c-img-box{
padding:8px;
}
.c-list{
border:1px solid #ccc;
border-radius: 4px;
margin-bottom: 36px;
}
.c-list-box{
padding-right: 20px;
}
.c-list-box h4{
margin: 20px 0px;
font-size: 16px;
font-weight: 600;
}
.c-list-box .c-info span{
display: inline-block;
width: 25px;
height: 15px;
background-size: contain;
}
.c-list-box .c-author{
background: url('./images/c-author.png') no-repeat center;
}
.c-list-box .c-click{
background: url('./images/c-click.png') no-repeat center;
}
.c-list-box .c-time{
background: url('./images/c-time.png') no-repeat center;
}
.c-list-box .c-info {
color: #a6a6a6;
font-size: 12px;
}
.c-list-box .c-info i{
margin: 0 5px 0 5px;
}
.c-list-box p.c-info{
margin-bottom: 25px;
}
.c-list-box .c-con{
line-height: 25px;
padding-bottom: 14px;
border-bottom: 1px dashed #ccc;
word-break: break-all;
display: -webkit-box;
-webkit-line-clamp: 2; /*限制在一个块元素显示的文本的行数*/
-webkit-box-orient: vertical;
overflow: hidden
}
.c-left{
float: left;
line-height: 48px;
font-size: 12px;
color:#a6a6a6;
line-height: 68px;
}
.c-left a{
display: inline-block;
width: 40px;
height: 12px;
background: url('./images/c-downloads.png') no-repeat center;
background-size: contain;
}
.c-left em{
font-style: normal;
}
.c-right{
float: right;
width: 108px;
border:1px solid #309fc9;
line-height: 32px;
text-align: center;
font-size: 12px;
margin-top:20px;
}
.c-right:hover{
background: #309fc9;
color:#fff;
}
#pagination a{
color:#525252;
}
#pagination a:hover{
color:#d31919;
}
#pagination ul{
width:496px;
margin: 0 auto;
font-size: 14px;
color:#525252;
padding-top: 15px;
}
#pagination ul li{
float:left;
margin:0 8px;
}

View File

@ -58,32 +58,3 @@
.body-warp .list-warp li span{
float: right;
}
.page{
margin: 15px auto;
width: 500px;
}
.page span{
margin-right: 7px;
font-size: 14px;
color:#000;
font-weight: lighter;
}
.page span:nth-child(4),.page span:nth-child(5),.page span:nth-child(6),.page span:nth-child(7){
margin: 0 10px;
}
.page span a{
color:#000;
}
.navClass{
display: inline-block;
width: 100%;
height: 56px;
border-bottom: 2px solid #7e7e7e;
color: #7e7e7e !important;
}
.pageClass{
color: #d31919 !important;
font-weight: normal;
text-decoration: none !important;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -0,0 +1,9 @@
const cDown = document.querySelector('.c-down');
const ul = document.querySelector('.product-nav ul:nth-child(2)');
cDown.addEventListener('click', function(){
if(ul.style.height != 'auto'){
ul.style.height = "auto";
}else{
ul.style.height = "56px"
}
})

View File

@ -30,8 +30,6 @@ $(function() {
$(".pagination").find("a[href=\"#" + ref + "\"]").addClass("active");
$('.swiper-container').height('100%');
$('section.panel div.container').each(function(elem){
console.log($(window).height());
console.log($(this).height());
$(this).css({position: 'relative', top: ($(window).height() -$(this).height()) / 2 });
});
},
@ -61,4 +59,8 @@ $(function() {
$(".pagination a").on("click",$.scrollify.move);
}
});
$('section.panel div.container').each(function(elem){
$(this).css({position: 'relative', top: ($(window).height() -$(this).height()) / 2 });
});
});