diff --git a/common/templates/templates.go b/common/templates/templates.go index 6c25bcee..828780a9 100644 --- a/common/templates/templates.go +++ b/common/templates/templates.go @@ -377,6 +377,7 @@ func (c *CTemplateSet) compile(name string, content, expects string, expectsInt c.detail("invisible") continue } + // TODO: What if the same template is invoked in multiple spots in a template? skipBlock := skipped[frag.TemplateName] skip := skipBlock.Frags[skipBlock.ClosestFragSkip] _, ok := skipBlock.Frags[frag.Index] @@ -385,7 +386,11 @@ func (c *CTemplateSet) compile(name string, content, expects string, expectsInt } c.detailf("skipblock %+v\n", skipBlock) c.detail("skipping ", skip) - writeFrag(frag.TemplateName, frag.Index-skip, frag.Body) + index := frag.Index - skip + if index < 0 { + index = 0 + } + writeFrag(frag.TemplateName, index, frag.Body) } fout = strings.Replace(fout, `)) diff --git a/langs/english.json b/langs/english.json index 59916a62..dda4308a 100644 --- a/langs/english.json +++ b/langs/english.json @@ -499,6 +499,7 @@ "quick_topic.content_placeholder":"Insert post here", "quick_topic.add_poll_option":"Add new poll option", "quick_topic.create_topic_button":"Create Topic", + "quick_topic.create_topic_button_short":"New Topic", "quick_topic.add_poll_button":"Add Poll", "quick_topic.add_file_button":"Add File", "quick_topic.cancel_button":"Cancel", @@ -506,6 +507,7 @@ "topic_list.create_topic_tooltip":"Create Topic", "topic_list.create_topic_aria":"Create a topic", "topic_list.moderate":"Moderate", + "topic_list.moderate_short":"Mod", "topic_list.moderate_tooltip":"Moderate", "topic_list.moderate_aria":"Moderate Posts", "topic_list.what_to_do":"What do you want to do with these {0} topics?", diff --git a/routes/forum.go b/routes/forum.go index affaa234..3e639a46 100644 --- a/routes/forum.go +++ b/routes/forum.go @@ -42,6 +42,7 @@ func ViewForum(w http.ResponseWriter, r *http.Request, user common.User, header return common.NoPermissions(w, r, user) } header.Zone = "view_forum" + header.Path = "/forums/" // TODO: Fix this double-check forum, err := common.Forums.Get(fid) diff --git a/templates/forum.html b/templates/forum.html index db148a3b..a5e16fd2 100644 --- a/templates/forum.html +++ b/templates/forum.html @@ -4,13 +4,14 @@ {{if ne .LastPage .Page}}
{{end}}
-
+

{{.Title}}

{{if .CurrentUser.Loggedin}}
{{if .CurrentUser.Perms.CreateTopic}} +
{{/** TODO: Add a permissions check for this **/}} diff --git a/templates/topics.html b/templates/topics.html index 15304696..be90c760 100644 --- a/templates/topics.html +++ b/templates/topics.html @@ -1,13 +1,14 @@ {{template "header.html" . }}
-
+

{{lang "topics_head"}}

{{if .CurrentUser.Loggedin}}
{{if .ForumList}}
- / {{if eq .Sort.SortBy "mostviewed" }}{{lang "topic_list.most_viewed_filter"}}{{else}}{{lang "topic_list.most_recent_filter"}}{{end}} + / + {{if eq .Sort.SortBy "mostviewed" }}{{lang "topic_list.most_viewed_filter"}}{{else}}{{lang "topic_list.most_recent_filter"}}{{end}}