sjy-ecos/views/data.html

95 lines
2.6 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<%- 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>
<style type="text/css">
p.list-group-item-text {
color:#979797;
}
</style>
<script type="text/javascript">
$(function () {
var pathname = window.location.pathname;
if (pathname.indexOf('data') === 1) {
$(".navbar-nav li a[href='/data']").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 = [];
if (value.type === '数据发布单位') {
$.each(value.items, function (i, val) {
var keyword = $("<a/>", {
"class": "item",
"href": "http://www.sanjiangyuan.org.cn:4567/data/organization/name/" + encodeURIComponent(val),
html: val
});
keywords.push(keyword);
});
} else {
$.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') %>