Compare commits

..

26 Commits

Author SHA1 Message Date
Simple_Not
97f74ce831 favicon
All checks were successful
continuous-integration/drone/push Build is passing
2023-07-03 23:54:26 +10:00
Simple_Not
d53dde8325 some structure
All checks were successful
continuous-integration/drone/push Build is passing
2023-07-03 23:47:48 +10:00
Simple_Not
da998af863 some structure
All checks were successful
continuous-integration/drone/push Build is passing
2023-07-03 23:45:49 +10:00
Simple_Not
e7a2a6cac3 some structure
All checks were successful
continuous-integration/drone/push Build is passing
2023-07-03 23:28:41 +10:00
Simple_Not
ef4f71b317 some structure
All checks were successful
continuous-integration/drone/push Build is passing
2023-07-03 23:25:25 +10:00
Simple_Not
fa0decbb9c some structure
All checks were successful
continuous-integration/drone/push Build is passing
2023-07-03 23:24:34 +10:00
Simple_Not
0545ddf4d9 some structure
All checks were successful
continuous-integration/drone/push Build is passing
2023-07-03 23:23:58 +10:00
Simple_Not
d7d5c620a1 some structure
All checks were successful
continuous-integration/drone/push Build is passing
2023-07-03 23:23:03 +10:00
Simple_Not
3fc9deb5b9 some structure
All checks were successful
continuous-integration/drone/push Build is passing
2023-07-03 23:22:57 +10:00
Simple_Not
caefb042cd some structure
All checks were successful
continuous-integration/drone/push Build is passing
2023-07-03 23:22:11 +10:00
Simple_Not
5ca30b21ef some structure
All checks were successful
continuous-integration/drone/push Build is passing
2023-07-03 23:21:00 +10:00
Simple_Not
b15191dfed some structure
All checks were successful
continuous-integration/drone/push Build is passing
2023-07-03 23:19:54 +10:00
Simple_Not
a9cabbe7d8 some structure
All checks were successful
continuous-integration/drone/push Build is passing
2023-07-03 23:18:37 +10:00
Simple_Not
78bfc22811 some structure
All checks were successful
continuous-integration/drone/push Build is passing
2023-07-03 23:09:55 +10:00
Simple_Not
cb4f26bec7 some structure
All checks were successful
continuous-integration/drone/push Build is passing
2023-07-03 23:09:42 +10:00
Simple_Not
294f96c86e some structure
All checks were successful
continuous-integration/drone/push Build is passing
2023-07-03 23:08:17 +10:00
Simple_Not
589acaeab4 some structure
All checks were successful
continuous-integration/drone/push Build is passing
2023-07-03 23:06:03 +10:00
Simple_Not
0c24f0064c some structure
All checks were successful
continuous-integration/drone/push Build is passing
2023-07-03 23:04:00 +10:00
Simple_Not
1cc624c4c8 some structure
All checks were successful
continuous-integration/drone/push Build is passing
2023-07-03 23:02:48 +10:00
Simple_Not
10ebc6d628 some structure
All checks were successful
continuous-integration/drone/push Build is passing
2023-07-03 22:59:38 +10:00
Simple_Not
a7fa809ae4 some structure
All checks were successful
continuous-integration/drone/push Build is passing
2023-07-03 22:58:08 +10:00
Simple_Not
bd9a18eec6 some structure
All checks were successful
continuous-integration/drone/push Build is passing
2023-07-03 22:53:08 +10:00
Simple_Not
8d5cf827a0 some structure
All checks were successful
continuous-integration/drone/push Build is passing
2023-07-03 22:46:40 +10:00
Simple_Not
d4be063d00 some structure
All checks were successful
continuous-integration/drone/push Build is passing
2023-07-03 22:41:49 +10:00
Simple_Not
7a08de831a dev change
All checks were successful
continuous-integration/drone/push Build is passing
2023-07-02 01:10:44 +10:00
Simple_Not
2a7fcaf579 dev branch
All checks were successful
continuous-integration/drone/push Build is passing
2023-07-02 01:08:55 +10:00
11 changed files with 203 additions and 27 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
__pycache__

