some structure
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Simple_Not 2023-07-03 23:18:37 +10:00
parent 78bfc22811
commit a9cabbe7d8
4 changed files with 64 additions and 2 deletions

10
app.py
View File

@ -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/<board_id>")
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():

38
templates/board.html Normal file
View File

@ -0,0 +1,38 @@
{% extends "base.html" %}
{% block content %}
<div class="content">
{{board_id}}
</div>
<nav>
<a routerLink = "/">Напоминание </a>
<br>
<a routerLink = "/about">О нас </a>
<br>
Доски:
<div class="boards">
<ul>
{% for board in boards %}
<li><a href="{{board}}">/{{board}}</a></li>
{% endfor %}
</ul>
</div>
</nav>
<table class="border-collapse w-small w-2/3 mx-auto">
<thead>
<tr>
<th class="p-3 font-bold uppercase bg-gray-200 text-gray-600 border border-gray-300 hidden lg:table-cell">#</th>
</tr>
</thead>
<tbody id="thread-results">
{% include 'thread.html' %}
</tbody>
</table>
{% endblock content %}

7
templates/thread.html Normal file
View File

@ -0,0 +1,7 @@
{% if threads|length>0 %}
{% for thread in threads %}
<tr class="bg-white lg:hover:bg-gray-100 flex lg:table-row flex-row lg:flex-row flex-wrap lg:flex-no-wrap mb-10 lg:mb-0">
<td class="w-full lg:w-auto p-3 text-gray-800 text-center border border-b block lg:table-cell relative lg:static">{{thread}}</td>
</tr>
{% endfor %}
{% endif %}

11
threads.py Normal file
View File

@ -0,0 +1,11 @@
threads_lists = {
'b': {
'123','124'
},
'a': {
'1'
},
'd': {
'44','99','1230'
}
}