Compare commits
No commits in common. "a57a964c601cb8c71058436a72ef966ce37e345b" and "ef65feaa7158b15269a4a300c74a8560470a5f5d" have entirely different histories.
a57a964c60
...
ef65feaa71
@ -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/reqs0.txt
|
COPY ./reqs.txt /app/reqs.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 reqs0.txt
|
RUN pip install -r reqs.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
|
||||||
|
22
app.py
22
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)
|
||||||
@ -24,14 +24,6 @@ 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():
|
||||||
return "<h1><center>Liveness check completed</center><h1>"
|
return "<h1><center>Liveness check completed</center><h1>"
|
||||||
@ -49,6 +41,7 @@ def homepage():
|
|||||||
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):
|
||||||
|
|
||||||
@ -56,15 +49,6 @@ 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():
|
||||||
|
@ -1,39 +0,0 @@
|
|||||||
/* украдено здесь 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,6 +20,45 @@
|
|||||||
</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,6 +21,7 @@
|
|||||||
</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>
|
||||||
@ -33,11 +34,13 @@
|
|||||||
</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>
|
||||||
</figcaption> -->
|
<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>
|
||||||
|
<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">
|
||||||
@ -49,24 +52,27 @@
|
|||||||
</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">
|
||||||
<!-- </figure> -->
|
</a>
|
||||||
|
</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','Экран-смерти.jpg','Экран-смерти.jpg','Экран-смерти.jpg','15937598937440.png','Экран-смерти.jpg','Экран-смерти.jpg'],
|
'pic_links': ['Экран-смерти.jpg'],
|
||||||
'txt': 'фыва',
|
'txt': 'фыва',
|
||||||
'name': 'anonius'
|
'name': 'anonius'
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user