Skip to content

Commit 847d4ab

Browse files
Link categories in threadlist on homepage
1 parent 40d7b1c commit 847d4ab

File tree

3 files changed

+15
-4
lines changed

3 files changed

+15
-4
lines changed

public/css/nimforum.scss

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,16 @@ $logo-height: $navbar-height - 20px;
143143
white-space: nowrap;
144144
}
145145

146+
.category-name {
147+
a:link,
148+
a:hover,
149+
a:active,
150+
a:visited {
151+
color: $body-font-color;
152+
text-decoration: none;
153+
}
154+
}
155+
146156
#new-thread {
147157
.modal-container .modal-body {
148158
max-height: none;

src/frontend/category.nim

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ when defined(js):
3939
kstring"0.25rem solid #" & category.color)
4040
))
4141
span(class="category-name"):
42-
text category.name
42+
a(href=makeUri("/c/" & $category.id)):
43+
text category.name
4344
if not compact:
4445
span(class="topic-count"):
4546
text "× " & $category.numTopics

tests/browsertests/categories.nim

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,18 +137,18 @@ proc categoriesUserTests(session: Session, baseUrl: string) =
137137

138138
click "#category-unsorted"
139139
checkText "#threads-list .thread-title a", "Post 3"
140-
for element in session.waitForElements("#threads-list .category-name"):
140+
for element in session.waitForElements("#threads-list .category-name a"):
141141
# Have to user "innerText" because elements are hidden on this page
142142
assert element.getProperty("innerText") == "Unsorted"
143143

144144
selectCategory "announcements"
145145
checkText "#threads-list .thread-title a", "Post 2"
146-
for element in session.waitForElements("#threads-list .category-name"):
146+
for element in session.waitForElements("#threads-list .category-name a"):
147147
assert element.getProperty("innerText") == "Announcements"
148148

149149
selectCategory "fun"
150150
checkText "#threads-list .thread-title a", "Post 1"
151-
for element in session.waitForElements("#threads-list .category-name"):
151+
for element in session.waitForElements("#threads-list .category-name a"):
152152
assert element.getProperty("innerText") == "Fun"
153153

154154
session.logout()

0 commit comments

Comments
 (0)