Rename ThreadUnread to just Unread

This commit is contained in:
Asaf Gartner 2021-09-24 03:15:29 +03:00
parent f8985e6ee3
commit a3e7e2afc0
3 changed files with 5 additions and 5 deletions

View File

@ -293,7 +293,7 @@ func fetchAllPosts(c *RequestContext, offset int, limit int) ([]templates.PostLi
&postAndStuff.Thread, &postAndStuff.Thread,
&postAndStuff.Post, &postAndStuff.Post,
postAndStuff.Author, postAndStuff.Author,
postAndStuff.ThreadUnread, postAndStuff.Unread,
true, true,
c.Theme, c.Theme,
) )

View File

@ -142,7 +142,7 @@ func Index(c *RequestContext) ResponseData {
Url: hmnurl.BuildBlogThread(proj.Slug, projectPost.Thread.ID, projectPost.Thread.Title), Url: hmnurl.BuildBlogThread(proj.Slug, projectPost.Thread.ID, projectPost.Thread.Title),
User: templates.UserToTemplate(projectPost.Author, c.Theme), User: templates.UserToTemplate(projectPost.Author, c.Theme),
Date: projectPost.Post.PostDate, Date: projectPost.Post.PostDate,
Unread: projectPost.ThreadUnread, Unread: projectPost.Unread,
Content: template.HTML(content), Content: template.HTML(content),
} }
} else { } else {
@ -154,7 +154,7 @@ func Index(c *RequestContext) ResponseData {
&projectPost.Thread, &projectPost.Thread,
&projectPost.Post, &projectPost.Post,
projectPost.Author, projectPost.Author,
projectPost.ThreadUnread, projectPost.Unread,
false, false,
c.Theme, c.Theme,
), ),

View File

@ -279,7 +279,7 @@ type PostsQuery struct {
type PostAndStuff struct { type PostAndStuff struct {
Project models.Project `db:"project"` Project models.Project `db:"project"`
Thread models.Thread `db:"thread"` Thread models.Thread `db:"thread"`
ThreadUnread bool Unread bool
Post models.Post `db:"post"` Post models.Post `db:"post"`
CurrentVersion models.PostVersion `db:"ver"` CurrentVersion models.PostVersion `db:"ver"`
Author *models.User `db:"author"` // Can be nil in case of a deleted user Author *models.User `db:"author"` // Can be nil in case of a deleted user
@ -408,7 +408,7 @@ func FetchPosts(
} else if row.ForumLastReadTime != nil && row.ForumLastReadTime.After(row.Post.PostDate) { } else if row.ForumLastReadTime != nil && row.ForumLastReadTime.After(row.Post.PostDate) {
hasRead = true hasRead = true
} }
row.ThreadUnread = !hasRead row.Unread = !hasRead
if row.ReplyPost != nil && row.ReplyAuthor != nil { if row.ReplyPost != nil && row.ReplyAuthor != nil {
replyAuthorIsNotApproved := row.ReplyAuthor.Status != models.UserStatusApproved replyAuthorIsNotApproved := row.ReplyAuthor.Status != models.UserStatusApproved