Skip to content

Commit 15886fb

Browse files
committed
more stats stuff
1 parent a659ffd commit 15886fb

File tree

4 files changed

+18
-5
lines changed

4 files changed

+18
-5
lines changed

VinePlus.Web/Pages/Stats/Index.cshtml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,13 @@
88
ViewData[Keys.Headings] = "General statistics";
99
ViewData[Keys.Highlight] = MainHighlight.Stats;
1010
}
11+
12+
<div id="search">
13+
<form method="post">
14+
<input class="searchQuery" name="searchQuery" id="searchQuery" type="search" placeholder="Search users stats"/>
15+
<input class="searchSubmit" type="submit"/>
16+
</form>
17+
</div>
1118
<div class="mini-heading">Top threads</div>
1219
<div class="userpost-container" >
1320
<span class="thread-odd thread-item thread-header thread-item-title">Thread</span>
@@ -51,4 +58,5 @@
5158
<span class="thread-item thread-item-posts">@Model.total_posts</span>
5259
<span class="thread-odd thread-item thread-item-title">Number of Threads</span>
5360
<span class="thread-odd thread-item thread-item-posts">@Model.total_threads</span>
54-
</div>
61+
</div>
62+

VinePlus.Web/Pages/Stats/Index.cshtml.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
using Microsoft.AspNetCore.Mvc.RazorPages;
1+
using Microsoft.AspNetCore.Mvc;
2+
using Microsoft.AspNetCore.Mvc.RazorPages;
23
using VinePlus.Database;
34

45
namespace VinePlus.Web.Pages.Stats;
56

7+
[IgnoreAntiforgeryToken(Order = 1001)] // disables anti-forgery token requirement https://www.learnrazorpages.com/security/request-verification
68
public class Index(ComicvineContext context) : PageModel
79
{
810
public IEnumerable<ThreadView> top_threads;
@@ -16,4 +18,8 @@ public void OnGet() {
1618
total_threads = Queries.getTotalThreads(context);
1719
board_summary = Queries.getBoardsViews(context);
1820
}
21+
22+
public IActionResult OnPost(string searchQuery) {
23+
return Redirect($"/stats/posts/{searchQuery.Trim()}");
24+
}
1925
}

VinePlus.Web/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ The first can be time consuming - especially on low internet speed, while the ba
9090
- [x] highlight search term
9191

9292
### Stats
93-
- [ ] add stats UI
94-
- [ ] board stats
93+
- [x] add stats UI
94+
- [x] board stats
9595
- [x] viewing all threads a user has posted in, and number of posts
9696
- [ ] stats for number of posts, and threads a user has made
9797

VinePlus.Web/VinePlus.Web.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
</ItemGroup>
2222

2323
<ItemGroup>
24-
<Folder Include="Pages\Stats\User\" />
2524
<Folder Include="wwwrooot\images" />
2625
</ItemGroup>
2726

0 commit comments

Comments
 (0)