Skip to content
This repository has been archived by the owner on Oct 10, 2024. It is now read-only.

Commit

Permalink
Merge pull request #30 from recanman/recanman/patch15
Browse files Browse the repository at this point in the history
fix: show boards nsfw (#29)
  • Loading branch information
recanman authored Jul 8, 2023
2 parents 3d78ea8 + d36173c commit 49968cc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/routes/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const CheckPage = require("../middlewares/checkPage")

const BoardsController = require("../controllers/boards")

router.get("/", (req, res) => res.render("index", {boards: boards}))
router.get("/", (req, res) => res.render("index", {boards: boardList}))

router.get("/:board_code/", CheckBoard, async (req, res, next) => {
const {board_code} = req.params
Expand Down
12 changes: 5 additions & 7 deletions src/views/index.njk
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,17 @@
<b>Boards</b>

<ul>
{% for categoryName, category in boards %}
{% for categoryName, category in boardList %}
<li>
<u>{{ categoryName }}</u>

{% if category.nsfw %}
(<b style="color:red">NSFW</b>)
{% endif %}

<u>{{ categoryName }}</u>
</li>

<ul>
{% for board in category %}
<a href="/{{ board.board }}/">{{ board.title }}</a>
{% if boards[board.board].ws_board == 0 %}
(<b style="color:red">NSFW</b>)
{% endif %}
<br>
{% endfor %}
</ul>
Expand Down

0 comments on commit 49968cc

Please sign in to comment.