Skip to content

Commit 09058e8

Browse files
committed
优化详情页
1 parent 1d24c53 commit 09058e8

File tree

1 file changed

+52
-66
lines changed

1 file changed

+52
-66
lines changed

views/app/thread/thread.html

Lines changed: 52 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
<span class="username">
12
{{ template "layout/header" .}}
23
<link href="http://cdn.bootcss.com/highlight.js/8.0/styles/monokai_sublime.min.css" rel="stylesheet">
34
<script src="/static/js/ck5b/ckeditor.js"></script>
@@ -40,7 +41,7 @@ <h4 class="break-all">
4041
{{/*如果是作者本人操作*/}}
4142
{{/*{{if islogin}}*/}}
4243
{{if eq .fpost.UserID .sessions.Userid}}
43-
<div>
44+
<div>
4445
<a href="/thread/{{.thread.ID}}/edit.html" class="text-grey mr-2 post_update"><i class="icon-edit"></i> 编辑</a>
4546
<a data-href="/thread/{{.thread.ID}}/delete.html" href="javascript:void(0);" class="text-grey post_delete" isfirst="1"><i class="icon-remove"></i> 删除</a>
4647
</div>
@@ -87,7 +88,7 @@ <h4 class="break-all">
8788
</style>
8889
<div class="haya-favoriter px-2">
8990
{{if .islogin}}
90-
<span class="btn-group haya-favoriter-info" role="group">
91+
<span class="btn-group haya-favoriter-info" role="group">
9192
{{if .isfav}}
9293
<button onclick="myfavourite({{.thread.ID}}, this)" class="btn btn-outline-secondary js-haya-favorite-del" data-tid="{{.thread.ID}}" title="取消收藏">
9394
<i class="icon icon-star" aria-label="取消收藏"></i>
@@ -132,8 +133,8 @@ <h4 class="break-all">
132133
<ul class="list-unstyled postlist">
133134
{{$isadmin := .session.Isadmin}}
134135
{{range $index,$post := .postlist}}
135-
<li class="media post" data-pid="2" data-uid="2">
136-
<a href="?user-2.htm" class="mr-3" tabindex="-1">
136+
<li class="media post" data-pid="2" data-uid="2">
137+
<a href="/user/{{$post.User.ID}}/info.html" class="mr-3" tabindex="-1">
137138
<img class="avatar-3" src="{{$post.User.Avatar}}">
138139
</a>
139140
<div class="media-body">
@@ -144,7 +145,7 @@ <h4 class="break-all">
144145
{{$post.User.Group.Name}} </i>
145146
</span>
146147
<span class="username">
147-
<a href="/user.htm?id={{$post.UserID}}" class="text-muted font-weight-bold">{{$post.User.Username}}</a>
148+
<a href="/user/{{$post.UserID}}/info.html" class="text-muted font-weight-bold">{{$post.User.Username}}</a>
148149
</span>
149150
{{/*<span class="date text-grey ml-2">{{$post.CreatedAt.Format "2006-01-02 15:04:05"}}</span>*/}}
150151
<span class="date text-grey ml-2">{{$post.CreatedAt.Unix | strtime}}</span>
@@ -155,22 +156,7 @@ <h4 class="break-all">
155156
color: var(--secondary) !important;
156157
}
157158
</style>
158-
{{/*<span class="haya-post-like mr-3">
159-
<a href="javascript:;" class="text-muted js-haya-post-like-post-add" data-pid="{{$post.ID}}" title="点赞回复">
160-
<i class="icon icon-thumbs-o-up" aria-label="点赞回复"></i>
161-
<span class="haya-post-like-post-user-count">{{$post.LikesCnt}}</span>
162-
</a>
163-
<a href="javascript:;" class="text-muted haya-post-like-loved js-haya-post-like-post-del" data-pid="{{$post.ID}}" title="取消点赞">
164-
<i class="icon icon-thumbs-up" aria-label="取消点赞"></i>
165-
<span class="haya-post-like-post-user-count">{{$post.LikesCnt}}</span>
166-
</a>
167-
</span>
168-
*/}}{{/*{{if $isadmin}}*/}}{{/*
169-
<a href="javascript:void(0)" data-tid="1" data-pid="2" class="text-grey post_reply mr-3"><i class="icon-reply" title="引用"></i>
170-
<span class="d-none">引用</span></a>
171-
<a href="/post/{{$post.ID}}/edit.html" class="text-grey post_update mr-3"><i class="icon-edit" title="编辑"></i> <span class="d-none">编辑</span></a>
172-
<a data-href="?post-delete-2.htm" data-confirm-text="确定删除吗?" href="javascript:void(0);" class="text-grey post_delete _confirm mr-3"><i class="icon-remove" title="删除"></i> <span class="d-none">删除</span></a>
173-
*/}}{{/*{{end}}*/}}
159+
174160
<span class="floor-parent">
175161
<span class="floor mr-0">{{$index | plus1}}</span>
176162
</span>
@@ -200,7 +186,7 @@ <h4 class="break-all">
200186
{{end}}
201187

