most viewed now works on dynamically loaded topic lists
show opts on empty forums
This commit is contained in:
parent
c6d18e5c18
commit
e47c531e5a
|
@ -201,6 +201,7 @@ type TopicListPage struct {
|
||||||
ForumList []Forum
|
ForumList []Forum
|
||||||
DefaultForum int
|
DefaultForum int
|
||||||
Sort TopicListSort
|
Sort TopicListSort
|
||||||
|
SelectedFids []int
|
||||||
QuickTools
|
QuickTools
|
||||||
Paginator
|
Paginator
|
||||||
}
|
}
|
||||||
|
@ -799,8 +800,8 @@ type AreYouSure struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Write a test for this
|
// TODO: Write a test for this
|
||||||
func DefaultHeader(w http.ResponseWriter, user *User) *Header {
|
func DefaultHeader(w http.ResponseWriter, u *User) *Header {
|
||||||
return &Header{Site: Site, Theme: Themes[fallbackTheme], CurrentUser: user, Writer: w}
|
return &Header{Site: Site, Theme: Themes[fallbackTheme], CurrentUser: u, Writer: w}
|
||||||
}
|
}
|
||||||
func SimpleDefaultHeader(w http.ResponseWriter) *Header {
|
func SimpleDefaultHeader(w http.ResponseWriter) *Header {
|
||||||
return &Header{Site: Site, Theme: Themes[fallbackTheme], CurrentUser: &GuestUser, Writer: w}
|
return &Header{Site: Site, Theme: Themes[fallbackTheme], CurrentUser: &GuestUser, Writer: w}
|
||||||
|
|
|
@ -114,10 +114,10 @@ func tmplInitHeaders(u, u2, u3 *User) (*Header, *Header, *Header) {
|
||||||
Theme: Themes[DefaultThemeBox.Load().(string)],
|
Theme: Themes[DefaultThemeBox.Load().(string)],
|
||||||
CurrentUser: u,
|
CurrentUser: u,
|
||||||
NoticeList: []string{"test"},
|
NoticeList: []string{"test"},
|
||||||
Stylesheets: []HScript{HScript{"panel.css",""}},
|
Stylesheets: []HScript{HScript{"panel.css", ""}},
|
||||||
Scripts: []HScript{HScript{"whatever.js",""}},
|
Scripts: []HScript{HScript{"whatever.js", ""}},
|
||||||
PreScriptsAsync: []HScript{HScript{"whatever.js",""}},
|
PreScriptsAsync: []HScript{HScript{"whatever.js", ""}},
|
||||||
ScriptsAsync: []HScript{HScript{"whatever.js",""}},
|
ScriptsAsync: []HScript{HScript{"whatever.js", ""}},
|
||||||
Widgets: PageWidgets{
|
Widgets: PageWidgets{
|
||||||
LeftSidebar: template.HTML("lalala"),
|
LeftSidebar: template.HTML("lalala"),
|
||||||
},
|
},
|
||||||
|
@ -227,9 +227,9 @@ func compileCommons(c *tmpl.CTemplateSet, head, head2 *Header, forumList []Forum
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
var topicsList []TopicsRowMut
|
var topicsList []TopicsRowMut
|
||||||
topic := Topic{1, "/topic/topic-title.1","Topic Title", "The topic content.", 1, false, false, now, now, user3.ID, 1, 1, "", "::1", 1, 0, 1, 1, "classname",0,"",nil}
|
topic := Topic{1, "/topic/topic-title.1", "Topic Title", "The topic content.", 1, false, false, now, now, user3.ID, 1, 1, "", "::1", 1, 0, 1, 1, "classname", 0, "", nil}
|
||||||
topicsList = append(topicsList, TopicsRowMut{&TopicsRow{topic,1, user2, "", 0, user3, "General", "/forum/general.2"}, false})
|
topicsList = append(topicsList, TopicsRowMut{&TopicsRow{topic, 1, user2, "", 0, user3, "General", "/forum/general.2"}, false})
|
||||||
topicListPage := TopicListPage{htitle("Topic List"), topicsList, forumList, Config.DefaultForum, TopicListSort{"lastupdated", false}, QuickTools{false, false, false}, Paginator{[]int{1}, 1, 1}}
|
topicListPage := TopicListPage{htitle("Topic List"), topicsList, forumList, Config.DefaultForum, TopicListSort{"lastupdated", false}, []int{1}, QuickTools{false, false, false}, Paginator{[]int{1}, 1, 1}}
|
||||||
o.Add("topics", "c.TopicListPage", topicListPage)
|
o.Add("topics", "c.TopicListPage", topicListPage)
|
||||||
o.Add("topics_mini", "c.TopicListPage", topicListPage)
|
o.Add("topics_mini", "c.TopicListPage", topicListPage)
|
||||||
|
|
||||||
|
@ -311,9 +311,9 @@ func compileTemplates(wg *sync.WaitGroup, c *tmpl.CTemplateSet, themeName string
|
||||||
t.Add("profile", "c.ProfilePage", ppage)
|
t.Add("profile", "c.ProfilePage", ppage)
|
||||||
|
|
||||||
var topicsList []TopicsRowMut
|
var topicsList []TopicsRowMut
|
||||||
topic := Topic{1, "topic-title", "Topic Title", "The topic content.", 1, false, false, now, now, user3.ID, 1, 1, "", "::1", 1, 0, 1, 1, "classname",0,"",nil}
|
topic := Topic{1, "topic-title", "Topic Title", "The topic content.", 1, false, false, now, now, user3.ID, 1, 1, "", "::1", 1, 0, 1, 1, "classname", 0, "", nil}
|
||||||
topicsList = append(topicsList, TopicsRowMut{&TopicsRow{topic,0, user2, "", 0, user3, "General", "/forum/general.2"}, false})
|
topicsList = append(topicsList, TopicsRowMut{&TopicsRow{topic, 0, user2, "", 0, user3, "General", "/forum/general.2"}, false})
|
||||||
topicListPage := TopicListPage{htitle("Topic List"), topicsList, forumList, Config.DefaultForum, TopicListSort{"lastupdated", false}, QuickTools{false, false, false}, Paginator{[]int{1}, 1, 1}}
|
topicListPage := TopicListPage{htitle("Topic List"), topicsList, forumList, Config.DefaultForum, TopicListSort{"lastupdated", false}, []int{1}, QuickTools{false, false, false}, Paginator{[]int{1}, 1, 1}}
|
||||||
|
|
||||||
forumItem := BlankForum(1, "general-forum.1", "General Forum", "Where the general stuff happens", true, "all", 0, "", 0)
|
forumItem := BlankForum(1, "general-forum.1", "General Forum", "Where the general stuff happens", true, "all", 0, "", 0)
|
||||||
forumPage := ForumPage{htitle("General Forum"), topicsList, forumItem, false, false, Paginator{[]int{1}, 1, 1}}
|
forumPage := ForumPage{htitle("General Forum"), topicsList, forumItem, false, false, Paginator{[]int{1}, 1, 1}}
|
||||||
|
@ -351,7 +351,7 @@ func compileTemplates(wg *sync.WaitGroup, c *tmpl.CTemplateSet, themeName string
|
||||||
}
|
}
|
||||||
|
|
||||||
t.AddStd("login", "c.Page", Page{htitle("Login Page"), tList, nil})
|
t.AddStd("login", "c.Page", Page{htitle("Login Page"), tList, nil})
|
||||||
t.AddStd("register", "c.RegisterPage", RegisterPage{htitle("Registration Page"), false, "",[]RegisterVerify{RegisterVerify{true,&RegisterVerifyImageGrid{"What?",[]RegisterVerifyImageGridImage{RegisterVerifyImageGridImage{"something.png"}}}}}})
|
t.AddStd("register", "c.RegisterPage", RegisterPage{htitle("Registration Page"), false, "", []RegisterVerify{RegisterVerify{true, &RegisterVerifyImageGrid{"What?", []RegisterVerifyImageGridImage{RegisterVerifyImageGridImage{"something.png"}}}}}})
|
||||||
t.AddStd("error", "c.ErrorPage", ErrorPage{htitle("Error"), "A problem has occurred in the system."})
|
t.AddStd("error", "c.ErrorPage", ErrorPage{htitle("Error"), "A problem has occurred in the system."})
|
||||||
|
|
||||||
ipSearchPage := IPSearchPage{htitle("IP Search"), map[int]*User{1: user2}, "::1"}
|
ipSearchPage := IPSearchPage{htitle("IP Search"), map[int]*User{1: user2}, "::1"}
|
||||||
|
@ -540,7 +540,7 @@ func compileJSTemplates(wg *sync.WaitGroup, c *tmpl.CTemplateSet, themeName stri
|
||||||
|
|
||||||
t := TItemHold(make(map[string]TItem))
|
t := TItemHold(make(map[string]TItem))
|
||||||
|
|
||||||
topic := Topic{1, "topic-title", "Topic Title", "The topic content.", 1, false, false, now, now, user3.ID, 1, 1, "", "::1", 1, 0, 1, 0, "classname",1,"",nil}
|
topic := Topic{1, "topic-title", "Topic Title", "The topic content.", 1, false, false, now, now, user3.ID, 1, 1, "", "::1", 1, 0, 1, 0, "classname", 1, "", nil}
|
||||||
topicsRow := TopicsRowMut{&TopicsRow{topic, 0, user2, "", 0, user3, "General", "/forum/general.2"}, false}
|
topicsRow := TopicsRowMut{&TopicsRow{topic, 0, user2, "", 0, user3, "General", "/forum/general.2"}, false}
|
||||||
t.AddStd("topics_topic", "c.TopicsRowMut", topicsRow)
|
t.AddStd("topics_topic", "c.TopicsRowMut", topicsRow)
|
||||||
|
|
||||||
|
|
|
@ -309,7 +309,7 @@ func (tList *DefaultTopicList) GetListByForum(f *Forum, page, orderby int) (topi
|
||||||
// TODO: Use something other than TopicsRow as we don't need to store the forum name and link on each and every topic item?
|
// TODO: Use something other than TopicsRow as we don't need to store the forum name and link on each and every topic item?
|
||||||
reqUserList := make(map[int]bool)
|
reqUserList := make(map[int]bool)
|
||||||
for rows.Next() {
|
for rows.Next() {
|
||||||
t := TopicsRow{Topic:Topic{ID: 0}}
|
t := TopicsRow{Topic: Topic{ID: 0}}
|
||||||
err := rows.Scan(&t.ID, &t.Title, &t.Content, &t.CreatedBy, &t.IsClosed, &t.Sticky, &t.CreatedAt, &t.LastReplyAt, &t.LastReplyBy, &t.LastReplyID, &t.ViewCount, &t.PostCount, &t.LikeCount)
|
err := rows.Scan(&t.ID, &t.Title, &t.Content, &t.CreatedBy, &t.IsClosed, &t.Sticky, &t.CreatedAt, &t.LastReplyAt, &t.LastReplyBy, &t.LastReplyID, &t.ViewCount, &t.PostCount, &t.LikeCount)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, Paginator{nil, 1, 1}, err
|
return nil, Paginator{nil, 1, 1}, err
|
||||||
|
@ -389,7 +389,7 @@ func (tList *DefaultTopicList) GetListByCanSee(canSee []int, page, orderby int,
|
||||||
// ? - Would it be useful, if we could post in social groups from /topics/?
|
// ? - Would it be useful, if we could post in social groups from /topics/?
|
||||||
for _, fid := range canSee {
|
for _, fid := range canSee {
|
||||||
f := Forums.DirtyGet(fid)
|
f := Forums.DirtyGet(fid)
|
||||||
if f.Name != "" && f.Active && (f.ParentType == "" || f.ParentType == "forum") && f.TopicCount != 0 {
|
if f.Name != "" && f.Active && (f.ParentType == "" || f.ParentType == "forum") /*&& f.TopicCount != 0*/ {
|
||||||
fcopy := f.Copy()
|
fcopy := f.Copy()
|
||||||
// TODO: Add a hook here for plugin_guilds !!
|
// TODO: Add a hook here for plugin_guilds !!
|
||||||
forumList = append(forumList, fcopy)
|
forumList = append(forumList, fcopy)
|
||||||
|
@ -397,8 +397,8 @@ func (tList *DefaultTopicList) GetListByCanSee(canSee []int, page, orderby int,
|
||||||
}
|
}
|
||||||
|
|
||||||
inSlice := func(haystack []int, needle int) bool {
|
inSlice := func(haystack []int, needle int) bool {
|
||||||
for _, item := range haystack {
|
for _, it := range haystack {
|
||||||
if needle == item {
|
if needle == it {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -443,10 +443,10 @@ func (tList *DefaultTopicList) GetList(page, orderby int, filterIDs []int) (topi
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, nil, Paginator{nil, 1, 1}, err
|
return nil, nil, Paginator{nil, 1, 1}, err
|
||||||
}
|
}
|
||||||
|
//log.Printf("cCanSee: %+v\n", cCanSee)
|
||||||
inSlice := func(haystack []int, needle int) bool {
|
inSlice := func(haystack []int, needle int) bool {
|
||||||
for _, item := range haystack {
|
for _, it := range haystack {
|
||||||
if needle == item {
|
if needle == it {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -463,13 +463,14 @@ func (tList *DefaultTopicList) GetList(page, orderby int, filterIDs []int) (topi
|
||||||
} else {
|
} else {
|
||||||
canSee = cCanSee
|
canSee = cCanSee
|
||||||
}
|
}
|
||||||
|
//log.Printf("canSee: %+v\n", canSee)
|
||||||
|
|
||||||
// We need a list of the visible forums for Quick Topic
|
// We need a list of the visible forums for Quick Topic
|
||||||
// ? - Would it be useful, if we could post in social groups from /topics/?
|
// ? - Would it be useful, if we could post in social groups from /topics/?
|
||||||
var topicCount int
|
var topicCount int
|
||||||
for _, fid := range canSee {
|
for _, fid := range canSee {
|
||||||
f := Forums.DirtyGet(fid)
|
f := Forums.DirtyGet(fid)
|
||||||
if f.Name != "" && f.Active && (f.ParentType == "" || f.ParentType == "forum") && f.TopicCount != 0 {
|
if f.Name != "" && f.Active && (f.ParentType == "" || f.ParentType == "forum") /*&& f.TopicCount != 0*/ {
|
||||||
fcopy := f.Copy()
|
fcopy := f.Copy()
|
||||||
// TODO: Add a hook here for plugin_guilds
|
// TODO: Add a hook here for plugin_guilds
|
||||||
forumList = append(forumList, fcopy)
|
forumList = append(forumList, fcopy)
|
||||||
|
@ -495,6 +496,9 @@ func (tList *DefaultTopicList) GetList(page, orderby int, filterIDs []int) (topi
|
||||||
// TODO: Rename this to TopicListStore and pass back a TopicList instance holding the pagination data and topic list rather than passing them back one argument at a time
|
// TODO: Rename this to TopicListStore and pass back a TopicList instance holding the pagination data and topic list rather than passing them back one argument at a time
|
||||||
// TODO: Make orderby an enum of sorts
|
// TODO: Make orderby an enum of sorts
|
||||||
func (tList *DefaultTopicList) getList(page, orderby, topicCount int, argList []interface{}, qlist string) (topicList []*TopicsRow, paginator Paginator, err error) {
|
func (tList *DefaultTopicList) getList(page, orderby, topicCount int, argList []interface{}, qlist string) (topicList []*TopicsRow, paginator Paginator, err error) {
|
||||||
|
if topicCount == 0 {
|
||||||
|
return nil, Paginator{nil, 1, 1}, err
|
||||||
|
}
|
||||||
//log.Printf("argList: %+v\n",argList)
|
//log.Printf("argList: %+v\n",argList)
|
||||||
//log.Printf("qlist: %+v\n",qlist)
|
//log.Printf("qlist: %+v\n",qlist)
|
||||||
var orderq string
|
var orderq string
|
||||||
|
|
|
@ -554,12 +554,12 @@ function mainInit(){
|
||||||
|
|
||||||
// TODO: Try to de-duplicate some of these fetch calls
|
// TODO: Try to de-duplicate some of these fetch calls
|
||||||
fetch(url+q+"&js=1",{credentials:"same-origin"})
|
fetch(url+q+"&js=1",{credentials:"same-origin"})
|
||||||
.then(resp => {
|
.then(r => {
|
||||||
if(!resp.ok) throw(url+q+"&js=1 failed to load");
|
if(!r.ok) throw(url+q+"&js=1 failed to load");
|
||||||
return resp.json();
|
return r.json();
|
||||||
}).then(dat => {
|
}).then(d => {
|
||||||
if(!"Topics" in dat) throw("no Topics in data");
|
if(!"Topics" in d) throw("no Topics in data");
|
||||||
let topics = dat["Topics"];
|
let topics = d["Topics"];
|
||||||
log("ajax navigated to different page");
|
log("ajax navigated to different page");
|
||||||
|
|
||||||
// TODO: Fix the data race where the function hasn't been loaded yet
|
// TODO: Fix the data race where the function hasn't been loaded yet
|
||||||
|
@ -569,10 +569,10 @@ function mainInit(){
|
||||||
|
|
||||||
let obj = {Title:document.title,Url:url+q};
|
let obj = {Title:document.title,Url:url+q};
|
||||||
history.pushState(obj,obj.Title,obj.Url);
|
history.pushState(obj,obj.Title,obj.Url);
|
||||||
rebuildPaginator(dat.LastPage);
|
rebuildPaginator(d.LastPage);
|
||||||
rebindPaginator();
|
rebindPaginator();
|
||||||
}).catch(e => {
|
}).catch(e => {
|
||||||
log("Unable to get script '"+url+q+"&js=1"+"'",e);
|
log("Unable to get script "+url+q+"&js=1",e);
|
||||||
console.trace();
|
console.trace();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -587,14 +587,14 @@ function mainInit(){
|
||||||
// TODO: Take mostviewed into account
|
// TODO: Take mostviewed into account
|
||||||
let url = "//"+window.location.host+"/topics/?fids="+fid;
|
let url = "//"+window.location.host+"/topics/?fids="+fid;
|
||||||
|
|
||||||
fetch(url+"&js=1",{credentials: "same-origin"})
|
fetch(url+"&js=1",{credentials:"same-origin"})
|
||||||
.then(resp => {
|
.then(r => {
|
||||||
if(!resp.ok) throw(url+"&js=1 failed to load");
|
if(!r.ok) throw(url+"&js=1 failed to load");
|
||||||
return resp.json();
|
return r.json();
|
||||||
}).then(dat => {
|
}).then(d => {
|
||||||
log("data",dat);
|
log("data",d);
|
||||||
if(!"Topics" in dat) throw("no Topics in data");
|
if(!"Topics" in d) throw("no Topics in data");
|
||||||
let topics = dat["Topics"];
|
let topics = d["Topics"];
|
||||||
log("ajax navigated to "+that.innerText);
|
log("ajax navigated to "+that.innerText);
|
||||||
|
|
||||||
// TODO: Fix the data race where the function hasn't been loaded yet
|
// TODO: Fix the data race where the function hasn't been loaded yet
|
||||||
|
@ -608,7 +608,7 @@ function mainInit(){
|
||||||
else document.title = baseTitle;
|
else document.title = baseTitle;
|
||||||
let obj = {Title:document.title,Url:url};
|
let obj = {Title:document.title,Url:url};
|
||||||
history.pushState(obj,obj.Title,obj.Url);
|
history.pushState(obj,obj.Title,obj.Url);
|
||||||
rebuildPaginator(dat.LastPage)
|
rebuildPaginator(d.LastPage)
|
||||||
rebindPaginator();
|
rebindPaginator();
|
||||||
|
|
||||||
$(".filter_item").each(function(){
|
$(".filter_item").each(function(){
|
||||||
|
@ -616,16 +616,18 @@ function mainInit(){
|
||||||
});
|
});
|
||||||
that.classList.add("filter_selected");
|
that.classList.add("filter_selected");
|
||||||
$(".topic_list_title h1").text(that.innerText);
|
$(".topic_list_title h1").text(that.innerText);
|
||||||
|
$(".link_select .link_option .link_recent").attr("href","//"+window.location.host+"/topics/?fids="+fid);
|
||||||
|
$(".link_select .link_option .link_most_viewed").attr("href","//"+window.location.host+"/topics/most-viewed/?fids="+fid);
|
||||||
unbindPage();
|
unbindPage();
|
||||||
bindPage();
|
bindPage();
|
||||||
}).catch(e => {
|
}).catch(e => {
|
||||||
log("Unable to get script '"+url+"&js=1"+"'",e);
|
log("Unable to get script "+url+"&js=1",e);
|
||||||
console.trace();
|
console.trace();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
if (document.getElementById("topicsItemList")!==null) rebindPaginator();
|
if(document.getElementById("topicsItemList")!==null) rebindPaginator();
|
||||||
if (document.getElementById("forumItemList")!==null) rebindPaginator();
|
if(document.getElementById("forumItemList")!==null) rebindPaginator();
|
||||||
|
|
||||||
// TODO: Show a search button when JS is disabled?
|
// TODO: Show a search button when JS is disabled?
|
||||||
$(".widget_search_input").keypress(function(e) {
|
$(".widget_search_input").keypress(function(e) {
|
||||||
|
@ -642,12 +644,12 @@ function mainInit(){
|
||||||
|
|
||||||
// TODO: Try to de-duplicate some of these fetch calls
|
// TODO: Try to de-duplicate some of these fetch calls
|
||||||
fetch(url+q+"&js=1",{credentials:"same-origin"})
|
fetch(url+q+"&js=1",{credentials:"same-origin"})
|
||||||
.then(resp => {
|
.then(r => {
|
||||||
if(!resp.ok) throw(url+q+"&js=1 failed to load");
|
if(!r.ok) throw(url+q+"&js=1 failed to load");
|
||||||
return resp.json();
|
return r.json();
|
||||||
}).then(data => {
|
}).then(d => {
|
||||||
if(!"Topics" in data) throw("no Topics in data");
|
if(!"Topics" in d) throw("no Topics in data");
|
||||||
let topics = data["Topics"];
|
let topics = d["Topics"];
|
||||||
log("ajax navigated to search page");
|
log("ajax navigated to search page");
|
||||||
|
|
||||||
// TODO: Fix the data race where the function hasn't been loaded yet
|
// TODO: Fix the data race where the function hasn't been loaded yet
|
||||||
|
@ -661,10 +663,10 @@ function mainInit(){
|
||||||
else document.title = baseTitle;
|
else document.title = baseTitle;
|
||||||
let obj = {Title: document.title, Url: url+q};
|
let obj = {Title: document.title, Url: url+q};
|
||||||
history.pushState(obj,obj.Title,obj.Url);
|
history.pushState(obj,obj.Title,obj.Url);
|
||||||
rebuildPaginator(data.LastPage);
|
rebuildPaginator(d.LastPage);
|
||||||
rebindPaginator();
|
rebindPaginator();
|
||||||
}).catch(e => {
|
}).catch(e => {
|
||||||
log("Unable to get script '"+url+q+"&js=1"+"'",e);
|
log("Unable to get script "+url+q+"&js=1",e);
|
||||||
console.trace();
|
console.trace();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -906,14 +908,14 @@ function mainInit(){
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return resp.text();
|
return resp.text();
|
||||||
}).then(dat => {
|
}).then(d => {
|
||||||
document.querySelector("#back").outerHTML = dat;
|
document.querySelector("#back").outerHTML = d;
|
||||||
if(h!==null) h(dat);
|
if(h!==null) h(d);
|
||||||
$(".elapsed").remove();
|
$(".elapsed").remove();
|
||||||
let obj = {Title:document.title,Url:base};
|
let obj = {Title:document.title,Url:base};
|
||||||
history.pushState(obj,obj.Title,obj.Url);
|
history.pushState(obj,obj.Title,obj.Url);
|
||||||
}).catch(e => {
|
}).catch(e => {
|
||||||
log("Unable to get script '"+href+""+"'",e);
|
log("Unable to get script "+href,e);
|
||||||
console.trace();
|
console.trace();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -239,7 +239,8 @@ func TopicListCommon(w http.ResponseWriter, r *http.Request, user *c.User, h *c.
|
||||||
}
|
}
|
||||||
|
|
||||||
h.Title = phrases.GetTitlePhrase("topics_search")
|
h.Title = phrases.GetTitlePhrase("topics_search")
|
||||||
pi := c.TopicListPage{h, topicList2, forumList, c.Config.DefaultForum, c.TopicListSort{torder, false}, c.QuickTools{canDelete, canLock, canMove}, pagi}
|
//log.Printf("cfids: %+v\n", cfids)
|
||||||
|
pi := c.TopicListPage{h, topicList2, forumList, c.Config.DefaultForum, c.TopicListSort{torder, false}, cfids, c.QuickTools{canDelete, canLock, canMove}, pagi}
|
||||||
return renderTemplate("topics", w, r, h, pi)
|
return renderTemplate("topics", w, r, h, pi)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -305,7 +306,7 @@ func TopicListCommon(w http.ResponseWriter, r *http.Request, user *c.User, h *c.
|
||||||
topicList2[i] = c.TopicsRowMut{t, canMod}
|
topicList2[i] = c.TopicsRowMut{t, canMod}
|
||||||
}
|
}
|
||||||
|
|
||||||
pi := c.TopicListPage{h, topicList2, forumList, c.Config.DefaultForum, c.TopicListSort{torder, false}, c.QuickTools{canDelete, canLock, canMove}, pagi}
|
pi := c.TopicListPage{h, topicList2, forumList, c.Config.DefaultForum, c.TopicListSort{torder, false}, fids, c.QuickTools{canDelete, canLock, canMove}, pagi}
|
||||||
if r.FormValue("i") == "1" {
|
if r.FormValue("i") == "1" {
|
||||||
return renderTemplate("topics_mini", w, r, h, pi)
|
return renderTemplate("topics_mini", w, r, h, pi)
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,10 +11,10 @@
|
||||||
<a href="#"class="filter_opt_label link_label"data-for="topic_list_filter_select">{{if eq .Sort.SortBy "mostviewed"}}{{lang "topic_list.most_viewed_filter"}}{{else}}{{lang "topic_list.most_recent_filter"}}{{end}} <span class="filter_opt_pointy">▾</span></a>
|
<a href="#"class="filter_opt_label link_label"data-for="topic_list_filter_select">{{if eq .Sort.SortBy "mostviewed"}}{{lang "topic_list.most_viewed_filter"}}{{else}}{{lang "topic_list.most_recent_filter"}}{{end}} <span class="filter_opt_pointy">▾</span></a>
|
||||||
<div id="topic_list_filter_select"class="link_select">
|
<div id="topic_list_filter_select"class="link_select">
|
||||||
<div class="link_option link_selected">
|
<div class="link_option link_selected">
|
||||||
<a href="/topics/">{{lang "topic_list.most_recent_filter"}}</a>
|
<a class="link_recent"href="/topics/{{if .SelectedFids}}?fids={{range .SelectedFids}}{{.}}{{end}}{{end}}">{{lang "topic_list.most_recent_filter"}}</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="link_option">
|
<div class="link_option">
|
||||||
<a href="/topics/most-viewed/">{{lang "topic_list.most_viewed_filter"}}</a>
|
<a class="link_most_viewed"href="/topics/most-viewed/{{if .SelectedFids}}?fids={{range .SelectedFids}}{{.}}{{end}}{{end}}">{{lang "topic_list.most_viewed_filter"}}</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue