sjy-ecos/views/data.html

75 lines
2.2 KiB
HTML
Raw Normal View History

2016-12-23 10:16:12 +00:00
<%- include('comm/header.html') %>
2018-01-29 02:27:28 +00:00
<div class="container">
<div class="row">
<div class="col-md-9 col-xs-12">
2018-01-29 07:29:19 +00:00
<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"><%= metadata.title %></h5>
<p class="list-group-item-text"><%= metadata.description.substring(0,50)+ '...' %></p>
</a>
<% }); %>
</div>
2018-01-29 02:27:28 +00:00
</div>
</div>
</div>
<script type="text/javascript">
$(function () {
$('.navbar-nav li a').each(function () {
if ($(this).attr('href') == '/data') {
$(this).addClass('active');
}
});
2018-01-29 07:29:19 +00:00
$.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);
2018-01-29 02:27:28 +00:00
})
});
</script>
<%- include('comm/footer.html') %>