link forums page topics to last page

This commit is contained in:
Azareal 2020-08-19 15:39:45 +10:00
parent e4242eb580
commit 2211d2ef11
5 changed files with 13 additions and 14 deletions

View File

@ -153,10 +153,10 @@ var imageExts = ["png","jpg","jpe","jpeg","jif","jfi","jfif","svg","bmp","gif","
addInitHook("end_bind_topic", () => { addInitHook("end_bind_topic", () => {
log("in member.js end_bind_topic") log("in member.js end_bind_topic")
let changeListener = (files,handler) => { let changeListener = (files,h) => {
if(files!=null) { if(files!=null) {
files.removeEventListener("change", handler, false); files.removeEventListener("change", h, false);
files.addEventListener("change", handler, false); files.addEventListener("change", h, false);
} }
}; };
let uploadFiles = document.getElementById("upload_files"); let uploadFiles = document.getElementById("upload_files");
@ -306,9 +306,7 @@ var imageExts = ["png","jpg","jpe","jpeg","jif","jfi","jfif","svg","bmp","gif","
data: JSON.stringify(selectedTopics), data: JSON.stringify(selectedTopics),
contentType: "application/json", contentType: "application/json",
error: ajaxError, error: ajaxError,
success: () => { success: () => window.location.reload()
window.location.reload();
}
}); });
}; };
// TODO: Should we unbind this here to avoid binding multiple listeners to this accidentally? // TODO: Should we unbind this here to avoid binding multiple listeners to this accidentally?

View File

@ -110,8 +110,8 @@ func TopicListCommon(w http.ResponseWriter, r *http.Request, user *c.User, h *c.
var cfids []int var cfids []int
if len(fids) > 0 { if len(fids) > 0 {
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
} }
} }

View File

@ -18,8 +18,9 @@
<span class="forum_right shift_right"> <span class="forum_right shift_right">
{{if .LastReplyer.MicroAvatar}}<a href="{{.LastReplyer.Link}}"><img class="extra_little_row_avatar"src="{{.LastReplyer.MicroAvatar}}"height=64 width=64 alt="Avatar"title="{{.LastReplyer.Name}}'s Avatar"aria-hidden="true"></a>{{end}} {{if .LastReplyer.MicroAvatar}}<a href="{{.LastReplyer.Link}}"><img class="extra_little_row_avatar"src="{{.LastReplyer.MicroAvatar}}"height=64 width=64 alt="Avatar"title="{{.LastReplyer.Name}}'s Avatar"aria-hidden="true"></a>{{end}}
<span> <span>
<a {{if .LastTopic.Link}}class="forum_poster"href="{{.LastTopic.Link}}"{{else}}class="forum_no_poster"{{end}}>{{if .LastTopic.Title}}{{.LastTopic.Title}}{{else}}{{lang "forums_none"}}{{end}}</a> <a class={{if .LastTopic.Link}}"forum_poster"href="{{.LastTopic.Link}}"{{else}}"forum_no_poster"{{end}}>{{if .LastTopic.Title}}{{.LastTopic.Title}}{{else}}{{lang "forums_none"}}{{end}}</a>
{{if .LastTopicTime}}<br><span class="rowsmall"title="{{abstime .LastTopic.LastReplyAt}}">{{.LastTopicTime}}</span>{{end}} {{/**{{if .LastTopicTime}}<br><span class="rowsmall"title="{{abstime .LastTopic.LastReplyAt}}">{{.LastTopicTime}}</span>{{end}}**/}}
<br><a href="{{.LastTopic.Link}}{{if ne .LastPage 1}}?page={{.LastPage}}{{end}}{{if .LastTopic.LastReplyID}}#post-{{.LastTopic.LastReplyID}}{{end}}"class="rowsmall lastReplyAt"title="{{abstime .LastTopic.LastReplyAt}}">{{.LastTopicTime}}</a>
</span> </span>
</span><div style="clear:both;"></div> </span><div style="clear:both;"></div>
</div> </div>

View File

