2018-04-09 11:44:02 +00:00
|
|
|
component EditLogPage(entries []*arn.EditLogEntry, nextIndex int, viewUser *arn.User, user *arn.User)
|
|
|
|
if viewUser != nil
|
|
|
|
h1.mountable= "Editor log: " + viewUser.Nick
|
|
|
|
else
|
|
|
|
h1.mountable Editor log
|
|
|
|
|
2018-03-13 16:59:16 +00:00
|
|
|
EditLog(entries, user)
|
2018-03-09 18:04:06 +00:00
|
|
|
|
2018-04-09 11:44:02 +00:00
|
|
|
if nextIndex != -1
|
|
|
|
.buttons
|
|
|
|
LoadMore(nextIndex)
|
|
|
|
|
2018-03-13 16:59:16 +00:00
|
|
|
component EditLog(entries []*arn.EditLogEntry, user *arn.User)
|
2018-04-09 16:17:21 +00:00
|
|
|
#load-more-target.edit-log
|
|
|
|
.edit-log-header.mountable
|
|
|
|
.edit-log-icon Action
|
|
|
|
.edit-log-user User
|
|
|
|
.edit-log-object Object
|
|
|
|
.edit-log-key Key
|
|
|
|
.edit-log-value Old
|
|
|
|
.edit-log-value New
|
|
|
|
.edit-log-date Date
|
|
|
|
|
|
|
|
EditLogScrollable(entries, user)
|
2018-03-09 19:39:06 +00:00
|
|
|
|
2018-04-09 11:44:02 +00:00
|
|
|
component EditLogScrollable(entries []*arn.EditLogEntry, user *arn.User)
|
|
|
|
each entry in entries
|
2018-04-09 16:17:21 +00:00
|
|
|
.edit-log-entry.mountable
|
2018-04-19 13:04:25 +00:00
|
|
|
.edit-log-icon.tip(aria-label=entry.ActionHumanReadable())
|
2018-04-09 16:17:21 +00:00
|
|
|
if entry.Action == "create"
|
|
|
|
.edit-log-create
|
|
|
|
RawIcon("plus")
|
|
|
|
else if entry.Action == "delete"
|
|
|
|
.edit-log-delete
|
|
|
|
RawIcon("minus")
|
|
|
|
else if entry.Action == "edit" || entry.Action == "arrayAppend" || entry.Action == "arrayRemove"
|
|
|
|
.edit-log-change
|
|
|
|
RawIcon("pencil")
|
|
|
|
|
|
|
|
if entry.Action == "arrayAppend"
|
|
|
|
.edit-log-sub-icon.edit-log-add
|
|
|
|
RawIcon("plus-square")
|
|
|
|
else if entry.Action == "arrayRemove"
|
|
|
|
.edit-log-sub-icon.edit-log-remove
|
|
|
|
RawIcon("minus-square")
|
|
|
|
else
|
|
|
|
if entry.OldValue == "" && entry.NewValue != ""
|
2018-04-09 11:44:02 +00:00
|
|
|
.edit-log-sub-icon.edit-log-add
|
2018-04-09 16:17:21 +00:00
|
|
|
RawIcon("plus-circle")
|
|
|
|
else if entry.OldValue != "" && entry.NewValue == ""
|
2018-04-09 11:44:02 +00:00
|
|
|
.edit-log-sub-icon.edit-log-remove
|
2018-04-09 16:17:21 +00:00
|
|
|
RawIcon("minus-circle")
|
2018-04-09 11:44:02 +00:00
|
|
|
|
2018-04-09 16:17:21 +00:00
|
|
|
.edit-log-user
|
2018-04-18 09:26:40 +00:00
|
|
|
a.edit-log-user-link.tip(href=entry.User().Link(), aria-label=entry.User().Nick)
|
2018-04-09 16:17:21 +00:00
|
|
|
AvatarNoLink(entry.User())
|
|
|
|
|
|
|
|
.edit-log-object
|
|
|
|
if arn.GetObjectTitle(entry.ObjectType, entry.ObjectID) == ""
|
|
|
|
.edit-log-empty empty
|
|
|
|
else if strings.HasPrefix(arn.GetObjectTitle(entry.ObjectType, entry.ObjectID), "<not found:")
|
2018-04-16 21:06:59 +00:00
|
|
|
span.clip-long-text= arn.GetObjectTitle(entry.ObjectType, entry.ObjectID)
|
2018-04-09 11:44:02 +00:00
|
|
|
else
|
2018-04-16 21:06:59 +00:00
|
|
|
a.clip-long-text(href=arn.GetObjectLink(entry.ObjectType, entry.ObjectID), target="_blank")= arn.GetObjectTitle(entry.ObjectType, entry.ObjectID)
|
2018-04-09 16:17:21 +00:00
|
|
|
|
|
|
|
.edit-log-key
|
2018-04-09 11:44:02 +00:00
|
|
|
span= entry.ObjectType
|
2018-03-09 19:39:06 +00:00
|
|
|
|
2018-04-09 11:44:02 +00:00
|
|
|
if entry.Key != ""
|
2018-04-16 21:06:59 +00:00
|
|
|
span.clip-long-text= "." + entry.Key
|
2018-04-09 16:17:21 +00:00
|
|
|
|
|
|
|
.edit-log-value(title=entry.OldValue)
|
|
|
|
if entry.OldValue == ""
|
|
|
|
.edit-log-empty empty
|
|
|
|
else
|
2018-04-16 21:06:59 +00:00
|
|
|
span.clip-long-text= entry.OldValue
|
2018-04-09 16:17:21 +00:00
|
|
|
|
|
|
|
.edit-log-value(title=entry.NewValue)
|
|
|
|
if entry.NewValue == ""
|
|
|
|
.edit-log-empty empty
|
|
|
|
else
|
2018-04-16 21:06:59 +00:00
|
|
|
span.clip-long-text= entry.NewValue
|
2018-04-09 16:17:21 +00:00
|
|
|
|
|
|
|
.edit-log-date.utc-date(data-date=entry.Created)
|