From 88f542f089d71dd357a6d77a52276d6a45f8c6ae Mon Sep 17 00:00:00 2001 From: boke0 Date: Sun, 14 Mar 2021 14:28:18 +0900 Subject: [PATCH] [fix --- kyokusui/controller.py | 11 ++++++++ kyokusui/main.py | 2 ++ kyokusui/templates/board.html | 5 ++++ kyokusui/templates/log.html | 49 ++++++++++++++++++++++++++++++++++ kyokusui/templates/thread.html | 15 ++++++++--- 5 files changed, 78 insertions(+), 4 deletions(-) create mode 100644 kyokusui/templates/log.html diff --git a/kyokusui/controller.py b/kyokusui/controller.py index 59d14d0..178d25e 100644 --- a/kyokusui/controller.py +++ b/kyokusui/controller.py @@ -142,6 +142,16 @@ def retrieve(self, request): "boards": Board.list_subscribed(request.user) }) + def log(self, request): + template = self.view.get_template("log.html") + board = Board.retrieve(request.params['board']) + thread = Thread.retrieve(request.params['thread']) + return Response.render(template, { + "board": board, + "thread": thread, + "boards": Board.list_subscribed(request.user) + }) + def update(self, request): thread = Thread.retrieve(request.params['thread']) form = UpdateThreadForm(request.post()) @@ -214,6 +224,7 @@ def handle(self, request): }, "user": { "_id": res.user._id, + "icon": res.user.icon_to_dataurl(), "name": res.user.name, "screen_name": res.user.screen_name }, diff --git a/kyokusui/main.py b/kyokusui/main.py index cc2890f..f0a5168 100644 --- a/kyokusui/main.py +++ b/kyokusui/main.py @@ -17,6 +17,8 @@ class App(App): view("/settings", HomeController, 'settings'), view("/static/", static_files()), view("/", BoardController, 'retrieve'), + view("//logs", BoardController, 'logs'), + view("//logs/", ThreadController, 'log'), view("//", ThreadController, 'retrieve'), view("/user//icon", UserController, 'icon'), post("/api/v0/board", BoardController, 'create'), diff --git a/kyokusui/templates/board.html b/kyokusui/templates/board.html index 7a4d190..f3cd287 100644 --- a/kyokusui/templates/board.html +++ b/kyokusui/templates/board.html @@ -16,6 +16,11 @@

{{ board.name }}

+