2018-11-22 04:36:04 +00:00
|
|
|
package group
|
|
|
|
|
|
|
|
import (
|
2019-06-03 09:32:43 +00:00
|
|
|
"github.com/animenotifier/notify.moe/arn"
|
2018-11-22 04:36:04 +00:00
|
|
|
"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)
|
|
|
|
}
|
|
|
|
|
2018-11-22 07:52:29 +00:00
|
|
|
return components.GroupHeader(group, member, user) + components.EditLog(entries, user)
|
2018-11-22 04:36:04 +00:00
|
|
|
}
|