All the notices now use AddNotice.

This commit is contained in:
Azareal 2018-06-06 10:29:12 +10:00
parent a5f5f4af7e
commit dd75bf9ad9
4 changed files with 12 additions and 12 deletions

View File

@ -206,10 +206,10 @@ func userCheck(w http.ResponseWriter, r *http.Request, user *User) (header *Head
} }
if user.IsBanned { if user.IsBanned {
header.NoticeList = append(header.NoticeList, GetNoticePhrase("account_banned")) header.AddNotice("account_banned")
} }
if user.Loggedin && !user.Active { if user.Loggedin && !user.Active {
header.NoticeList = append(header.NoticeList, GetNoticePhrase("account_inactive")) header.AddNotice("account_inactive")
} }
if len(theme.Resources) > 0 { if len(theme.Resources) > 0 {

View File

@ -541,7 +541,7 @@ func routePanelUsersEdit(w http.ResponseWriter, r *http.Request, user common.Use
} }
if r.FormValue("updated") == "1" { if r.FormValue("updated") == "1" {
header.NoticeList = append(header.NoticeList, common.GetNoticePhrase("panel_user_updated")) header.AddNotice("panel_user_updated")
} }
pi := common.PanelPage{&common.BasePanelPage{header, stats, "users", common.ReportForumID}, groupList, targetUser} pi := common.PanelPage{&common.BasePanelPage{header, stats, "users", common.ReportForumID}, groupList, targetUser}

View File

@ -298,7 +298,7 @@ func AccountEditAvatar(w http.ResponseWriter, r *http.Request, user common.User)
} }
header.Title = common.GetTitlePhrase("account_avatar") header.Title = common.GetTitlePhrase("account_avatar")
if r.FormValue("updated") == "1" { if r.FormValue("updated") == "1" {
header.NoticeList = append(header.NoticeList, common.GetNoticePhrase("account_avatar_updated")) header.AddNotice("account_avatar_updated")
} }
pi := common.Page{header, tList, nil} pi := common.Page{header, tList, nil}
@ -388,7 +388,7 @@ func AccountEditUsername(w http.ResponseWriter, r *http.Request, user common.Use
} }
header.Title = common.GetTitlePhrase("account_username") header.Title = common.GetTitlePhrase("account_username")
if r.FormValue("updated") == "1" { if r.FormValue("updated") == "1" {
header.NoticeList = append(header.NoticeList, common.GetNoticePhrase("account_username_updated")) header.AddNotice("account_username_updated")
} }
pi := common.Page{header, tList, user.Name} pi := common.Page{header, tList, user.Name}
@ -441,10 +441,10 @@ func AccountEditEmail(w http.ResponseWriter, r *http.Request, user common.User)
} }
if !common.Site.EnableEmails { if !common.Site.EnableEmails {
header.NoticeList = append(header.NoticeList, common.GetNoticePhrase("account_mail_disabled")) header.AddNotice("account_mail_disabled")
} }
if r.FormValue("verified") == "1" { if r.FormValue("verified") == "1" {
header.NoticeList = append(header.NoticeList, common.GetNoticePhrase("account_mail_verify_success")) header.AddNotice("account_mail_verify_success")
} }
pi := common.EmailListPage{header, emails, nil} pi := common.EmailListPage{header, emails, nil}

View File

@ -39,11 +39,11 @@ func Forums(w http.ResponseWriter, r *http.Request, user common.User) common.Rou
} }
if r.FormValue("created") == "1" { if r.FormValue("created") == "1" {
header.NoticeList = append(header.NoticeList, common.GetNoticePhrase("panel_forum_created")) header.AddNotice("panel_forum_created")
} else if r.FormValue("deleted") == "1" { } else if r.FormValue("deleted") == "1" {
header.NoticeList = append(header.NoticeList, common.GetNoticePhrase("panel_forum_deleted")) header.AddNotice("panel_forum_deleted")
} else if r.FormValue("updated") == "1" { } else if r.FormValue("updated") == "1" {
header.NoticeList = append(header.NoticeList, common.GetNoticePhrase("panel_forum_updated")) header.AddNotice("panel_forum_updated")
} }
pi := common.PanelPage{&common.BasePanelPage{header, stats, "forums", common.ReportForumID}, forumList, nil} pi := common.PanelPage{&common.BasePanelPage{header, stats, "forums", common.ReportForumID}, forumList, nil}
@ -183,7 +183,7 @@ func ForumsEdit(w http.ResponseWriter, r *http.Request, user common.User, sfid s
} }
if r.FormValue("updated") == "1" { if r.FormValue("updated") == "1" {
header.NoticeList = append(header.NoticeList, common.GetNoticePhrase("panel_forum_updated")) header.AddNotice("panel_forum_updated")
} }
pi := common.PanelEditForumPage{&common.BasePanelPage{header, stats, "forums", common.ReportForumID}, forum.ID, forum.Name, forum.Desc, forum.Active, forum.Preset, gplist} pi := common.PanelEditForumPage{&common.BasePanelPage{header, stats, "forums", common.ReportForumID}, forum.ID, forum.Name, forum.Desc, forum.Active, forum.Preset, gplist}
@ -350,7 +350,7 @@ func ForumsEditPermsAdvance(w http.ResponseWriter, r *http.Request, user common.
addNameLangToggle("MoveTopic", forumPerms.MoveTopic) addNameLangToggle("MoveTopic", forumPerms.MoveTopic)
if r.FormValue("updated") == "1" { if r.FormValue("updated") == "1" {
header.NoticeList = append(header.NoticeList, common.GetNoticePhrase("panel_forums_perms_updated")) header.AddNotice("panel_forums_perms_updated")
} }
pi := common.PanelEditForumGroupPage{&common.BasePanelPage{header, stats, "forums", common.ReportForumID}, forum.ID, gid, forum.Name, forum.Desc, forum.Active, forum.Preset, formattedPermList} pi := common.PanelEditForumGroupPage{&common.BasePanelPage{header, stats, "forums", common.ReportForumID}, forum.ID, gid, forum.Name, forum.Desc, forum.Active, forum.Preset, formattedPermList}