diff --git a/app.py b/app.py index d7eca89..32ea0b6 100644 --- a/app.py +++ b/app.py @@ -2,6 +2,7 @@ from flask import Flask, render_template, request from flask_assets import Bundle, Environment from todo import todos from boards import board_list +from threads import threads_lists import socket @@ -34,12 +35,17 @@ def healthz(): @app.route("/") -def homepage(): - +def homepage(): docker_short_id = socket.gethostname() return render_template("main-page.html", host_id=docker_short_id, boards=board_list) +### stolen +@app.route("/boards/") +def page_board(board_id): + return render_template("board.html", boards=board_list, board_threads=threads_lists[board_id]) + + ### stolen @app.route("/todo") def page_todo(): diff --git a/templates/board.html b/templates/board.html new file mode 100644 index 0000000..d134fdb --- /dev/null +++ b/templates/board.html @@ -0,0 +1,38 @@ +{% extends "base.html" %} + +{% block content %} + +
+ {{board_id}} +
+ + + + + + + + + + + + + {% include 'thread.html' %} + +
+ +{% endblock content %} \ No newline at end of file diff --git a/templates/thread.html b/templates/thread.html new file mode 100644 index 0000000..989b309 --- /dev/null +++ b/templates/thread.html @@ -0,0 +1,7 @@ +{% if threads|length>0 %} + {% for thread in threads %} + + {{thread}} + + {% endfor %} +{% endif %} \ No newline at end of file diff --git a/threads.py b/threads.py new file mode 100644 index 0000000..cdb7465 --- /dev/null +++ b/threads.py @@ -0,0 +1,11 @@ +threads_lists = { + 'b': { + '123','124' + }, + 'a': { + '1' + }, + 'd': { + '44','99','1230' + } +} \ No newline at end of file