75 lines
2.2 KiB
HTML
75 lines
2.2 KiB
HTML
<%- include('comm/header.html') %>
|
||
<div class="container">
|
||
<div class="row">
|
||
<div class="col-md-9 col-xs-12">
|
||
<ul class="list-group filter-list-group">
|
||
|
||
</ul>
|
||
|
||
<% metadatas.forEach(function(metadata){ %>
|
||
<div class="media metadata-list-group">
|
||
<div class="media-left">
|
||
<a href="http://www.sanjiangyuan.org.cn:4567/service/bigthumb/id/<%= metadata.id %>">
|
||
<img width="140" height="80" class="media-object" src="http://www.sanjiangyuan.org.cn:4567/service/thumb/id/<%= metadata.id%>" alt="<%= metadata.title %>">
|
||
</a>
|
||
</div>
|
||
<div class="media-body">
|
||
<h4 class="media-heading"><a href="http://www.sanjiangyuan.org.cn:4567/data/<%= metadata.uuid %>"><%= metadata.title %></a></h4>
|
||
<%= metadata.description %>
|
||
</div>
|
||
</div>
|
||
|
||
<% }); %>
|
||
</div>
|
||
<div class="col-md-3 col-xs-12">
|
||
<h3>最新数据</h3>
|
||
<div class="separator"></div>
|
||
<div class="list-group">
|
||
<% latestMetadatas.forEach(function(metadata){ %>
|
||
<a href="http://www.sanjiangyuan.org.cn:4567/data/<%= metadata.uuid %>" class="list-group-item">
|
||
<h5 class="list-group-item-heading" style="color:#08c"><%= metadata.title %></h5>
|
||
<p class="list-group-item-text"><%= metadata.description.substring(0,50)+ '...' %></p>
|
||
</a>
|
||
|
||
<% }); %>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<script type="text/javascript">
|
||
$(function () {
|
||
$('.navbar-nav li a').each(function () {
|
||
if ($(this).attr('href') == '/data') {
|
||
$(this).addClass('active');
|
||
}
|
||
});
|
||
$.getJSON("/json/keyword.json", function(data) {
|
||
var items = [];
|
||
$.each(data, function(index, value) {
|
||
var title = $("<span/>", {
|
||
"class":"title",
|
||
html:value.type+":"
|
||
});
|
||
var keywords = [];
|
||
|
||
$.each(value.items, function(i, val) {
|
||
var keyword = $("<a/>", {
|
||
"class":"item",
|
||
"href":"http://www.sanjiangyuan.org.cn:4567/data/tag/"+encodeURIComponent(val),
|
||
html:val
|
||
});
|
||
keywords.push(keyword);
|
||
});
|
||
|
||
var li = $("<li/>", {
|
||
"class":"list-group-item"
|
||
});
|
||
li.append(title).append(keywords);
|
||
items.push(li);
|
||
});
|
||
|
||
$('.filter-list-group').append(items);
|
||
})
|
||
});
|
||
</script>
|
||
<%- include('comm/footer.html') %> |