93364dac77
List Torrent delete log Torrent edit log Comment delete log And every other logged activities Can be filtered out by a filter tag ("edit" or "delete" supported) Pages navigation Can be accessed by /activities Added some translation string Fixed hidden username on api request Fixed comments username on modpanel New Activity model New Activity handler New Activity Service Fixed some updating issue for ES when moderating torrents Be aware deleting torrents and comments return the model now!
27 lignes
574 o
Go
27 lignes
574 o
Go
package model
|
|
|
|
import (
|
|
"strings"
|
|
|
|
"github.com/NyaaPantsu/nyaa/config"
|
|
)
|
|
|
|
// Activity model
|
|
type Activity struct {
|
|
ID uint
|
|
Content string
|
|
Identifier string
|
|
Filter string
|
|
UserID uint
|
|
User *User
|
|
}
|
|
|
|
// NewActivity : Create a new activity log
|
|
func NewActivity(identifier string, filter string, c ...string) Activity {
|
|
return Activity{Identifier: identifier, Content: strings.Join(c, ","), Filter: filter}
|
|
}
|
|
|
|
// TableName : Return the name of activity table
|
|
func (a *Activity) TableName() string {
|
|
return config.Conf.Models.ActivityTableName
|
|
}
|