Skip to content

Commit 438e741

Browse files
committed
added logo
1 parent 2742a8e commit 438e741

File tree

8 files changed

+35
-16
lines changed

8 files changed

+35
-16
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@ riderModule.iml
66
settings.json
77
appsettings.Development.json
88
.vs
9-
.idea
9+
.idea
10+
ComicVineAPI.sln.DotSettings.user

ComicVine.API/Pages/Archives/Forums.cshtml.cs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,8 @@ public Forums(ComicvineContext context) {
1818
* - filter by type
1919
*/
2020
public void OnGet(int p) {
21-
Entities =
22-
_context.Threads
23-
.OrderBy(t => t.Id)
24-
.Skip(50 * (p - 1))
25-
.Take(50)
26-
;
27-
28-
NavRecord = new(p, _context.Threads.Count() / 50, p.ToString());
21+
Entities = Util.GetArchivedThreads(_context, p);
22+
NavRecord = new(p, Util.GetThreadsMaxPage(_context), p.ToString());
2923
}
3024

3125
public override Func<string, int, string> PageDelegate() {

ComicVine.API/Pages/Shared/_Layout.cshtml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
<header>
1212
<nav>
1313
<div id="nav-root">
14+
<a href="/forums" class="nav-item">
15+
<img src="/images/logo.png" alt="logo" id="nav-logo"/>
16+
</a>
1417
<span class="@Util.GetHighlightClass(ViewData, MainHighlight.Vine)">
1518
<a href="/forums">Vine</a>
1619
</span>

ComicVine.API/Pages/Shared/_ProfileLayout.cshtml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@
1010
<body>
1111
<header>
1212
<nav class="profile-nav">
13-
<div id="nav-root" >
13+
<div id="nav-root">
14+
<a href="/forums" class="nav-item">
15+
<img src="/images/logo.png" alt="logo" id="nav-logo"/>
16+
</a>
1417
<span class="@Util.GetHighlightClass(ViewData, ProfileHighlight.Main)">
1518
<a href="@Util.Profile.GetLink(ViewData, "/profile/")">
1619
Profile

ComicVine.API/Pages/Util.cs

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@ public class ImgData
6060

6161
public static class Util
6262
{
63+
public static int ThreadPerPage = 50;
64+
public static int PostsPerPage = 50;
65+
6366
public static string GetDuration(DateTime current, DateTime date) {
6467
TimeSpan dur = current - date;
6568
return dur.Days switch
@@ -92,8 +95,8 @@ public static string GetThreadRow(int index) {
9295
.Threads
9396
.Where(thread => thread.Creator.Text == user)
9497
.OrderByDescending(each => each.TotalPosts)
95-
.Skip((page-1)*50)
96-
.Take(50)
98+
.Skip(ThreadPerPage * (page-1))
99+
.Take(ThreadPerPage)
97100
;
98101
}
99102

@@ -102,11 +105,24 @@ public static string GetThreadRow(int index) {
102105
.Posts
103106
.Where(posts => posts.Creator.Text == user)
104107
// .OrderByDescending(each => each.Id)
105-
.Skip((page-1)*50)
106-
.Take(50)
108+
.Skip(PostsPerPage * (page-1))
109+
.Take(PostsPerPage)
107110
;
108111
}
109-
112+
113+
public static IEnumerable<Parsers.Thread> GetArchivedThreads(ComicvineContext context, int page) {
114+
return context
115+
.Threads
116+
.OrderByDescending(t => t.Id)
117+
.Skip(ThreadPerPage * (page - 1))
118+
.Take(ThreadPerPage)
119+
;
120+
}
121+
122+
public static int GetThreadsMaxPage(ComicvineContext context) {
123+
return context.Threads.Count() / ThreadPerPage + 1;
124+
}
125+
110126
public static string GetHighlightClass(ViewDataDictionary viewData, string expected) {
111127
if (expected == (string)(viewData[Keys.Highlight] ?? "")) {
112128
return "nav-item nav-highlight";

ComicVine.API/wwwroot/css/main.css

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ nav {
3636
#nav-root {
3737
height: inherit;
3838
display: flex;
39-
margin-left: 5em;
4039
}
4140
.nav-item > a {
4241
text-decoration: none ;
@@ -48,6 +47,9 @@ nav {
4847
padding-left: 1em;
4948
padding-right: 1em;
5049
}
50+
#nav-logo {
51+
height: 3em;
52+
}
5153
.nav-highlight > a {
5254
color: rgb(1, 124, 55);
5355
}

ComicVine.API/wwwroot/favicon.ico

80.5 KB
Binary file not shown.
3.77 KB
Loading

0 commit comments

Comments
 (0)