Skip to content

Commit

Permalink
Update to new C# collection initializer syntax
Browse files Browse the repository at this point in the history
Updated `Comments.cshtml` and `Post.cshtml` to use the new C# collection initializer syntax for `UlElementClasses` property. Modified `Program.cs` to initialize the `magics` list using the new collection initializer syntax, affecting the `magics.AddRange` method call.
  • Loading branch information
EdiWang committed Nov 24, 2024
1 parent f8597de commit 5ee94ef
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
3 changes: 2 additions & 1 deletion src/Moonglade.Web/Pages/Admin/Comments.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,9 @@
}
}


@Html.PagedListPager(Model.CommentDetailedItems, page => $"?pageIndex={page}", new()
{
UlElementClasses = new[] { "pagination mt-3" }
UlElementClasses = ["pagination mt-3"]
})
</div>
6 changes: 3 additions & 3 deletions src/Moonglade.Web/Pages/Admin/Post.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@
}

@Html.PagedListPager(Model.PostSegments, page => $"?pageIndex={page}&searchTerm={Model.SearchTerm}", new()
{
UlElementClasses = new[] { "pagination mt-4" }
})
{
UlElementClasses = ["pagination mt-4"]
})
}
</div>
5 changes: 2 additions & 3 deletions src/Moonglade.Web/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -137,15 +137,14 @@ private static void ConfigureCaptcha(IServiceCollection services, IConfiguration

if (bool.Parse(configuration["BlockPRCFuryCode"]!))
{
magics.AddRange(new[]
{
magics.AddRange([
Helper.GetMagic(0x7DB14, 21, 25),
Helper.GetMagic(0x78E10, 13, 17),
Helper.GetMagic(0x17808, 34, 38),
Helper.GetMagic(0x1B5ED, 4, 8),
Helper.GetMagic(0x9CFB, 25, 29),
"NMSL", "CNMB", "MDZZ", "TNND"
});
]);
}

options.FontStyle = FontStyle.Bold;
Expand Down

0 comments on commit 5ee94ef

Please sign in to comment.