@ -1,5 +1,5 @@
<article class="rowblock post_container poll"aria-level="{{lang "topic.poll_aria"}}"> <article class="rowblock post_container poll"aria-level="{{lang "topic.poll_aria"}}">
<div class="rowitem passive editable_parent post_item poll_item {{.Topic.ClassName}}" style="background-image:url({{.Topic.Avatar}}),url(/s/{{.Header.Theme.Name}}/post-avatar-bg.jpg);background-position:0px {{if le .Topic.ContentLines 5}}-1{{end}}0px;background-repeat:no-repeat,repeat-y;"> <div class="rowitem passive editable_parent post_item poll_item {{.Topic.ClassName}}"style="background-image:url({{.Topic.Avatar}}),url(/s/{{.Header.Theme.Name}}/post-avatar-bg.jpg);background-position:0px {{if le .Topic.ContentLines 5}}-1{{end}}0px;background-repeat:no-repeat,repeat-y;">
<div class="topic_content user_content"> <div class="topic_content user_content">
{{range .Poll.QuickOptions}} {{range .Poll.QuickOptions}}
<div class="poll_option"> <div class="poll_option">

View File

@ -1,7 +1,7 @@
<div class="topic_row{{if .Sticky}} topic_sticky{{else if .IsClosed}} topic_closed{{end}}{{if .CanMod}} can_mod{{end}}" data-tid="{{.ID}}"> <div class="topic_row{{if .Sticky}} topic_sticky{{else if .IsClosed}} topic_closed{{end}}{{if .CanMod}} can_mod{{end}}"data-tid={{.ID}}>
<div class="rowitem topic_left passive datarow"> <div class="rowitem topic_left passive datarow">
<span class="selector"></span> <span class="selector"></span>
<a href="{{.Creator.Link}}"><img src="{{.Creator.MicroAvatar}}"height=64 alt="Avatar"title="{{.Creator.Name}}'s Avatar"aria-hidden="true"></a> <a href="{{.Creator.Link}}"><img src="{{.Creator.MicroAvatar}}"alt="Avatar"title="{{.Creator.Name}}'s Avatar"aria-hidden="true"height=64></a>
<span class="topic_inner_left"> <span class="topic_inner_left">
<a class="rowtopic"href="{{.Link}}"itemprop="itemListElement"title="{{.Title}}"><span>{{.Title}}</span></a> {{if .ForumName}}<a class="rowsmall parent_forum"href="{{.ForumLink}}"title="{{.ForumName}}">{{.ForumName}}</a>{{end}} <a class="rowtopic"href="{{.Link}}"itemprop="itemListElement"title="{{.Title}}"><span>{{.Title}}</span></a> {{if .ForumName}}<a class="rowsmall parent_forum"href="{{.ForumLink}}"title="{{.ForumName}}">{{.ForumName}}</a>{{end}}
<br><a class="rowsmall starter"href="{{.Creator.Link}}"title="{{.Creator.Name}}">{{.Creator.Name}}</a> <br><a class="rowsmall starter"href="{{.Creator.Link}}"title="{{.Creator.Name}}">{{.Creator.Name}}</a>
@ -24,7 +24,7 @@
</div> </div>
<div class="rowitem topic_right passive datarow"> <div class="rowitem topic_right passive datarow">
<div class="topic_right_inside"> <div class="topic_right_inside">
<a href="{{.LastUser.Link}}"><img src="{{.LastUser.MicroAvatar}}"height=64 alt="Avatar"title="{{.LastUser.Name}}'s Avatar"aria-hidden="true"></a> <a href="{{.LastUser.Link}}"><img src="{{.LastUser.MicroAvatar}}"alt="Avatar"title="{{.LastUser.Name}}'s Avatar"aria-hidden="true"height=64></a>
<span> <span>
<a href="{{.LastUser.Link}}"class="lastName"title="{{.LastUser.Name}}">{{.LastUser.Name}}</a><br> <a href="{{.LastUser.Link}}"class="lastName"title="{{.LastUser.Name}}">{{.LastUser.Name}}</a><br>
<a href="{{.Link}}?page={{.LastPage}}{{if .LastReplyID}}#post-{{.LastReplyID}}{{end}}"class="rowsmall lastReplyAt"title="{{abstime .LastReplyAt}}">{{reltime .LastReplyAt}}</a> <a href="{{.Link}}?page={{.LastPage}}{{if .LastReplyID}}#post-{{.LastReplyID}}{{end}}"class="rowsmall lastReplyAt"title="{{abstime .LastReplyAt}}">{{reltime .LastReplyAt}}</a>