Show an inline error when there aren't any topics instead of a 404.
Use a non-breaking space in the no topics error.
This commit is contained in:
parent
bffb095b57
commit
65eadbd4b6
|
@ -179,10 +179,6 @@ func TopicListCommon(w http.ResponseWriter, r *http.Request, user c.User, header
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return c.InternalError(err, w, r)
|
return c.InternalError(err, w, r)
|
||||||
}
|
}
|
||||||
// ! Need an inline error not a page level error
|
|
||||||
if len(topicList) == 0 {
|
|
||||||
return c.NotFound(w, r, header)
|
|
||||||
}
|
|
||||||
|
|
||||||
// TODO: Reduce the amount of boilerplate here
|
// TODO: Reduce the amount of boilerplate here
|
||||||
if r.FormValue("js") == "1" {
|
if r.FormValue("js") == "1" {
|
||||||
|
|
|
@ -78,7 +78,7 @@
|
||||||
<div class="rowitem rowmsg"><a href="" class="more_topics"></a></div>
|
<div class="rowitem rowmsg"><a href="" class="more_topics"></a></div>
|
||||||
</div>
|
</div>
|
||||||
<div id="topic_list" class="rowblock topic_list topic_list_{{.Sort.SortBy}}" aria-label="{{lang "topics_list_aria"}}">
|
<div id="topic_list" class="rowblock topic_list topic_list_{{.Sort.SortBy}}" aria-label="{{lang "topics_list_aria"}}">
|
||||||
{{range .TopicList}}{{template "topics_topic.html" . }}{{else}}<div class="rowitem passive rowmsg">{{lang "topics_no_topics"}}{{if .CurrentUser.Loggedin}}{{if .CurrentUser.Perms.CreateTopic}} <a href="/topics/create/">{{lang "topics_start_one"}}</a>{{end}}{{end}}</div>{{end}}
|
{{range .TopicList}}{{template "topics_topic.html" . }}{{else}}<div class="rowitem passive rowmsg">{{lang "topics_no_topics"}}{{if .CurrentUser.Loggedin}}{{if .CurrentUser.Perms.CreateTopic}} <a href="/topics/create/">{{lang "topics_start_one"}}</a>{{end}}{{end}}</div>{{end}}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{template "paginator.html" . }}
|
{{template "paginator.html" . }}
|
||||||
|
|
Loading…
Reference in New Issue