Toggle navigation
Toggle navigation
This project
Loading...
Sign in
201side
/
floater
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
3
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
robin*
2020-12-09 12:59:17 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
b8bfb2f5ec0c0f09ea7b8619f1072ce900e1a0e5
b8bfb2f5
1 parent
045f9299
스레드 목록 추가
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
2 deletions
src/routes/board.js
src/views/threadslist.handlebars
src/routes/board.js
View file @
b8bfb2f
...
...
@@ -9,8 +9,8 @@ app.get('/board/:bid', async(req, res) => {
if
(
!
board
)
{
res
.
status
(
404
).
json
({
error
:
'Board not found'
});
}
let
threads
=
await
db
.
get
(
'thread'
).
find
({
board
:
board
.
_id
},
{
sort
:
'-lastUpdated'
,
limit
:
2
0
});
res
.
json
({
threads
:
threads
})
let
threads
=
await
db
.
get
(
'thread'
).
find
({
board
:
board
.
_id
},
{
sort
:
'-lastUpdated'
,
limit
:
5
0
});
res
.
render
(
'threadslist'
,
{
board
,
threads
});
});
app
.
post
(
'/board/:bid/thread'
,
async
(
req
,
res
)
=>
{
...
...
src/views/threadslist.handlebars
0 → 100644
View file @
b8bfb2f
<h1>
{{
board
.
title
}}
<small
class=
"text-muted"
>
{{
board
.
name
}}
</small>
</h1>
<table
class=
"table"
>
{{#
each
threads
}}
<tr>
<td>
{{
this
.
title
}}
(
{{
this
.
count
}}
)
</td>
</tr>
{{/
each
}}
</table>
\ No newline at end of file
Please
register
or
login
to post a comment