41
app.py
View File

@ -1,25 +1,57 @@
from flask import Flask, render_template, request from flask import Flask, render_template, request
from flask_assets import Bundle, Environment from flask_assets import Bundle, Environment
from todo import todos from todo import todos
from boards import board_list
from threads import threads_lists
from threads_with_posts import open_threads
import socket
app = Flask(__name__) app = Flask(__name__)
assets = Environment(app) assets = Environment(app)
#css = Bundle("src/main.css", output="dist/main.css") css = Bundle("src/*.css", output="dist/main.css")
# https://unpkg.com/htmx.org # https://unpkg.com/htmx.org
js = Bundle("src/*.js", output="dist/main.js") js = Bundle("src/*.js", output="dist/main.js")
#assets.register("css", css) assets.register("css", css)
assets.register("js", js) assets.register("js", js)
#css.build() css.build()
js.build() js.build()
@app.route('/liveness')
def healthx():
return "<h1><center>Liveness check completed</center><h1>"
@app.route('/readiness')
def healthz():
return "<h1><center>Readiness check completed</center><h1>"
@app.route("/") @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):
b_threads = [ open_threads[thread_id] for thread_id in open_threads if thread_id in threads_lists[board_id]]
return render_template("board.html", board_id=board_id, boards=board_list, board_threads=b_threads)
### stolen
@app.route("/todo")
def page_todo():
return render_template("page1.html") return render_template("page1.html")
@ -36,6 +68,7 @@ def search_todo():
res_todos.append(todo) res_todos.append(todo)
return render_template("todo.html", todos=res_todos) return render_template("todo.html", todos=res_todos)
### /stolen

3
boards.py Normal file
View File

@ -0,0 +1,3 @@
board_list = [
'b','a','d'
]

BIN
static/favicon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

0
static/src/vdk2ch.css Normal file
View File

View File

@ -4,17 +4,18 @@
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<!--
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/purecss@3.0.0/build/pure-min.css" integrity="sha384-X38yfunGUhNzHpBaEBsWLO+A0HDYOQi8ufWDkZ0k9e0eXz/tH3II7uKZ9msv++Ls" crossorigin="anonymous">
{% assets 'css' %} {% assets 'css' %}
<link rel="stylesheet" href="{{ ASSET_URL }}"> <link rel="stylesheet" href="{{ ASSET_URL }}">
{% endassets %} --> {% endassets %}
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/purecss@3.0.0/build/pure-min.css" integrity="sha384-X38yfunGUhNzHpBaEBsWLO+A0HDYOQi8ufWDkZ0k9e0eXz/tH3II7uKZ9msv++Ls" crossorigin="anonymous">
{% assets 'js' %} {% assets 'js' %}
<script type="text/javascript" src="{{ ASSET_URL }}"></script> <script type="text/javascript" src="{{ ASSET_URL }}"></script>
{% endassets %} {% endassets %}
<title>Flask + htmx</title> <link rel="shortcut icon" href="{{ url_for('static', filename='favicon.png') }}">
<title>Board++</title>
</head> </head>
<body class="bg-blue-100"> <body class="bg-blue-100">
{% block content %} {% block content %}

50
templates/board.html Normal file
View File

@ -0,0 +1,50 @@
{% extends "base.html" %}
{% block content %}
<div class="content">
<p>Вы тут: /{{board_id}}</p>
</div>
<nav>
<a href="/">glavnaya</a>
<br>
Доски:
<div class="boards">
<ul>
{% for board in boards %}
<li><a href="/boards/{{board}}">/{{board}}</a></li>
{% endfor %}
</ul>
</div>
</nav>
<table class="pure-table-odd">
<thead>
<tr>
<th class="">номер треда</th>
<th class="">номер поста</th>
<th class="">автор(ка)</th>
<th class="">пикча эта ваша</th>
<th class="">текст</th>
</tr>
</thead>
<tbody id="thread-results">
{% for thread in board_threads %}
<tr class="">
<td class="">{{thread.thread_num}}</td>
<td class="">{{thread.post_num}}</td>
<td class="">{{thread.name}}</td>
<td class="">
<img src="https://static.vdk2ch.ru/thread-pics/{{thread.pic_link}}" alt="" width="200" height="200">
</td>
<td class="">{{thread.txt}}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endblock content %}

28
templates/main-page.html Normal file
View File

@ -0,0 +1,28 @@
{% extends "base.html" %}
{% block content %}
<div class="host-id">Вас закинуло сюда: {{host_id}}</div>
<div class="content">
Dobro pozhalovat. AGAIN.
</div>
<nav>
<a routerLink = "/">Напоминание </a>
<br>
<a routerLink = "/about">О нас </a>
<br>
Доски:
<div class="boards">
<ul>
{% for board in boards %}
<li><a href="/boards/{{board}}">/{{board}}</a></li>
{% endfor %}
</ul>
</div>
</nav>
<img src="https://static.vdk2ch.ru/test-public/sin.jpg">
{% endblock content %}

View File

@ -1,7 +1,10 @@
{% extends "base.html" %} {% extends "base.html" %}
{% block content %} {% block content %}
<div class="w-small w-2/3 mx-auto py-10 text-gray-600">
<div class="panel-block">
<div class="w-small w-2/3 mx-auto py-10 text-gray-600">
<input <input
type="text" type="text"
name="search" name="search"
@ -13,20 +16,21 @@
class="bg-white h-10 px-5 pr-10 rounded-full text-2xl focus:outline-none" class="bg-white h-10 px-5 pr-10 rounded-full text-2xl focus:outline-none"
> >
<span class="htmx-indicator">Searching...</span> <span class="htmx-indicator">Searching...</span>
</div>
+dev 2
<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>
<th class="p-3 font-bold uppercase bg-gray-200 text-gray-600 border border-gray-300 hidden lg:table-cell">Title</th>
<th class="p-3 font-bold uppercase bg-gray-200 text-gray-600 border border-gray-300 hidden lg:table-cell">Completed</th>
</tr>
</thead>
<tbody id="todo-results">
{% include 'todo.html' %}
</tbody>
</table>
</div> </div>
+7 asdf
<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>
<th class="p-3 font-bold uppercase bg-gray-200 text-gray-600 border border-gray-300 hidden lg:table-cell">Title</th>
<th class="p-3 font-bold uppercase bg-gray-200 text-gray-600 border border-gray-300 hidden lg:table-cell">Completed</th>
</tr>
</thead>
<tbody id="todo-results">
{% include 'todo.html' %}
</tbody>
</table>
{% endblock content %} {% endblock content %}

11
threads.py Normal file
View File

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

45
threads_with_posts.py Normal file
View File

@ -0,0 +1,45 @@
# <id>: {<post_num>, <pic_link>, <texto>, <name>}
open_threads = {
'123': {
'thread_num': '123',
'post_num': '9999',
'pic_link': '16216445863900.jpg',
'txt': 'фыва',
'name': 'anonius'
},
'124': {
'thread_num': '124',
'post_num': '456',
'pic_link': '16672846165910.png',
'txt': 'Test',
'name': 'anonius'
},
'1': {
'thread_num': '123',
'post_num': '1',
'pic_link': '16211265989190.jpg',
'txt': 'фыва',
'name': 'anonius'
},
'44': {
'thread_num': '44',
'post_num': '12',
'pic_link': '15937598937440.png',
'txt': 'I hate my brother-nation..',
'name': 'Владимир Владимирович'
},
'99': {
'thread_num': '99',
'post_num': '55',
'pic_link': 'Экран-смерти.jpg',
'txt': 'фыва',
'name': 'anonius'
},
'1230': {
'thread_num': '1230',
'post_num': '1234',
'pic_link': '15906018690140.png',
'txt': '33333!',
'name': 'SIRNA'
}
}