diff --git a/README.md b/README.md index dc8c0c1..86470ad 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ A photo gallery site implemented in ASP.NET Core 2.0 Razor Pages. - All major browsers fully supported (IE 10+) - Social media integration (Facebook, Twitter, Pinterest) - Follows best practices for web applications - - [See DareBoost report](https://www.dareboost.com/en/report/59b6d2080cf2502fdb8c0c92) + - [See DareBoost report](https://www.dareboost.com/en/report/59b6e5510cf2502fdb8c1ad5) ## Technical features - High performance. Gets 100/100 points on Google PageSpeed Insights diff --git a/src/Models/Album.cs b/src/Models/Album.cs index f893748..a9e52ab 100644 --- a/src/Models/Album.cs +++ b/src/Models/Album.cs @@ -76,6 +76,9 @@ public IPaginator Previous } } + /// + /// Sorts the photos in the album. + /// public void Sort() { Photos = Photos.OrderBy(p => p.DisplayName).ToList(); diff --git a/src/Pages/Photo.cshtml.cs b/src/Pages/Photo.cshtml.cs index fec62fa..f9cdf13 100644 --- a/src/Pages/Photo.cshtml.cs +++ b/src/Pages/Photo.cshtml.cs @@ -53,6 +53,8 @@ public IActionResult OnPostRename(string albumName, string photoName) System.IO.File.Move(file, newThumbnail); } + Photo.Album.Sort(); + return new RedirectResult($"~/photo/{WebUtility.UrlEncode(albumName).Replace('+', ' ')}/{newPhoto.DisplayName}/"); }