forked from jimmykuu/gopher
-
Notifications
You must be signed in to change notification settings - Fork 0
/
search.html
51 lines (49 loc) · 1.67 KB
/
search.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
{{define "Title"}}搜索结果{{end}}
{{define "ContentWidth"}}10{{end}}
{{define "Breadcrumb"}}
<ul class="breadcrumb">
<li><a href="/"><i class="glyphicon glyphicon-home"></i> 首页</a></li>
<li class="active">搜索结果</li>
</ul>
{{end}}
{{define "Content"}}
<div class="content">
<form action="/search" method="get" role="form" style="margin-bottom: 2em;">
<div class="input-group">
<input type="text" name="q" class="form-control" value="{{.q}}">
<span class="input-group-btn">
<button type="submit" class="btn btn-info">搜索</button>
</span>
</div>
</form>
<dl class="topics">
{{range .topics}}
{{$creater := .Creater $.db}}
{{$node := .Node $.db}}
{{$latestReplier := .LatestReplier $.db}}
<dd>
<a href="/member/{{$creater.Username}}" class="pull-left" style="margin-right: 10px;"><img src="{{$creater.AvatarImgSrc 48}}" class="img-rounded"></a>
{{if .CommentCount}}
<a class="badge pull-right" href="/t/{{.Id_.Hex}}#.LatestReplyId.Hex">{{.CommentCount}}</a>
{{end}}
<a href="/t/{{.Id_.Hex}}" class="title">{{.Title}}</a>
<div class="space"></div>
<div class="info" style="margin-left:60px;">
<a class="label label-info" href="/go/{{$node.Id}}">{{$node.Name}}</a> •
<a href="/member/{{$creater.Username}}"><strong>{{$creater.Username}}</strong></a> •
{{if .CommentCount}}
{{formattime .LatestRepliedAt}} • 最后回复来自 <a href="/member/{{$latestReplier.Username}}">{{$latestReplier.Username}}</a>
{{else}}
{{formattime .CreatedAt}}
{{end}}
</div>
<div class="clear"></div>
</dd>
{{end}}
</dl>
<hr>
{{.pagination.Html .page}}
</div>
{{end}}
{{define "LeftSide"}}{{end}}
{{define "RightSide"}}{{end}}