mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2026-05-12 22:10:25 +00:00
feat: render a link to poster profile next to the ID within shadow copy details (#10194)
Closes #10078 and includes another small improvement (for comments and issues/PRs the title from report/s details page already included the poster name; now it will clickable, opening the poster profile page). Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/10194 Reviewed-by: Gusted <gusted@noreply.codeberg.org> Co-authored-by: floss4good <floss4good@disroot.org> Co-committed-by: floss4good <floss4good@disroot.org>
This commit is contained in:
parent
610e143e9b
commit
590104b5ca
13 changed files with 262 additions and 20 deletions
|
|
@ -22,6 +22,11 @@ type AbuseReportDetailed struct {
|
|||
ContentReference string
|
||||
ShadowCopyDate timeutil.TimeStamp // only for details
|
||||
ShadowCopyRawValue string // only for details
|
||||
|
||||
// In case the reported content was deleted before the report was handled, this flag can be set
|
||||
// in order to try to determine the abuser/poster ID (and load their details) based on the fields
|
||||
// that might have been saved within the shadow copy (for comments and issues/PRs).
|
||||
ShouldGetAbuserFromShadowCopy bool `xorm:"-"`
|
||||
}
|
||||
|
||||
func (ard AbuseReportDetailed) ContentTypeIconName() string {
|
||||
|
|
|
|||
|
|
@ -40,6 +40,13 @@ type ShadowCopyData interface {
|
|||
// GetFieldsMap returns a list of <key, value> pairs with the fields stored within shadow copies
|
||||
// of content reported as abusive, to be used when rendering a shadow copy in the admin UI.
|
||||
GetFieldsMap() []ShadowCopyField
|
||||
|
||||
// GetAbuserID returns the ID of the user who posted the reported content when this info in available within
|
||||
// the shadow copy (i.e. the PosterID field for comments and issues/PRs or the OwnerID field for repositories),
|
||||
// together with a boolean value indicating whether the ID is considered valid or not.
|
||||
// This is used to retrieve the abuser/poster in case the reported content was deleted before an admin managed
|
||||
// to review the report, allowing them to easily access the abuser profile (if this was not also deleted).
|
||||
GetAbuserID() (int64, bool)
|
||||
}
|
||||
|
||||
func init() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue