Improved editor log
This commit is contained in:
parent
ef7fe29fab
commit
f25b834552
@ -12,7 +12,7 @@ import (
|
|||||||
"github.com/animenotifier/notify.moe/utils"
|
"github.com/animenotifier/notify.moe/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
const maxEntries = 50
|
const maxEntries = 40
|
||||||
|
|
||||||
// Get edit log.
|
// Get edit log.
|
||||||
func Get(ctx *aero.Context) string {
|
func Get(ctx *aero.Context) string {
|
||||||
|
@ -7,6 +7,7 @@ component EditLog(entries []*arn.EditLogEntry, user *arn.User)
|
|||||||
th.text-center Icon
|
th.text-center Icon
|
||||||
th User
|
th User
|
||||||
th Object
|
th Object
|
||||||
|
th Type
|
||||||
th Key
|
th Key
|
||||||
th Old
|
th Old
|
||||||
th New
|
th New
|
||||||
@ -15,10 +16,13 @@ component EditLog(entries []*arn.EditLogEntry, user *arn.User)
|
|||||||
each entry in entries
|
each entry in entries
|
||||||
tr.mountable
|
tr.mountable
|
||||||
td
|
td
|
||||||
.edit-log-icon
|
.edit-log-icon(title=entry.Action)
|
||||||
if entry.OldValue == "" && entry.NewValue != ""
|
if entry.Action == "create"
|
||||||
.edit-log-add
|
.edit-log-create
|
||||||
RawIcon("plus")
|
RawIcon("plus")
|
||||||
|
else if entry.OldValue == "" && entry.NewValue != ""
|
||||||
|
.edit-log-add
|
||||||
|
RawIcon("plus-circle")
|
||||||
else if entry.OldValue != "" && entry.NewValue == ""
|
else if entry.OldValue != "" && entry.NewValue == ""
|
||||||
.edit-log-remove
|
.edit-log-remove
|
||||||
RawIcon("minus")
|
RawIcon("minus")
|
||||||
@ -30,6 +34,7 @@ component EditLog(entries []*arn.EditLogEntry, user *arn.User)
|
|||||||
Avatar(entry.User())
|
Avatar(entry.User())
|
||||||
td.edit-log-object
|
td.edit-log-object
|
||||||
a(href="/" + strings.ToLower(entry.ObjectType) + "/" + entry.ObjectID, target="_blank")= arn.GetObjectTitle(entry.ObjectType, entry.ObjectID)
|
a(href="/" + strings.ToLower(entry.ObjectType) + "/" + entry.ObjectID, target="_blank")= arn.GetObjectTitle(entry.ObjectType, entry.ObjectID)
|
||||||
|
td.edit-log-type= entry.ObjectType
|
||||||
td.edit-log-key= entry.Key
|
td.edit-log-key= entry.Key
|
||||||
td= entry.OldValue
|
td= entry.OldValue
|
||||||
td= entry.NewValue
|
td= entry.NewValue
|
||||||
|
@ -20,6 +20,9 @@
|
|||||||
justify-content center
|
justify-content center
|
||||||
align-items center
|
align-items center
|
||||||
|
|
||||||
|
.edit-log-create
|
||||||
|
color green
|
||||||
|
|
||||||
.edit-log-add
|
.edit-log-add
|
||||||
color green
|
color green
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user