/?limit=0のサポート
This commit is contained in:
parent
9c7f06a57d
commit
46eba541f4
2 changed files with 3 additions and 2 deletions
4
app.py
4
app.py
|
@ -227,9 +227,9 @@ async def api_ng_delete(item: NGItem):
|
||||||
return PlainTextResponse("OK")
|
return PlainTextResponse("OK")
|
||||||
|
|
||||||
@app.get("/")
|
@app.get("/")
|
||||||
async def home(req: Request):
|
async def home(req: Request, limit: int = 50):
|
||||||
res = ctx["templates"].TemplateResponse(req, "index.html", {
|
res = ctx["templates"].TemplateResponse(req, "index.html", {
|
||||||
"notes": get_litey_notes(limit=50),
|
"notes": get_litey_notes(limit=limit),
|
||||||
"ng_words": get_ng_words()
|
"ng_words": get_ng_words()
|
||||||
})
|
})
|
||||||
res.headers["Cache-Control"] = f"public, max-age=60, s-maxage=60"
|
res.headers["Cache-Control"] = f"public, max-age=60, s-maxage=60"
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
<h1>掲示板へようこそ!</h1>
|
<h1>掲示板へようこそ!</h1>
|
||||||
<p>良識のあるメッセージを心がけてください</p>
|
<p>良識のあるメッセージを心がけてください</p>
|
||||||
<p>荒らしが横行しているため、最初の50件のみ表示しています。</p>
|
<p>荒らしが横行しているため、最初の50件のみ表示しています。</p>
|
||||||
|
<p>全て表示するには<a href="/?limit=0">こちら</a></p>
|
||||||
<textarea placeholder="ここにメッセージを入力" rows="4" cols="50" id="message"></textarea>
|
<textarea placeholder="ここにメッセージを入力" rows="4" cols="50" id="message"></textarea>
|
||||||
<input type="submit" value="今すぐ送信!" onclick="notePost();">
|
<input type="submit" value="今すぐ送信!" onclick="notePost();">
|
||||||
{% for note in notes %}
|
{% for note in notes %}
|
||||||
|
|
Loading…
Add table
Reference in a new issue