Compare commits
35 Commits
ef65feaa71
...
a57a964c60
Author | SHA1 | Date | |
---|---|---|---|
|
a57a964c60 | ||
|
9847f24432 | ||
|
6c4235bed1 | ||
|
0118b859d1 | ||
|
b69f359af9 | ||
|
74cf65b299 | ||
|
578e3eae3d | ||
|
62c27f9729 | ||
|
742f32b5c5 | ||
|
d354cb1ab2 | ||
|
04ca092bae | ||
|
b6b9e2426d | ||
|
6fbb7b035c | ||
|
52b73d89dc | ||
|
685a53ffee | ||
|
7579471b77 | ||
|
2b817b96c6 | ||
|
0ce9283cc7 | ||
|
8cdcab76d5 | ||
|
ddfb8f217a | ||
|
4e583b6507 | ||
|
375994a607 | ||
|
3d13563437 | ||
|
88e1b7afdd | ||
|
55f0db1a33 | ||
|
16a249c9d4 | ||
|
66cc98ecfc | ||
|
1cde8d0d02 | ||
|
3adcc12242 | ||
|
1016d11ae2 | ||
|
38d9e1443f | ||
|
77b3520b12 | ||
|
f952ef97c6 | ||
|
22d5932d8d | ||
|
e18923fe3a |
@ -2,13 +2,13 @@
|
|||||||
FROM python:3.11-alpine
|
FROM python:3.11-alpine
|
||||||
|
|
||||||
# copy the requirements file into the image
|
# copy the requirements file into the image
|
||||||
COPY ./reqs.txt /app/reqs.txt
|
COPY ./reqs.txt /app/reqs0.txt
|
||||||
|
|
||||||
# switch working directory
|
# switch working directory
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# install the dependencies and packages in the requirements file
|
# install the dependencies and packages in the requirements file
|
||||||
RUN pip install -r reqs.txt
|
RUN pip install -r reqs0.txt
|
||||||
|
|
||||||
# copy every content from the local file to the image
|
# copy every content from the local file to the image
|
||||||
COPY . /app
|
COPY . /app
|
||||||
|
24
app.py
24
app.py
@ -1,13 +1,13 @@
|
|||||||
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 boards import board_list
|
||||||
from threads import threads_lists
|
from threads import threads_lists
|
||||||
from threads_with_posts import open_threads
|
from threads_with_posts import open_threads
|
||||||
|
from arango import ArangoClient
|
||||||
|
|
||||||
import socket
|
import socket
|
||||||
|
|
||||||
|
|
||||||
app = Flask(__name__)
|
app = Flask(__name__)
|
||||||
|
|
||||||
assets = Environment(app)
|
assets = Environment(app)
|
||||||
@ -23,6 +23,14 @@ js.build()
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
arango_client = ArangoClient(hosts='https://arango.vdk2ch.ru')
|
||||||
|
db = arango_client.db('board1', username='root', password='stolendick527')
|
||||||
|
|
||||||
|
# предполагается что меняться список будет весьма редко, поэтому подхватываем при лишь при перезапуске
|
||||||
|
boards0 = db.collection('boards')
|
||||||
|
board_list = [ k['_key'] for k in boards0]
|
||||||
|
|
||||||
|
|
||||||
@app.route('/liveness')
|
@app.route('/liveness')
|
||||||
def healthx():
|
def healthx():
|
||||||
@ -40,8 +48,7 @@ def homepage():
|
|||||||
docker_short_id = socket.gethostname()
|
docker_short_id = socket.gethostname()
|
||||||
return render_template("main-page.html", host_id=docker_short_id, boards=board_list)
|
return render_template("main-page.html", host_id=docker_short_id, boards=board_list)
|
||||||
|
|
||||||
|
|
||||||
### stolen
|
|
||||||
@app.route("/boards/<board_id>")
|
@app.route("/boards/<board_id>")
|
||||||
def page_board(board_id):
|
def page_board(board_id):
|
||||||
|
|
||||||
@ -49,6 +56,15 @@ def page_board(board_id):
|
|||||||
return render_template("board.html", board_id=board_id, boards=board_list, board_threads=b_threads)
|
return render_template("board.html", board_id=board_id, boards=board_list, board_threads=b_threads)
|
||||||
|
|
||||||
|
|
||||||
|
# @app.route('/post_my_post', method=['POST'])
|
||||||
|
# def post_a_post():
|
||||||
|
# pass
|
||||||
|
|
||||||
|
# @app.route('/post_my_file', method=['POST'])
|
||||||
|
# def post_a_file():
|
||||||
|
# pass
|
||||||
|
|
||||||
|
|
||||||
### stolen
|
### stolen
|
||||||
@app.route("/todo")
|
@app.route("/todo")
|
||||||
def page_todo():
|
def page_todo():
|
||||||
|
@ -0,0 +1,39 @@
|
|||||||
|
/* украдено здесь https://css-tricks.com/hexagons-and-beyond-flexible-responsive-grid-patterns-sans-media-queries/ */
|
||||||
|
|
||||||
|
.hex-main {
|
||||||
|
display:flex;
|
||||||
|
--s: 100px; /* size */
|
||||||
|
--m: 4px; /* margin */
|
||||||
|
--f: calc(1.732 * var(--s) + 4 * var(--m) - 1px);
|
||||||
|
max-width: 440px;
|
||||||
|
margin: 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hex-container {
|
||||||
|
font-size: 0; /*disable white space between inline block element */
|
||||||
|
}
|
||||||
|
|
||||||
|
.hex-container img {
|
||||||
|
width: var(--s);
|
||||||
|
margin: var(--m);
|
||||||
|
height: calc(var(--s)*1.1547);
|
||||||
|
display: inline-block;
|
||||||
|
font-size:initial;
|
||||||
|
clip-path: polygon(0% 25%, 0% 75%, 50% 100%, 100% 75%, 100% 25%, 50% 0%);
|
||||||
|
background: red;
|
||||||
|
margin-bottom: calc(var(--m) - var(--s)*0.2885);
|
||||||
|
}
|
||||||
|
|
||||||
|
.hex-container img:nth-child(odd) {
|
||||||
|
background:green;
|
||||||
|
}
|
||||||
|
.hex-container::before {
|
||||||
|
content: "";
|
||||||
|
width: calc(var(--s)/2 + var(--m));
|
||||||
|
float: left;
|
||||||
|
height: 120%;
|
||||||
|
shape-outside: repeating-linear-gradient(
|
||||||
|
#0000 0 calc(var(--f) - 3px),
|
||||||
|
#000 0 var(--f));
|
||||||
|
}
|
||||||
|
|
@ -20,45 +20,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</nav>
|
</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="">
|
|
||||||
<a href="https://static.vdk2ch.ru/thread-pics/{{thread.pic_links}}" target=”_blank”>
|
|
||||||
<svg viewBox="0 0 100 100" version="1.1" xmlns="http://www.w3.org/2000/svg">
|
|
||||||
<defs>
|
|
||||||
<pattern id="img-{{thread.post_num}}" patternUnits="userSpaceOnUse" width="100" height="100">
|
|
||||||
<image xlink:href="https://static.vdk2ch.ru/thread-pics/{{thread.pic_links}}" x="-25" width="150" height="100" />
|
|
||||||
</pattern>
|
|
||||||
</defs>
|
|
||||||
<polygon points="50 1 95 25 95 75 50 99 5 75 5 25" fill="url(#img-{{thread.post_num}})"/>
|
|
||||||
</svg>
|
|
||||||
</a>
|
|
||||||
<img src="https://static.vdk2ch.ru/thread-pics/{{thread.pic_links}}" alt="" width="200" height="200">
|
|
||||||
</td>
|
|
||||||
<td class="">{{thread.thread_num}}</td>
|
|
||||||
<td class="">{{thread.post_num}}</td>
|
|
||||||
<td class="">{{thread.name}}</td>
|
|
||||||
<td class="">{{thread.txt}}</td>
|
|
||||||
|
|
||||||
</tr>
|
|
||||||
{% endfor %}
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
-->
|
|
||||||
|
|
||||||
|
|
||||||
<li>
|
<li>
|
||||||
|
|
||||||
{% include 'posts.html' %}
|
{% include 'posts.html' %}
|
||||||
|
@ -21,7 +21,6 @@
|
|||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="post__images post__images_type_multi">
|
<div class="post__images post__images_type_multi">
|
||||||
{% for pic in thread.pic_links %}
|
|
||||||
<!-- <div class="post__images">
|
<!-- <div class="post__images">
|
||||||
<svg class="post__file-preview " data-width="954" data-height="960" data-type="2" data-md5="15135655-d39bd5b1ed6c40e9a1d1eb2971a57584" data-title="image.png" viewBox="0 0 100 100" data-src="https://static.vdk2ch.ru/thread-pics/{{pic}}" width="168" height="170" version="1.1" xmlns="http://www.w3.org/2000/svg">
|
<svg class="post__file-preview " data-width="954" data-height="960" data-type="2" data-md5="15135655-d39bd5b1ed6c40e9a1d1eb2971a57584" data-title="image.png" viewBox="0 0 100 100" data-src="https://static.vdk2ch.ru/thread-pics/{{pic}}" width="168" height="170" version="1.1" xmlns="http://www.w3.org/2000/svg">
|
||||||
<defs>
|
<defs>
|
||||||
@ -34,13 +33,11 @@
|
|||||||
</use>
|
</use>
|
||||||
</svg>
|
</svg>
|
||||||
</div> -->
|
</div> -->
|
||||||
<figure class="post__image">
|
<!-- <figure class="post__image">
|
||||||
<figcaption class="post__file-attr">
|
<figcaption class="post__file-attr">
|
||||||
<a class="desktop" target="_blank" href="https://static.vdk2ch.ru/thread-pics/{{pic}}" title="image.png">{{pic}}</a>
|
<a class="desktop" target="_blank" href="https://static.vdk2ch.ru/thread-pics/{{pic}}" title="image.png">{{pic}}</a>
|
||||||
<!-- <svg xmlns="http://www.w3.org/2000/svg" class="icon js-post-findimg desktop"><use xlink:href="#icon__findimg"></use></svg>
|
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" class="icon js-post-saveimg desktop" data-url="https://static.vdk2ch.ru/thread-pics/{{pic}}" data-name="image.png"><use xlink:href="#icon__saveimg"></use></svg> -->
|
</figcaption> -->
|
||||||
</figcaption>
|
|
||||||
<a href="https://static.vdk2ch.ru/thread-pics/{{pic}}" class="post__image-link" target="_blank" onclick="return false;">
|
|
||||||
<!-- <svg visibility="visible" class="post__file-preview " data-width="954" data-height="960" data-type="2" data-md5="15135655-d39bd5b1ed6c40e9a1d1eb2971a57584" data-title="image.png" viewBox="0 0 100 100" data-src="https://static.vdk2ch.ru/thread-pics/{{pic}}" width="168" height="170" version="1.1" xmlns="http://www.w3.org/2000/svg">
|
<!-- <svg visibility="visible" class="post__file-preview " data-width="954" data-height="960" data-type="2" data-md5="15135655-d39bd5b1ed6c40e9a1d1eb2971a57584" data-title="image.png" viewBox="0 0 100 100" data-src="https://static.vdk2ch.ru/thread-pics/{{pic}}" width="168" height="170" version="1.1" xmlns="http://www.w3.org/2000/svg">
|
||||||
<defs>
|
<defs>
|
||||||
<pattern id="img-{{thread.post_num}}" patternUnits="userSpaceOnUse" width="100" height="100">
|
<pattern id="img-{{thread.post_num}}" patternUnits="userSpaceOnUse" width="100" height="100">
|
||||||
@ -52,27 +49,24 @@
|
|||||||
</use>
|
</use>
|
||||||
</svg> -->
|
</svg> -->
|
||||||
|
|
||||||
<img src="https://static.vdk2ch.ru/thread-pics/{{pic}}" alt="954x960" id="img-15135655-d39bd5b1ed6c40e9a1d1eb2971a57584" class="post__file-preview " data-type="2" data-title="image.png" data-width="954" data-height="960" data-md5="15135655-d39bd5b1ed6c40e9a1d1eb2971a57584" data-src="https://static.vdk2ch.ru/thread-pics/{{pic}}" width="168" height="170">
|
<!-- <img src="https://static.vdk2ch.ru/thread-pics/{{pic}}" alt="954x960" id="img-15135655-d39bd5b1ed6c40e9a1d1eb2971a57584" class="post__file-preview " data-type="2" data-title="image.png" data-width="954" data-height="960" data-md5="15135655-d39bd5b1ed6c40e9a1d1eb2971a57584" data-src="https://static.vdk2ch.ru/thread-pics/{{pic}}" width="168" height="170"> -->
|
||||||
</a>
|
<!-- </figure> -->
|
||||||
</figure>
|
|
||||||
{% endfor %}
|
|
||||||
|
|
||||||
|
<div class="hex-main">
|
||||||
|
<div class="hex-container">
|
||||||
|
{% for pic in thread.pic_links %}
|
||||||
|
<a href="https://static.vdk2ch.ru/thread-pics/{{pic}}" target="_blank" ">
|
||||||
|
<img src="https://static.vdk2ch.ru/thread-pics/{{pic}}" >
|
||||||
|
</a>
|
||||||
|
{% endfor %}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<article id="m15135655" class="post__message ">
|
<article id="m15135655" class="post__message ">
|
||||||
<a href="/news/res/15135633.html#15135633" class="post-reply-link" data-thread="15135633" data-num="15135633">>>15135633 (OP)</a><br>
|
<a href="/news/res/15135633.html#15135633" class="post-reply-link" data-thread="15135633" data-num="15135633">>>15135633 (OP)</a><br>
|
||||||
<!--
|
|
||||||
|
|
||||||
{% for pic in thread.pic_links %}
|
|
||||||
<svg class="post__file-preview " data-width="954" data-height="960" data-type="2" data-md5="15135655-d39bd5b1ed6c40e9a1d1eb2971a57584" data-title="image.png" viewBox="0 0 100 100" data-src="https://static.vdk2ch.ru/thread-pics/{{pic}}" width="168" height="170" version="1.1" xmlns="http://www.w3.org/2000/svg">
|
|
||||||
<defs>
|
|
||||||
<pattern id="img-{{thread.post_num}}" patternUnits="userSpaceOnUse" width="100" height="100">
|
|
||||||
<image xlink:href="https://static.vdk2ch.ru/thread-pics/{{pic}}" x="-25" width="150" height="100" />
|
|
||||||
</pattern>
|
|
||||||
</defs>
|
|
||||||
<use>
|
|
||||||
<polygon points="50 1 95 25 95 75 50 99 5 75 5 25" fill="url(#img-{{thread.post_num}})"/>
|
|
||||||
</use>
|
|
||||||
</svg>
|
|
||||||
{% endfor %} -->
|
|
||||||
{{thread.txt}}
|
{{thread.txt}}
|
||||||
</article>
|
</article>
|
||||||
<div id="refmap-15135655" class="post__refmap" style="display: none;"></div>
|
<div id="refmap-15135655" class="post__refmap" style="display: none;"></div>
|
||||||
|
@ -31,7 +31,7 @@ open_threads = {
|
|||||||
'99': {
|
'99': {
|
||||||
'thread_num': '99',
|
'thread_num': '99',
|
||||||
'post_num': '55',
|
'post_num': '55',
|
||||||
'pic_links': ['Экран-смерти.jpg'],
|
'pic_links': ['Экран-смерти.jpg','Экран-смерти.jpg','Экран-смерти.jpg','Экран-смерти.jpg','15937598937440.png','Экран-смерти.jpg','Экран-смерти.jpg'],
|
||||||
'txt': 'фыва',
|
'txt': 'фыва',
|
||||||
'name': 'anonius'
|
'name': 'anonius'
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user