Files
leanote/app/views/member/index.html
2014-12-09 23:17:36 +08:00

80 lines
2.6 KiB
HTML
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{{template "member/top.html" .}}
<div class="m-b-md"> <h3 class="m-b-none">{{.userInfo.Username}}, {{msg . "welcomeToLeanote"}}.</h3></div>
<section class="panel panel-default">
<div class="row m-l-none m-r-none bg-light lter">
<div class="col-sm-6 col-md-3 padder-v b-r b-light">
<span class="fa-stack fa-2x pull-left m-r-sm">
<i class="fa fa-circle fa-stack-2x text-warning"></i>
<i class="fa fa-file-o fa-stack-1x text-white"></i>
</span>
<a class="clear" href="javascript:;">
<span class="h3 block m-t-xs"><strong>{{.countNote}}</strong></span>
<small class="text-muted text-uc">{{msg . "note"}}</small>
</a>
</div>
<div class="col-sm-6 col-md-3 padder-v b-r b-light">
<span class="fa-stack fa-2x pull-left m-r-sm">
<i class="fa fa-circle fa-stack-2x text-info"></i>
<i class="fa fa-bold fa-stack-1x text-white"></i>
</span>
<a class="clear" href="javascript:;">
<span class="h3 block m-t-xs"><strong>{{.countBlog}}</strong></span>
<small class="text-muted text-uc">{{msg . "blog"}}</small>
</a>
</div>
</div>
</section>
<!-- 最新动态 -->
<section class="panel panel-default">
<h4 class="font-thin padder">
{{msg . "leanoteEvents"}}
</h4>
<ul class="list-group" id="eventsList"></ul>
</section>
<!--
<section class="panel panel-default">
<form>
<textarea class="form-control no-border" rows="3" placeholder="Suggestions to leanote"></textarea>
</form>
<footer class="panel-footer bg-light lter">
<button class="btn btn-info pull-right btn-sm">
POST
</button>
<ul class="nav nav-pills nav-sm">
</footer>
</section>
-->
{{template "member/footer.html" .}}
<script>
$(function() {
// leanote动态
var url = "https://leanote.com/blog/listCateLatest/5446753cfacfaa4f56000000";
function renderItem(item) {
return '<li class="list-group-item"><p><a target="_blank" href="http://leanote.com/blog/post/' + item.NoteId + '">' + item.Title + '</a></p><small class="block text-muted"><i class="fa fa-clock-o"></i> ' + goNowToDatetime(item.PublicTime) + '</small></li>';
}
$.ajax({
dataType: "jsonp",//跨域访问 dataType 必须是jsonp 类型。
url: url,
type: "GET",
jsonp: "callback",
jsonpCallback: "jsonpCallback",
success: function(data) {
if(typeof data == "object" && data.Ok) {
var list = data.List;
var html = "";
for(var i = 0; i < list.length; ++i) {
var item = list[i];
html += renderItem(item);
}
$("#eventsList").html(html);
}
}
});
});
</script>
{{template "member/end.html" .}}