commit 1d717451bebb68df0a3decb8dd7983e58544d4c9
parent fadb646042f16c4ec2da2e9280a37d4ea78f3d82
Author: Peter Kosyh <p.kosyh@gmail.com>
Date: Tue, 8 Sep 2020 11:10:06 +0300
rss crash, all posts link
Diffstat:
2 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/ii-node/tpl/header.tpl b/ii-node/tpl/header.tpl
@@ -14,7 +14,9 @@
<tr>
<td class="title">
<span class="logo"><a href="/">{{.Sysname}}</a></span>
-{{if gt (len .Topics) 0}}
+ {{ if eq .BasePath "" }}
+ <span class="info">II/IDEC networks :: <a href="/echo/all">All posts</a>
+ {{ else if gt (len .Topics) 0}}
<span class="info">II/IDEC networks {{ with .Echo }} :: <a href="/echo/{{.}}">{{.}}</a> <span class="info">{{index $.Echolist.Info .}}</span>{{end}}
{{ else }}
<span class="info">II/IDEC networks {{ with .Echo }} :: <a href="/{{.}}">{{.}}</a> <span class="info">{{index $.Echolist.Info .}}</span>{{end}}
diff --git a/ii-node/web.go b/ii-node/web.go
@@ -325,7 +325,7 @@ func www_query(ctx *WebContext, w http.ResponseWriter, r *http.Request, q ii.Que
return mis[i].Off > mis[j].Off
})
count := len(mis)
- if rss {
+ if rss && count > 100 {
count = 100
}
start := makePager(ctx, count, page)
@@ -936,8 +936,12 @@ func _handleWWW(ctx *WebContext, w http.ResponseWriter, r *http.Request) error {
fmt.Sscanf(args[2], "%d", &page)
}
}
+ e := args[1]
+ if args[1] == "all" {
+ e = ""
+ }
ctx.BasePath = "echo/" + args[1]
- return www_query(ctx, w, r, ii.Query { Echo: args[1] }, page, rss)
+ return www_query(ctx, w, r, ii.Query { Echo: e }, page, rss)
} else if ii.IsEcho(args[0]) {
page := 1
if len(args) > 1 {