beta2 ok
This commit is contained in:
169
app/views/member/blog/list.html
Normal file
169
app/views/member/blog/list.html
Normal file
@@ -0,0 +1,169 @@
|
||||
{{template "member/top.html" .}}
|
||||
<div class="m-b-md"><h3 class="m-b-none">文章列表</h3></div>
|
||||
<style>
|
||||
.url-title {
|
||||
width: 260px;
|
||||
}
|
||||
</style>
|
||||
<section class="panel panel-default">
|
||||
<div class="row wrapper">
|
||||
<div class="col-sm-5 m-b-xs">
|
||||
</div>
|
||||
<div class="col-sm-4 m-b-xs">
|
||||
</div>
|
||||
<div class="col-sm-3">
|
||||
<div class="input-group search-group">
|
||||
<input type="text" class="input-sm form-control" placeholder="Title" id="keywords" value="{{.keywords}}" />
|
||||
<span class="input-group-btn">
|
||||
<button class="btn btn-sm btn-default" type="button" data-url="/member/blog/index">Search</button>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped b-t b-light">
|
||||
<thead>
|
||||
<tr>
|
||||
{{$url := urlConcat "/member/blog/index" "keywords" .keywords}}
|
||||
<th style="width: 300px"
|
||||
{{sorterTh $url "title" .sorter}}
|
||||
>
|
||||
Title
|
||||
<span class="th-sort">
|
||||
<i class="fa fa-sort-down"></i>
|
||||
<i class="fa fa-sort-up"></i>
|
||||
<i class="fa fa-sort"></i>
|
||||
</span>
|
||||
</th>
|
||||
|
||||
<th
|
||||
style="width: 300px"
|
||||
{{sorterTh $url "urlTitle" .sorter}}
|
||||
>
|
||||
固定链接
|
||||
<span class="th-sort">
|
||||
<i class="fa fa-sort-down"></i>
|
||||
<i class="fa fa-sort-up"></i>
|
||||
<i class="fa fa-sort"></i>
|
||||
</span>
|
||||
</th>
|
||||
<th
|
||||
{{sorterTh $url "publicTime" .sorter}}
|
||||
>
|
||||
发布日期
|
||||
<span class="th-sort">
|
||||
<i class="fa fa-sort-down"></i>
|
||||
<i class="fa fa-sort-up"></i>
|
||||
<i class="fa fa-sort"></i>
|
||||
</span>
|
||||
</th>
|
||||
|
||||
<th
|
||||
{{sorterTh $url "updatedTime" .sorter}}
|
||||
>
|
||||
更新日期
|
||||
<span class="th-sort">
|
||||
<i class="fa fa-sort-down"></i>
|
||||
<i class="fa fa-sort-up"></i>
|
||||
<i class="fa fa-sort"></i>
|
||||
</span>
|
||||
</th>
|
||||
<th
|
||||
{{sorterTh $url "createdTime" .sorter}}
|
||||
>
|
||||
创建日期
|
||||
<span class="th-sort">
|
||||
<i class="fa fa-sort-down"></i>
|
||||
<i class="fa fa-sort-up"></i>
|
||||
<i class="fa fa-sort"></i>
|
||||
</span>
|
||||
</th>
|
||||
<th width="30">
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{range .blogs}}
|
||||
|
||||
{{if .UrlTitle}}
|
||||
{{set $ "urlTitle" (decodeUrlValue .UrlTitle)}}
|
||||
{{else}}
|
||||
{{set $ "urlTitle" .NoteId.Hex}}
|
||||
{{end}}
|
||||
<tr>
|
||||
<td>
|
||||
<a href="{{$.userAndBlog.PostUrl}}/{{$.urlTitle}}" class="post" target="_blank">{{.Title|raw}}</a>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
/post/
|
||||
<input type="text" data-id="{{.NoteId.Hex}}" class="url-title" value="{{$.urlTitle}}"/>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
{{.PublicTime|datetime}}
|
||||
</td>
|
||||
|
||||
<td>
|
||||
{{.UpdatedTime|datetime}}
|
||||
</td>
|
||||
<td>
|
||||
{{.CreatedTime|datetime}}
|
||||
</td>
|
||||
<td>
|
||||
|
||||
<a
|
||||
{{if .HasSelfDefined}}
|
||||
title="已设置"
|
||||
class="btn btn-sm btn-success"
|
||||
{{else}}
|
||||
title="未设置"
|
||||
class="btn btn-sm btn-default"
|
||||
{{end}}
|
||||
href="/member/blog/updateBlogAbstract?noteId={{.NoteId.Hex}}">摘要设置</a>
|
||||
</td>
|
||||
</tr>
|
||||
{{end}}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<footer class="panel-footer">
|
||||
<div class="row">
|
||||
<div class="col-sm-4 hidden-xs">
|
||||
</div>
|
||||
<div class="col-sm-4 text-center">
|
||||
<small class="text-muted inline m-t-sm m-b-sm">
|
||||
</small>
|
||||
</div>
|
||||
<div class="col-sm-4 text-right text-center-xs">
|
||||
{{set . "url" (urlConcat "/member/blog/index" "sorter" .sorter "keywords" .keywords)}}
|
||||
{{template "member/blog/page.html" .}}
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
</section>
|
||||
|
||||
{{template "member/footer.html" .}}
|
||||
|
||||
<script>
|
||||
$(function() {
|
||||
var postUrl="{{$.userAndBlog.PostUrl}}";
|
||||
$(".url-title").change(function(){
|
||||
var $t = $(this);
|
||||
var url = $t.val();
|
||||
var noteId = $t.data('id');
|
||||
ajaxPost("/member/blog/updateBlogUrlTitle", {noteId: noteId, urlTitle: url}, function(re){
|
||||
if(reIsOk(re)) {
|
||||
$t.val(re.Item);
|
||||
var $a = $t.closest("tr").find(".post");
|
||||
|
||||
$a.attr("href", postUrl + "/" + encodeURI(re.Item));
|
||||
} else {
|
||||
art.alert(re.Msg || "error");
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
{{template "member/end.html" .}}
|
||||
Reference in New Issue
Block a user