Log length increase and score update
This commit is contained in:
@ -33,16 +33,11 @@ component Sidebar(user *arn.User)
|
|||||||
if user != nil
|
if user != nil
|
||||||
SidebarButton("Support", "/support", "heart")
|
SidebarButton("Support", "/support", "heart")
|
||||||
|
|
||||||
if arn.IsDevelopment()
|
//- if arn.IsDevelopment()
|
||||||
SidebarButton("Groups", "/groups", "users")
|
//- SidebarButton("Groups", "/groups", "users")
|
||||||
|
|
||||||
if user != nil && (user.Role == "editor" || user.Role == "admin")
|
if user != nil && (user.Role == "editor" || user.Role == "admin")
|
||||||
if user.Role == "admin"
|
|
||||||
SidebarButton("Admin", "/admin", "wrench")
|
|
||||||
|
|
||||||
if (user.Role == "editor" || user.Role == "admin")
|
|
||||||
SidebarButton("Editor", "/editor", "pencil")
|
SidebarButton("Editor", "/editor", "pencil")
|
||||||
|
|
||||||
SidebarButton("Log", "/log", "list")
|
SidebarButton("Log", "/log", "list")
|
||||||
|
|
||||||
//- Disabled:
|
//- Disabled:
|
||||||
@ -62,6 +57,9 @@ component Sidebar(user *arn.User)
|
|||||||
Icon("search")
|
Icon("search")
|
||||||
FuzzySearch
|
FuzzySearch
|
||||||
|
|
||||||
|
if user != nil && user.Role == "admin"
|
||||||
|
SidebarButton("Admin", "/admin", "wrench")
|
||||||
|
|
||||||
a.sidebar-link.action(href="#", data-action="toggleTheme", data-trigger="click")
|
a.sidebar-link.action(href="#", data-action="toggleTheme", data-trigger="click")
|
||||||
.sidebar-button
|
.sidebar-button
|
||||||
Icon("paint-brush")
|
Icon("paint-brush")
|
||||||
|
@ -12,7 +12,7 @@ import (
|
|||||||
"github.com/animenotifier/notify.moe/utils"
|
"github.com/animenotifier/notify.moe/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
const maxEntries = 40
|
const maxEntries = 120
|
||||||
|
|
||||||
// Get edit log.
|
// Get edit log.
|
||||||
func Get(ctx *aero.Context) string {
|
func Get(ctx *aero.Context) string {
|
||||||
|
@ -15,11 +15,15 @@ func Get(ctx *aero.Context) string {
|
|||||||
return ctx.Redirect("/")
|
return ctx.Redirect("/")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ignoreDifferences := arn.FilterIgnoreAnimeDifferences(func(entry *arn.IgnoreAnimeDifference) bool {
|
||||||
|
return entry.CreatedBy == user.ID
|
||||||
|
})
|
||||||
|
|
||||||
logEntries := arn.FilterEditLogEntries(func(entry *arn.EditLogEntry) bool {
|
logEntries := arn.FilterEditLogEntries(func(entry *arn.EditLogEntry) bool {
|
||||||
return entry.UserID == user.ID
|
return entry.UserID == user.ID
|
||||||
})
|
})
|
||||||
|
|
||||||
score := 0
|
score := len(ignoreDifferences)
|
||||||
|
|
||||||
for _, entry := range logEntries {
|
for _, entry := range logEntries {
|
||||||
switch entry.Action {
|
switch entry.Action {
|
||||||
@ -29,6 +33,10 @@ func Get(ctx *aero.Context) string {
|
|||||||
case "edit":
|
case "edit":
|
||||||
score += 2
|
score += 2
|
||||||
|
|
||||||
|
if entry.ObjectType == "Anime" && (entry.Key == "Summary" || entry.Key == "Synopsis") {
|
||||||
|
score += 2
|
||||||
|
}
|
||||||
|
|
||||||
case "delete", "arrayRemove":
|
case "delete", "arrayRemove":
|
||||||
score++
|
score++
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user