Add person add/edit/delete in settings (#17)

This commit is contained in:
2026-08-23 15:26:18 -04:00
parent 5c7d34ffc7
commit e17e5b79f0
10 changed files with 222 additions and 10 deletions
+35
View File
@@ -776,6 +776,41 @@ type EditPageModel() =
| _ -> revision :: page.Revisions }
/// <summary>View model to edit a person</summary>
type EditPersonModel() =
/// <summary>The ID of the person being edited</summary>
member val Id = "" with get, set
/// <summary>The name of the person</summary>
member val Name = "" with get, set
/// <summary>A URL for this person's profile</summary>
member val ProfileUrl = "" with get, set
/// <summary>A URL to the image for this person</summary>
member val ImageUrl = "" with get, set
/// <summary>Create an edit model from a person</summary>
/// <param name="person">The person for whom the edit model is created</param>
static member FromPerson(person: Person) =
let model = EditPersonModel()
model.Id <- string person.Id
model.Name <- person.Name
model.ProfileUrl <- defaultArg person.Url ""
model.ImageUrl <- defaultArg person.ImageUrl ""
model
/// <summary>Update a person with values from this model</summary>
/// <param name="person">The person to be updated</param>
/// <returns>A person with their values updated</returns>
member this.UpdatePerson(person: Person) =
{ person with
Name = this.Name
Url = noneIfBlank this.ProfileUrl
ImageUrl = noneIfBlank this.ImageUrl }
/// <summary>View model to edit a post</summary>
type EditPostModel() =
inherit EditCommonModel()