Added ordering to category badges

This commit is contained in:
Mia Rose Winter 2024-01-26 15:16:11 +01:00
parent d7bc79d0bf
commit 6203f7accc
Signed by: miawinter
GPG key ID: 4B6F6A83178F595E
2 changed files with 2 additions and 2 deletions

View file

@ -30,7 +30,7 @@
</p>
@if (Article.Categories.Count > 0) {
<p class="flex flex-wrap gap-2 my-3">
@foreach (var category in Article.Categories) {
@foreach (var category in Article.Categories.OrderBy(c => c.Color)) {
<span class="badge badge-@CategoryUtilities.GetCssClassPostfixForColor(category.Color)">
@category.Name
</span>

View file

@ -29,7 +29,7 @@
<h2 class="text-2xl lg:text-4xl">
@featured.Title
<p class="flex flex-wrap gap-2">
@foreach (var category in featured.Categories) {
@foreach (var category in featured.Categories.OrderBy(c => c.Color)) {
<span class="badge badge-@CategoryUtilities.GetCssClassPostfixForColor(category.Color)">
@category.Name
</span>