Improved groups

This commit is contained in:
2018-11-22 13:36:04 +09:00
parent 7243d02e85
commit a941295a76
7 changed files with 38 additions and 8 deletions

21
pages/group/history.go Normal file
View File

@ -0,0 +1,21 @@
package group
import (
"github.com/animenotifier/arn"
"github.com/animenotifier/notify.moe/components"
"github.com/animenotifier/notify.moe/utils/history"
)
// History of the edits.
var History = history.Handler(renderHistory, "Group")
func renderHistory(obj interface{}, entries []*arn.EditLogEntry, user *arn.User) string {
group := obj.(*arn.Group)
var member *arn.GroupMember
if user != nil {
member = group.FindMember(user.ID)
}
return components.GroupTabs(group, member, user) + components.EditLog(entries, user)
}