This commit is contained in:
50
templates/answer-post.html
Normal file
50
templates/answer-post.html
Normal file
@@ -0,0 +1,50 @@
|
||||
<div class="card">
|
||||
<div class="card-content">
|
||||
<div class="row">
|
||||
<span class="card-title">Создай то, о чем будут говорить многие. Ты отвечаешь: <a href="#post-{{ target_post_id }}">>>{{ target_post_id }}</a></span>
|
||||
<a class="btn-floating halfway-fab waves-effect waves-light red" href="#post-{{ target_post_id }}"><i class="material-icons">>></i></a>
|
||||
<form hx-encoding='multipart/form-data' _='on htmx:xhr:progress(loaded, total) set #progress.value to (loaded/total)*100'>
|
||||
<div class="input-field col s6">
|
||||
<input id="send_this_text" name="send_this_text" type="text" >
|
||||
<label for="send_this_text">Печатать сюда</label>
|
||||
</div>
|
||||
<div class="input-field col s6">
|
||||
<input id="file" name="file" type="file" multiple>
|
||||
<label for="file">Upload</label>
|
||||
<progress id='progress' value='0' max='100'></progress>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-action">
|
||||
<a href="#answer-post">
|
||||
<button class="btn waves-effect waves-light"
|
||||
type="submit" name="action" hx-encoding='multipart/form-data'
|
||||
_='on htmx:xhr:progress(loaded, total) set #progress.value to (loaded/total)*100'
|
||||
hx-post="/post_to_another_post/{{ target_post_id }}"
|
||||
hx-target="#neu-posts"
|
||||
hx-include="[name='send_this_text'], [name='file']"
|
||||
>
|
||||
Отправить!!
|
||||
<i class="material-icons right">send</i>
|
||||
</button>
|
||||
</a>
|
||||
</div>
|
||||
<!-- <div class="row">
|
||||
<form hx-encoding='multipart/form-data' hx-post='/send_dudes'
|
||||
_='on htmx:xhr:progress(loaded, total) set #progress.value to (loaded/total)*100'>
|
||||
<input type='file' name='file'>
|
||||
<button>
|
||||
Upload
|
||||
</button>
|
||||
<progress id='progress' value='0' max='100'></progress>
|
||||
</form>
|
||||
</div> -->
|
||||
<!-- <h1>Загрузить картинку:</h1>
|
||||
<input type="file" #file placeholder="Загрузить картинку" (change)="sendPic($event)" style="display:none;">
|
||||
<button type="button" class="btn btn-success" (click)="file.click()">Загрузить картинку</button>
|
||||
<div *ngFor="let singlePic of inputImages" >Картинка: {{singlePic}}</div>
|
||||
<p>
|
||||
<button (click)="eraseData()" >Убрать картинку</button>
|
||||
</p> -->
|
||||
</div>
|
||||
@@ -4,7 +4,20 @@
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<<<<<<< HEAD
|
||||
|
||||
=======
|
||||
|
||||
<!-- Compiled and minified CSS -->
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.min.css">
|
||||
<!-- Compiled and minified JavaScript -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/js/materialize.min.js"></script>
|
||||
|
||||
|
||||
<script src="https://unpkg.com/htmx.org@1.9.3" integrity="sha384-lVb3Rd/Ca0AxaoZg5sACe8FJKF0tnUgR2Kd7ehUOG5GCcROv5uBIZsOqovBAcWua" crossorigin="anonymous"></script>
|
||||
<script src="https://unpkg.com/hyperscript.org@0.9.9"></script>
|
||||
|
||||
>>>>>>> dev
|
||||
{% assets 'css' %}
|
||||
<link rel="stylesheet" href="{{ ASSET_URL }}">
|
||||
{% endassets %}
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
{% 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>
|
||||
|
||||
|
||||
{% include 'posts.html' %}
|
||||
|
||||
{% endblock content %}
|
||||
@@ -2,9 +2,9 @@
|
||||
{% for posto in postos %}
|
||||
<div class="row">
|
||||
{% if posto.root_post %}
|
||||
<div class="card s4 deep-orange accent-4 darken-1">
|
||||
<div class="card s5 deep-orange accent-4 darken-1">
|
||||
{% else %}
|
||||
<div class="card s4 blue-grey darken-1">
|
||||
<div class="card s5 blue-grey darken-1">
|
||||
{% endif %}
|
||||
<div class="row" id="post-{{ posto._key }}">
|
||||
<div class="col s4">
|
||||
@@ -29,11 +29,31 @@
|
||||
<a class="card-action" href="#post-{{ posto.parent_post }}"> >>{{ posto.parent_post }} </a>
|
||||
{% endif %}
|
||||
<p>{{ posto.texto }}</p>
|
||||
|
||||
{% if posto.answers_list[0] | length > 0 %}
|
||||
<br>
|
||||
<p>Ответы:</p>
|
||||
<div class="collection">
|
||||
{% for ans in posto.answers_list[0] %}
|
||||
{% if (posto.answers_list[1])[loop.index-1] > 0 %}
|
||||
{% if (posto.answers_list[2])[loop.index-1] > 0 %}
|
||||
<a href="#post-{{ (posto.answers_list[0])[loop.index-1] }}" class="collection-item">>>{{ (posto.answers_list[0])[loop.index-1] }} (ответов {{ (posto.answers_list[1])[loop.index-1] }}, длина {{ (posto.answers_list[2])[loop.index-1] }})</a>
|
||||
{% else %}
|
||||
<a href="#post-{{ (posto.answers_list[0])[loop.index-1] }}" class="collection-item">>>{{ (posto.answers_list[0])[loop.index-1] }} (ответов {{ (posto.answers_list[1])[loop.index-1] }})</a>
|
||||
{% endif %}
|
||||
{% else %}
|
||||
<a href="#post-{{ (posto.answers_list[0])[loop.index-1] }}" class="collection-item">>>{{ (posto.answers_list[0])[loop.index-1] }}</a>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col s12">
|
||||
<!-- TODO !подгрузка следующего поста в конец треда без перезагрузки всего треда! -->
|
||||
<div class="card-action right">
|
||||
<a href="#" hx-post="/post_my_post/{{ posto._key }}" hx-target="#neu-posts" >Answer me!</a>
|
||||
<!-- <a href="#" hx-post="/post_my_post/{{ posto._key }}" hx-target="#neu-posts" >Answer me!</a> -->
|
||||
<a href="#answer-post" hx-post="/answer_post/{{ posto._key }}" hx-target="#answer-post" >Ответить этому.</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -4,13 +4,18 @@
|
||||
|
||||
|
||||
{% include 'navbar.html' %}
|
||||
|
||||
|
||||
<div class="row" >
|
||||
<div class="col s5" id="neu-posts">
|
||||
<div class="col s6 m5" id="neu-posts">
|
||||
{% include 'i-posts.html' %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col s7 m6" id="answer-post">
|
||||
{% include 'answer-post.html' %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endblock content %}
|
||||
@@ -3,7 +3,7 @@
|
||||
<div class="nav-wrapper purple darken-3">
|
||||
<ul id="nav-mobile" class="left ">
|
||||
<li> <a href="/">glavnaya</a> </li>
|
||||
<li><a href="/db_posts"><span class="new badge red" data-badge-caption="">here we go</span></a> </li>
|
||||
<li><a href="/db_posts"><span class="new badge red" data-badge-caption="">and here we go again..</span></a> </li>
|
||||
<li>
|
||||
<a href="#">Вас закинуло сюда: <span class="new badge blue" data-badge-caption="">{{host_id}}</span></a>
|
||||
</li>
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<div class="panel-block">
|
||||
|
||||
<div class="w-small w-2/3 mx-auto py-10 text-gray-600">
|
||||
<input
|
||||
type="text"
|
||||
name="search"
|
||||
hx-post="/search"
|
||||
hx-trigger="keyup changed delay:250ms"
|
||||
hx-indicator=".htmx-indicator"
|
||||
hx-target="#todo-results"
|
||||
placeholder="Search"
|
||||
class="bg-white h-10 px-5 pr-10 rounded-full text-2xl focus:outline-none"
|
||||
>
|
||||
<span class="htmx-indicator">Searching...</span>
|
||||
</div>
|
||||
+dev 3
|
||||
|
||||
|
||||
<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>
|
||||
{% endblock content %}
|
||||
@@ -1,75 +0,0 @@
|
||||
{% if board_threads|length>0 %}
|
||||
{% for thread in board_threads %}
|
||||
<div class="post post_type_reply post_withimg" id="post-15135655" data-num="15135655">
|
||||
<div class="post__details" id="post-details-15135655">
|
||||
<input type="checkbox" name="delete" class="turnmeoff" value="15135655">
|
||||
<span class="post__detailpart">
|
||||
<span class="post__anon">{{thread.name}}</span>
|
||||
</span>
|
||||
<span class="post__detailpart">
|
||||
<span class="post__time">05/07/23 Срд 14:53:58</span>
|
||||
</span>
|
||||
<span class="post__detailpart">
|
||||
<a href="/news/res/15135633.html#15135655" id="15135655" class="post__reflink">№</a>
|
||||
<a href="/news/res/15135633.html#15135655" class="js-post-reply-btn post__reflink" data-num="15135655">{{thread.post_num}}</a>
|
||||
<span class="post__number">2</span></span>
|
||||
<span class="post__detailpart">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="post__btn post__btn_type_menu icon desktop" data-num="15135655"><use xlink:href="#icon__addmenu"></use></svg>
|
||||
<span data-num="15135655" onclick="addAdminMenu(this); return false;" onmouseout="removeAdminMenu(event); return false;" style="display: flex;">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="post__btn post__btn_type_adm icon"><use xlink:href="#icon__report"></use></svg>
|
||||
</span>
|
||||
</span>
|
||||
</div>
|
||||
<div class="post__images post__images_type_multi">
|
||||
<!-- <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">
|
||||
<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>
|
||||
</div> -->
|
||||
<!-- <figure class="post__image">
|
||||
<figcaption class="post__file-attr">
|
||||
<a class="desktop" target="_blank" href="https://static.vdk2ch.ru/thread-pics/{{pic}}" title="image.png">{{pic}}</a>
|
||||
|
||||
</figcaption> -->
|
||||
<!-- <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>
|
||||
<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> -->
|
||||
|
||||
<!-- <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> -->
|
||||
|
||||
|
||||
|
||||
<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>
|
||||
<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>
|
||||
|
||||
{{thread.txt}}
|
||||
</article>
|
||||
<div id="refmap-15135655" class="post__refmap" style="display: none;"></div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
@@ -1,15 +0,0 @@
|
||||
{% if todos|length>0 %}
|
||||
{% for todo in todos %}
|
||||
<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">{{todo.id}}</td>
|
||||
<td class="w-full lg:w-auto p-3 text-gray-800 text-center border border-b block lg:table-cell relative lg:static">{{todo.title}}</td>
|
||||
<td class="w-full lg:w-auto p-3 text-gray-800 text-center border border-b block lg:table-cell relative lg:static">
|
||||
{% if todo.completed %}
|
||||
<span class="rounded bg-green-400 py-1 px-3 text-xs font-bold">Yes</span>
|
||||
{% else %}
|
||||
<span class="rounded bg-red-400 py-1 px-3 text-xs font-bold">No</span>
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
Reference in New Issue
Block a user