File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -123,6 +123,9 @@ var funcMap = template.FuncMap{
123
123
}
124
124
return total
125
125
},
126
+ "sub" : func (num1 , num2 int ) int {
127
+ return num1 - num2
128
+ },
126
129
"mod" : func (num1 , num2 int ) int {
127
130
if num1 == 0 {
128
131
num1 = rand .Intn (500 )
Original file line number Diff line number Diff line change 39
39
{{with $pageMax := divide .total .cmt_per_num}}
40
40
< td width ="92% " align ="left ">
41
41
{{range $i, $v := genList $.total $.cmt_per_num}}
42
- < a href ="/balance?p={{$v}} " class ="{{if eq $v $.cur_p}}page_current{{else}}page_normal{{end}} "> {{$v}}</ a >
42
+ {{if gt $pageMax 20}}
43
+ {{if lt $i 10}}
44
+ < a href ="/balance?p={{$v}} " class ="{{if eq $v $.cur_p}}page_current{{else}}page_normal{{end}} "> {{$v}}</ a >
45
+ {{else if gt $i (sub $pageMax 11)}}
46
+ < a href ="/balance?p={{$v}} " class ="{{if eq $v $.cur_p}}page_current{{else}}page_normal{{end}} "> {{$v}}</ a >
47
+ {{else if eq $i 11}}
48
+ < a href ="# " class ="page_normal disable_now "> ...</ a >
49
+ {{end}}
50
+ {{else}}
51
+ < a href ="/balance?p={{$v}} " class ="{{if eq $v $.cur_p}}page_current{{else}}page_normal{{end}} "> {{$v}}</ a >
52
+ {{end}}
43
53
{{end}}
44
54
< input type ="number " class ="page_input " autocomplete ="off " value ="{{$.cur_p}} " min ="1 " max ="{{$pageMax}} ">
45
55
</ td >
You can’t perform that action at this time.
0 commit comments