202188
{{if .sessions.Username}}
203-
<li class="post newpost media">
189+
<li class="post newpost media">
204190
<a href="/my.html" class="mr-3" tabindex="-1">
205191
<img class="avatar-3" src="{{.sessions.Useravatar}}">
206192
</a>
@@ -236,7 +222,7 @@ <h4 class="break-all">
236222
</div>
237223
</li>
238224
{{else}}
239-
<li class="post newpost media">
225+
<li class="post newpost media">
240226
<a role="button" class="btn btn-default btn-block xn-back col-lg-6 mx-auto mb-3" target="_blank" href="/login.html">登录可回复</a>
241227
</li>
242228
{{end}}
@@ -257,7 +243,7 @@ <h4 class="break-all">
257243
<a href="?user-1.htm" tabindex="-1">
258244
<img class="avatar-5" src="{{.thread.User.Avatar}}">
259245
</a>
260-
<h5><a href="?user-1.htm">{{.thread.User.Username}}</a></h5>
246+
<h5><a href="/user/{{.thread.User.ID}}/info.html">{{.thread.User.Username}}</a></h5>
261247
</div>
262248
<div class="card-footer p-2">
263249
<table class="w-100 small">
@@ -301,7 +287,7 @@ <h5><a href="?user-1.htm">{{.thread.User.Username}}</a></h5>
301287
<h6 class="card-title">作者最近主题:</h6>
302288
<ul class="small break-all">
303289
{{range .user_newest_threads}}
304-
<li class="line-height-2">
290+
<li class="line-height-2">
305291
<a href="/thread/{{.ID}}/detail.html">
306292
{{.Subject}}
307293
</a>
@@ -410,48 +396,48 @@ <h6 class="card-title">作者最近主题:</h6>
410396
var jsubmit = $('#postsubmit')
411397
var s = '<ul>' +
412398
'<li class="media post" data-pid="5" data-uid="2">' +
413-
'<a href="?user-2.htm" class="mr-3" tabindex="-1">' +
414-
'<img class="avatar-3" src="upload/avatar/000/2.png?1563802634"> ' +
415-
'</a>' +
416-
'<div class="media-body">' +
417-
'<div class="d-flex justify-content-between small text-muted">' +
399+
'<a href="?user-2.htm" class="mr-3" tabindex="-1">' +
400+
'<img class="avatar-3" src="upload/avatar/000/2.png?1563802634"> ' +
401+
'</a>' +
402+
'<div class="media-body">' +
403+
'<div class="d-flex justify-content-between small text-muted">' +
418404
' <div> ' +
419-
'<span style="padding-bottom:0;margin-bottom:0;color:; ">' +
420-
'<i class="iconfont icon-v1" style="font-size: !important;">管理员组 </i> ' +
421-
'</span>' +
422-
'<span class="username">' +
423-
'<a href="?user-2.htm" class="text-muted font-weight-bold">zhang</a>' +
424-
'</span>' +
425-
'<span class="date text-grey ml-2">2小时前</span>' +
426-
'</div> ' +
427-
'<div class="text-right text-grey"> ' +
428-
'<style>.haya-post-like .haya-post-like-loved {color: var(--secondary) !important;}</style> ' +
429-
'<span class="haya-post-like mr-3"> ' +
430-
'<a href="javascript:;" class="text-muted js-haya-post-like-post-add" data-pid="5" title="点赞回复">' +
431-
'<i class="icon icon-thumbs-o-up" aria-label="点赞回复"></i> ' +
432-
'<span class="haya-post-like-post-user-count">0</span>' +
433-
'</a>' +
434-
'</span>' +
435-
'<a href="javascript:void(0)" data-tid="1" data-pid="5" class="text-grey post_reply mr-3">' +
436-
'<i class="icon-reply" title="引用"></i> ' +
437-
'<span class="d-none">引用</span>' +
438-
'</a> ' +
439-
'<a href="?post-update-5.htm" class="text-grey post_update mr-3">' +
440-
'<i class="icon-edit" title="编辑"></i> ' +
441-
'<span class="d-none">编辑</span>' +
442-
'</a> ' +
443-
'<a data-href="?post-delete-5.htm" data-confirm-text="确定删除吗?" href="javascript:void(0);" class="text-grey post_delete _confirm mr-3">' +
444-
'<i class="icon-remove" title="删除"></i> ' +
445-
'<span class="d-none">删除</span>' +
446-
'</a> ' +
447-
'<span class="floor-parent"> ' +
448-
'<span class="floor mr-0">5</span>楼 ' +
449-
'</span>' +
450-
'</div>' +
451-
'</div>' +
452-
'<div class="message mt-1 break-all"><p>玩儿翁</p> ' +
453-
'</div>' +
454-
'</div> ' +
405+
'<span style="padding-bottom:0;margin-bottom:0;color:; ">' +
406+
'<i class="iconfont icon-v1" style="font-size: !important;">管理员组 </i> ' +
407+
'</span>' +
408+
'<span class="username">' +
409+
'<a href="?user-2.htm" class="text-muted font-weight-bold">zhang</a>' +
410+
'</span>' +
411+
'<span class="date text-grey ml-2">2小时前</span>' +
412+
'</div> ' +
413+
'<div class="text-right text-grey"> ' +
414+
'<style>.haya-post-like .haya-post-like-loved {color: var(--secondary) !important;}</style> ' +
415+
'<span class="haya-post-like mr-3"> ' +
416+
'<a href="javascript:;" class="text-muted js-haya-post-like-post-add" data-pid="5" title="点赞回复">' +
417+
'<i class="icon icon-thumbs-o-up" aria-label="点赞回复"></i> ' +
418+
'<span class="haya-post-like-post-user-count">0</span>' +
419+
'</a>' +
420+
'</span>' +
421+
'<a href="javascript:void(0)" data-tid="1" data-pid="5" class="text-grey post_reply mr-3">' +
422+
'<i class="icon-reply" title="引用"></i> ' +
423+
'<span class="d-none">引用</span>' +
424+
'</a> ' +
425+
'<a href="?post-update-5.htm" class="text-grey post_update mr-3">' +
426+
'<i class="icon-edit" title="编辑"></i> ' +
427+
'<span class="d-none">编辑</span>' +
428+
'</a> ' +
429+
'<a data-href="?post-delete-5.htm" data-confirm-text="确定删除吗?" href="javascript:void(0);" class="text-grey post_delete _confirm mr-3">' +
430+
'<i class="icon-remove" title="删除"></i> ' +
431+
'<span class="d-none">删除</span>' +
432+
'</a> ' +
433+
'<span class="floor-parent"> ' +
434+
'<span class="floor mr-0">5</span>楼 ' +
435+
'</span>' +
436+
'</div>' +
437+
'</div>' +
438+
'<div class="message mt-1 break-all"><p>玩儿翁</p> ' +
439+
'</div>' +
440+
'</div> ' +
455441
'</li>' +
456442
'</ul>';
457443

0 commit comments

Comments
 (0)