fix: westdc/westdc-zf1#15, 修复fund页面问题

This commit is contained in:
wlx 2015-06-20 09:58:23 +08:00
parent 42de94b668
commit 093d8db854
6 changed files with 17 additions and 14 deletions

View File

@ -747,7 +747,7 @@ class HiwaterController extends DataController
} }
} else { } else {
//提供全部分类列表 //提供全部分类列表
$sql="select f.id,f.title,f.fund_id,f.fund_type,f.ts_created,count(m.id) as datacount,sum(md.filesize) as filesize from fund f left join mdfund m on f.id=m.fid left join metadata md on m.uuid=md.uuid where m.uuid in (select d.uuid from datasource d left join source s on d.sourceid=s.id where s.code='hiwater') group by f.id,f.title,f.fund_id,f.fund_type,f.ts_created order by f.ts_created desc"; $sql="select f.id,f.title_en,f.fund_id,f.fund_type_en,f.ts_created,count(m.id) as datacount,sum(md.filesize) as filesize from fund f left join mdfund m on f.id=m.fid right join en.normalmetadata md on m.uuid=md.uuid where m.uuid in (select d.uuid from datasource d left join source s on d.sourceid=s.id where s.code='hiwater') group by f.id,f.title,f.fund_id,f.fund_type,f.ts_created order by f.ts_created desc";
$sth = $this->db->prepare($sql); $sth = $this->db->prepare($sql);
$sth->execute(); $sth->execute();
$rows = $sth->fetchAll(); $rows = $sth->fetchAll();

View File

@ -15,7 +15,7 @@ $this->nav[] = array('link'=>"/data/fund",'title'=>'Funding');
<?php foreach($this->paginator as $md) : ?> <?php foreach($this->paginator as $md) : ?>
<div class="well"> <div class="well">
<h4><a href="/data/fund/id/<?php echo $md['id'];?>"><?php echo $this->escape($md['title_en']);?></a></h4> <h4><a href="/data/fund/id/<?php echo $md['id'];?>"><?php echo $this->escape($md['title_en']);?></a></h4>
No. <a href="/data/fund/id/<?php echo $md['id'];?>"><?php echo $md['fund_id']; ?></a> | Type: <?php echo $md['fund_type_en']; ?> | Datasets: <?php echo $md['datacount']; ?>Total <?php echo $md['filesize']>5000?(round($md['filesize']/1024,2)).'GB':$md['filesize'].'MB'; ?></div> <?php echo trim($md['fund_type_en'],'"'); ?> (<a href="/data/fund/id/<?php echo $md['id'];?>">No: <?php echo $md['fund_id']; ?></a>), has <?php echo $md['datacount']; ?> datasets, volume <?php echo $md['filesize']>5000?(round($md['filesize']/1024,2)).'GB':$md['filesize'].'MB'; ?></div>
<?php endforeach; ?> <?php endforeach; ?>
<div class="pagenavi"><?= $this->paginator; ?></div> <div class="pagenavi"><?= $this->paginator; ?></div>
<?php else : ?> <?php else : ?>

View File

@ -12,7 +12,7 @@ $this->theme->AppendPlus($this,'colorbox');
</div> </div>
<div class="well"> <div class="well">
<h4><a href="/data/fund/id/<?php echo $this->fund['id'];?>"><?php echo $this->escape($this->fund['title_en']);?></a></h4> <h4><a href="/data/fund/id/<?php echo $this->fund['id'];?>"><?php echo $this->escape($this->fund['title_en']);?></a></h4>
No. <?php echo $this->fund['fund_id']; ?> | Type: <?php echo $this->fund['fund_type_en']; ?> <?php echo trim($this->fund['fund_type_en'],'"'); ?> (<a href="/data/fund/id/<?php echo $this->fund['id'];?>">No: <?php echo $this->fund['fund_id']; ?></a>)
</div> </div>
<?php if (!empty($this->paginator)) : ?> <?php if (!empty($this->paginator)) : ?>
<hr /> <hr />

View File

@ -3,6 +3,7 @@ $this->headTitle($this->config->title->site);
$this->headTitle($this->config->title->data); $this->headTitle($this->config->title->data);
$this->headTitle('Fund'); $this->headTitle('Fund');
$this->headTitle()->setSeparator(' - '); $this->headTitle()->setSeparator(' - ');
$this->headLink()->appendStylesheet('/css/water.css');
$this->nav[] = array('link'=>"/hiwater",'title'=>'HiWATER'); $this->nav[] = array('link'=>"/hiwater",'title'=>'HiWATER');
?> ?>
<?= $this->render('breadcrumbs.phtml') ?> <?= $this->render('breadcrumbs.phtml') ?>
@ -14,9 +15,9 @@ $this->nav[] = array('link'=>"/hiwater",'title'=>'HiWATER');
<?php if (!empty($this->paginator)) : ?> <?php if (!empty($this->paginator)) : ?>
<div class="pagenavi"><?= $this->paginator; ?></div> <div class="pagenavi"><?= $this->paginator; ?></div>
<?php foreach($this->paginator as $md) : ?> <?php foreach($this->paginator as $md) : ?>
<div class="well"> <div class="well">
<h4><a href="/hiwater/fund/id/<?php echo $md['id'];?>"><?php echo $this->escape($md['title']);?></a></h4> <h4><a href="/hiwater/fund/id/<?php echo $md['id'];?>"><?php echo $this->escape($md['title_en']);?></a></h4>
No: <?php echo $md['fund_id']; ?> | Type: <?php echo $md['fund_type']; ?> | Datasets: <?php echo $md['datacount']; ?>条,<?php echo $md['filesize']>5000?(round($md['filesize']/1024,2)).'GB':$md['filesize'].'MB'; ?></div> <?php echo trim($md['fund_type_en'],'"'); ?> (<a href="/hiwater/fund/id/<?php echo $md['id'];?>">No: <?php echo $md['fund_id']; ?></a>), has <?php echo $md['datacount']; ?> datasets, volume <?php echo $md['filesize']>5000?(round($md['filesize']/1024,2)).'GB':$md['filesize'].'MB'; ?></div>
<?php endforeach; ?> <?php endforeach; ?>
<div class="pagenavi"><?= $this->paginator; ?></div> <div class="pagenavi"><?= $this->paginator; ?></div>
<?php else : ?> <?php else : ?>

View File

@ -3,6 +3,7 @@ $this->headTitle($this->config->title->site);
$this->headTitle($this->config->title->data); $this->headTitle($this->config->title->data);
$this->headTitle('Fund'); $this->headTitle('Fund');
$this->headTitle()->setSeparator(' - '); $this->headTitle()->setSeparator(' - ');
$this->headLink()->appendStylesheet('/css/water.css');
$this->nav[] = array('link'=>"/hiwater",'title'=>'HiWATER'); $this->nav[] = array('link'=>"/hiwater",'title'=>'HiWATER');
$this->theme->AppendPlus($this,'colorbox'); $this->theme->AppendPlus($this,'colorbox');
?> ?>
@ -13,8 +14,8 @@ $this->theme->AppendPlus($this,'colorbox');
</div> </div>
<div class="span9"> <div class="span9">
<div class="well"> <div class="well">
<h4><a href="/hiwater/fund/id/<?php echo $this->fund['id'];?>"><?php echo $this->escape($this->fund['title']);?></a></h4> <h4><a href="/hiwater/fund/id/<?php echo $this->fund['id'];?>"><?php echo $this->escape($this->fund['title_en']);?></a></h4>
No: <?php echo $this->fund['fund_id']; ?> | Type: <?php echo $this->fund['fund_type']; ?> <?php echo trim($this->fund['fund_type_en'],'"'); ?> (<a href="/hiwater/fund/id/<?php echo $this->fund['id'];?>">No: <?php echo $this->fund['fund_id']; ?></a>)
</div> </div>
<?php if (!empty($this->paginator)) : ?> <?php if (!empty($this->paginator)) : ?>
<hr /> <hr />
@ -35,6 +36,7 @@ No: <?php echo $this->fund['fund_id']; ?> | Type: <?php echo $this->fund['fund
No data. No data.
<?php endif; ?> <?php endif; ?>
</div> </div>
</div>
<script type="text/javascript" charset="utf-8"> <script type="text/javascript" charset="utf-8">
$(document).ready(function(){ $(document).ready(function(){
$(".colorbox").colorbox({rel:"colorbox",photo:"true",transition:"fade"}); $(".colorbox").colorbox({rel:"colorbox",photo:"true",transition:"fade"});

View File

@ -142,14 +142,14 @@
<a class="accordion-toggle" href="#">Special explores</a> <a class="accordion-toggle" href="#">Special explores</a>
</div> </div>
<ul class="nav nav-list tree" id="collapse10"> <ul class="nav nav-list tree" id="collapse10">
<li id="Nav-hiwater-tag"><a href="/hiwater/tag"><i class="icon-double-angle-right"></i>By keyword</a></li> <li id="Nav-hiwater-tag"><a href="/hiwater/tag"><i class="icon-double-angle-right"></i>By Keywords</a></li>
<li id="Nav-hiwater-thumb"><a href="/hiwater/thumb"><i class="icon-double-angle-right"></i>By thumbnail</a></li> <li id="Nav-hiwater-thumb"><a href="/hiwater/thumb"><i class="icon-double-angle-right"></i>By Thumbnail</a></li>
<li id="Nav-hiwater-browse"><a href="/hiwater/browse"><i class="icon-double-angle-right"></i>All browse</a></li> <li id="Nav-hiwater-browse"><a href="/hiwater/browse"><i class="icon-double-angle-right"></i>Browse All</a></li>
<li id="Nav-hiwater-timeline"><a href="/hiwater/timeline"><i class="icon-double-angle-right"></i>Timeline</a></li> <li id="Nav-hiwater-timeline"><a href="/hiwater/timeline"><i class="icon-double-angle-right"></i>Timeline</a></li>
<li id="Nav-hiwater-timemap"><a href="/hiwater/timemap"><i class="icon-double-angle-right"></i>Timemap</a></li> <li id="Nav-hiwater-timemap"><a href="/hiwater/timemap"><i class="icon-double-angle-right"></i>Timemap</a></li>
<li id="Nav-hiwater-fund"><a href="/hiwater/fund"><i class="icon-double-angle-right"></i>By fund</a></li> <li id="Nav-hiwater-fund"><a href="/hiwater/fund"><i class="icon-double-angle-right"></i>By Fund</a></li>
<li id="Nav-hiwater-author"><a href="/hiwater/author"><i class="icon-double-angle-right"></i>By author</a></li> <li id="Nav-hiwater-author"><a href="/hiwater/author"><i class="icon-double-angle-right"></i>By Author</a></li>
<li id="Nav-hiwater-organization"><a href="/hiwater/organization"><i class="icon-double-angle-right"></i>By organization</a></li> <li id="Nav-hiwater-organization"><a href="/hiwater/organization"><i class="icon-double-angle-right"></i>By Organization</a></li>
</ul> </ul>
</li> </li>