Add sorting columns
This commit is contained in:
parent
adf24cbd5c
commit
90adbcfb7c
34 changed files with 833 additions and 80 deletions
|
|
@ -1,5 +1,4 @@
|
|||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Start.Server.Models {
|
||||
/// <summary>A bookmark with display text and a URL to link to</summary>
|
||||
|
|
@ -17,21 +16,24 @@ namespace Start.Server.Models {
|
|||
/// <summary>Arbitrary notes about the bookmark</summary>
|
||||
[MaxLength(5000)]
|
||||
public string? Notes { get; set; }
|
||||
/// <summary>Used for sorting lists of bookmarks</summary>
|
||||
public int SortOrder { get; set; }
|
||||
|
||||
/// <summary>The unique ID for the group the bookmark is in</summary>
|
||||
public int BookmarkGroupId { get; set; }
|
||||
/// <summary>The group the bookmark is in</summary>
|
||||
public BookmarkGroup? BookmarkGroup { get; set; }
|
||||
|
||||
public Bookmark(string title, string url, string? notes, int bookmarkGroupId) {
|
||||
public Bookmark(string title, string url, string? notes, int sortOrder, int bookmarkGroupId) {
|
||||
this.Title = title;
|
||||
this.Url = url;
|
||||
this.Notes = notes;
|
||||
this.SortOrder = sortOrder;
|
||||
this.BookmarkGroupId = bookmarkGroupId;
|
||||
}
|
||||
|
||||
public Bookmark(int bookmarkId, string title, string url, string? notes, int bookmarkGroupId)
|
||||
: this(title, url, notes, bookmarkGroupId) {
|
||||
public Bookmark(int bookmarkId, string title, string url, string? notes, int sortOrder,
|
||||
int bookmarkGroupId) : this(title, url, notes, sortOrder, bookmarkGroupId) {
|
||||
this.BookmarkId = bookmarkId;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Start.Server.Models {
|
||||
|
|
@ -8,9 +7,11 @@ namespace Start.Server.Models {
|
|||
/// <summary>A unique ID for the container</summary>
|
||||
[Key]
|
||||
public int BookmarkContainerId { get; set; }
|
||||
|
||||
/// <summary>A title to disply to the user</summary>
|
||||
[MaxLength(300)]
|
||||
public string Title { get; set; }
|
||||
/// <summary>Used for sorting lists of bookmark containers</summary>
|
||||
public int SortOrder { get; set; }
|
||||
|
||||
/// <summary>The unique ID of the user that this container belongs to</summary>
|
||||
public string ApplicationUserId { get; set; }
|
||||
|
|
@ -20,13 +21,14 @@ namespace Start.Server.Models {
|
|||
/// <summary>The <see cref="BookmarkGroup"/>s in this container</summary>
|
||||
public List<BookmarkGroup>? BookmarkGroups { get; set; }
|
||||
|
||||
public BookmarkContainer(string applicationUserId, string title) {
|
||||
public BookmarkContainer(string applicationUserId, string title, int sortOrder) {
|
||||
this.ApplicationUserId = applicationUserId;
|
||||
this.Title = title;
|
||||
this.SortOrder = sortOrder;
|
||||
}
|
||||
|
||||
public BookmarkContainer(int bookmarkContainerId, string applicationUserId, string title)
|
||||
: this(applicationUserId, title) {
|
||||
public BookmarkContainer(int bookmarkContainerId, string applicationUserId, string title,
|
||||
int sortOrder) : this(applicationUserId, title, sortOrder) {
|
||||
this.BookmarkContainerId = bookmarkContainerId;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Start.Server.Models {
|
||||
|
|
@ -15,6 +14,8 @@ namespace Start.Server.Models {
|
|||
/// <summary>A hex color for the group</summary>
|
||||
[MaxLength(6)]
|
||||
public string Color { get; set; }
|
||||
/// <summary>Used for sorting lists of bookmark groups</summary>
|
||||
public int SortOrder { get; set; }
|
||||
|
||||
/// <summary>The unique ID of the container this group is in</summary>
|
||||
public int BookmarkContainerId { get; set; }
|
||||
|
|
@ -24,14 +25,15 @@ namespace Start.Server.Models {
|
|||
/// <summary>The bookmarks in this group</summary>
|
||||
public List<Bookmark>? Bookmarks { get; set; }
|
||||
|
||||
public BookmarkGroup(string title, string color, int bookmarkContainerId) {
|
||||
public BookmarkGroup(string title, string color, int sortOrder, int bookmarkContainerId) {
|
||||
this.Title = title;
|
||||
this.Color = color;
|
||||
this.SortOrder = sortOrder;
|
||||
this.BookmarkContainerId = bookmarkContainerId;
|
||||
}
|
||||
|
||||
public BookmarkGroup(int bookmarkGroupId, string title, string color,
|
||||
int bookmarkContainerId) : this(title, color, bookmarkContainerId) {
|
||||
public BookmarkGroup(int bookmarkGroupId, string title, string color, int sortOrder,
|
||||
int bookmarkContainerId) : this(title, color, sortOrder, bookmarkContainerId) {
|
||||
this.BookmarkGroupId = bookmarkGroupId;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue