footer nebo jak se tomu říká
Tento commit je obsažen v:
rodič
bde9a95bd6
revize
3e12aeffb9
8
Cargo.lock
vygenerováno
8
Cargo.lock
vygenerováno
@ -1395,9 +1395,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "html-minifier"
|
name = "html-minifier"
|
||||||
version = "4.0.0"
|
version = "5.0.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "18f74036e4be1b97eaf78bcf795d55002eccf613d5c4705bf78d3b92649ab00f"
|
checksum = "cb8f62e1c8ee7bbdda853aebbbfb78b75a549a45ab031665a5da07a1579a1ad8"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cow-utils",
|
"cow-utils",
|
||||||
"educe",
|
"educe",
|
||||||
@ -1753,9 +1753,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "minifier"
|
name = "minifier"
|
||||||
version = "0.2.2"
|
version = "0.3.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "8eb022374af2f446981254e6bf9efb6e2c9e1a53176d395fca02792fd4435729"
|
checksum = "95bbbf96b9ac3482c2a25450b67a15ed851319bc5fabf3b40742ea9066e84282"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "minimal-lexical"
|
name = "minimal-lexical"
|
||||||
|
@ -44,7 +44,7 @@ toml = "0.8.6"
|
|||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
anyhow = "1.0.74"
|
anyhow = "1.0.74"
|
||||||
glob = "0.3.1"
|
glob = "0.3.1"
|
||||||
html-minifier = "4.0.0"
|
html-minifier = "5.0.0"
|
||||||
|
|
||||||
[profile.dev]
|
[profile.dev]
|
||||||
opt-level = 1
|
opt-level = 1
|
||||||
|
@ -2,12 +2,20 @@ use actix_web::{get, web::Data, HttpRequest, HttpResponse};
|
|||||||
use askama::Template;
|
use askama::Template;
|
||||||
|
|
||||||
use super::tcx::TemplateCtx;
|
use super::tcx::TemplateCtx;
|
||||||
use crate::{ctx::Ctx, db::models::Post, error::NekrochanError, filters, web::template_response};
|
use crate::{
|
||||||
|
ctx::Ctx,
|
||||||
|
db::models::{Board, Post},
|
||||||
|
error::NekrochanError,
|
||||||
|
filters,
|
||||||
|
web::template_response,
|
||||||
|
};
|
||||||
|
|
||||||
#[derive(Template)]
|
#[derive(Template)]
|
||||||
#[template(path = "index.html")]
|
#[template(path = "index.html")]
|
||||||
|
|
||||||
struct IndexTemplate {
|
struct IndexTemplate {
|
||||||
tcx: TemplateCtx,
|
tcx: TemplateCtx,
|
||||||
|
boards: Vec<Board>,
|
||||||
posts: Vec<Post>,
|
posts: Vec<Post>,
|
||||||
files: Vec<Post>,
|
files: Vec<Post>,
|
||||||
}
|
}
|
||||||
@ -15,10 +23,12 @@ struct IndexTemplate {
|
|||||||
#[get("/")]
|
#[get("/")]
|
||||||
pub async fn index(ctx: Data<Ctx>, req: HttpRequest) -> Result<HttpResponse, NekrochanError> {
|
pub async fn index(ctx: Data<Ctx>, req: HttpRequest) -> Result<HttpResponse, NekrochanError> {
|
||||||
let tcx = TemplateCtx::new(&ctx, &req).await?;
|
let tcx = TemplateCtx::new(&ctx, &req).await?;
|
||||||
|
|
||||||
|
let boards = Board::read_all(&ctx).await?;
|
||||||
let posts = Post::read_latest(&ctx).await.unwrap_or_else(|_| Vec::new());
|
let posts = Post::read_latest(&ctx).await.unwrap_or_else(|_| Vec::new());
|
||||||
let files = Post::read_files(&ctx).await.unwrap_or_else(|_| Vec::new());
|
let files = Post::read_files(&ctx).await.unwrap_or_else(|_| Vec::new());
|
||||||
|
|
||||||
let template = IndexTemplate { tcx, posts, files };
|
let template = IndexTemplate { tcx, boards, posts, files };
|
||||||
|
|
||||||
template_response(&template)
|
template_response(&template)
|
||||||
}
|
}
|
||||||
|
@ -20,7 +20,7 @@ details {
|
|||||||
margin-bottom: 8px;
|
margin-bottom: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
details:last-child {
|
details:last-of-type {
|
||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -228,7 +228,6 @@ summary {
|
|||||||
|
|
||||||
.board-links {
|
.board-links {
|
||||||
padding: 2px;
|
padding: 2px;
|
||||||
border-bottom: 1px solid var(--box-border);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.link-separator::after {
|
.link-separator::after {
|
||||||
@ -249,6 +248,11 @@ summary {
|
|||||||
clear: both;
|
clear: both;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.footer {
|
||||||
|
text-align: center;
|
||||||
|
font-size: 8pt;
|
||||||
|
}
|
||||||
|
|
||||||
.post {
|
.post {
|
||||||
margin-bottom: 8px;
|
margin-bottom: 8px;
|
||||||
padding: 8px;
|
padding: 8px;
|
||||||
@ -420,7 +424,7 @@ summary {
|
|||||||
margin-bottom: 8px;
|
margin-bottom: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.recent-posts {
|
.infobox-list {
|
||||||
list-style-type: none;
|
list-style-type: none;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
|
@ -29,6 +29,14 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="main">{% block content %}{% endblock %}</div>
|
<div class="main">
|
||||||
|
{% block content %}{% endblock %}
|
||||||
|
<hr>
|
||||||
|
<div class="footer">
|
||||||
|
<a href="https://git.nekrofilie.com/sneedmaster/nekrochan">nekrochan</a> - Projekt <a href="https://nekrofilie.com/">Nekrofilie</a>
|
||||||
|
<br>
|
||||||
|
<span>Všechny příspěvky na této stránce byly vytvořeny náhodnými uživateli.</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@ -17,4 +17,4 @@
|
|||||||
<input class="button" type="submit" value="Upravit">
|
<input class="button" type="submit" value="Upravit">
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
{% endblock content %}
|
{% endblock %}
|
||||||
|
@ -8,13 +8,27 @@
|
|||||||
<h1 class="title">{{ tcx.cfg.site.name }}</h1>
|
<h1 class="title">{{ tcx.cfg.site.name }}</h1>
|
||||||
<p class="description">{{ tcx.cfg.site.description }}</p>
|
<p class="description">{{ tcx.cfg.site.description }}</p>
|
||||||
</div>
|
</div>
|
||||||
|
{% if !boards.is_empty() %}
|
||||||
|
<div class="infobox">
|
||||||
|
<div class="infobox-head">
|
||||||
|
Nástěnky
|
||||||
|
</div>
|
||||||
|
<div class="infobox-content">
|
||||||
|
<ul class="infobox-list">
|
||||||
|
{% for board in boards %}
|
||||||
|
<li><a href="/boards/{{ board.id }}">/{{ board.id }}/ - {{ board.name }}</a></li>
|
||||||
|
{% endfor %}
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
{% if !posts.is_empty() %}
|
{% if !posts.is_empty() %}
|
||||||
<div class="infobox">
|
<div class="infobox">
|
||||||
<div class="infobox-head">
|
<div class="infobox-head">
|
||||||
Nejnovější příspěvky
|
Nejnovější příspěvky
|
||||||
</div>
|
</div>
|
||||||
<div class="infobox-content">
|
<div class="infobox-content">
|
||||||
<ul class="recent-posts">
|
<ul class="infobox-list">
|
||||||
{% for post in posts %}
|
{% for post in posts %}
|
||||||
<li><b>/{{ post.board }}/</b>: <a href="{{ post.post_url() }}">{{ post.content_nomarkup|inline_post }}</a></li>
|
<li><b>/{{ post.board }}/</b>: <a href="{{ post.post_url() }}">{{ post.content_nomarkup|inline_post }}</a></li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
@ -64,5 +64,4 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</form>
|
</form>
|
||||||
<hr>
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
@ -34,8 +34,8 @@
|
|||||||
<input class="button" type="submit" value="Odstranit vybrané">
|
<input class="button" type="submit" value="Odstranit vybrané">
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</form>
|
</form>
|
||||||
<hr>
|
|
||||||
{% if tcx.perms.owner() %}
|
{% if tcx.perms.owner() %}
|
||||||
|
<hr>
|
||||||
<h2>Vytvořit účet</h2>
|
<h2>Vytvořit účet</h2>
|
||||||
<form method="post" action="/staff/actions/create-account">
|
<form method="post" action="/staff/actions/create-account">
|
||||||
<table class="form-table">
|
<table class="form-table">
|
||||||
@ -52,6 +52,5 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</form>
|
</form>
|
||||||
<hr>
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
@ -42,5 +42,4 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</form>
|
</form>
|
||||||
<hr>
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
@ -41,5 +41,4 @@
|
|||||||
|
|
||||||
<input class="button" type="submit" value="Odstranit vybrané">
|
<input class="button" type="submit" value="Odstranit vybrané">
|
||||||
</form>
|
</form>
|
||||||
<hr>
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
@ -174,5 +174,4 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</form>
|
</form>
|
||||||
<hr>
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
@ -76,5 +76,4 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</form>
|
</form>
|
||||||
<hr>
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
@ -26,5 +26,4 @@
|
|||||||
</div>
|
</div>
|
||||||
<hr>
|
<hr>
|
||||||
{% call pagination::pagination("/staff/logs", pages, page) %}
|
{% call pagination::pagination("/staff/logs", pages, page) %}
|
||||||
<hr>
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
@ -131,5 +131,4 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
</table>
|
</table>
|
||||||
</form>
|
</form>
|
||||||
<hr>
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
@ -10,5 +10,4 @@
|
|||||||
{% call staff_nav::staff_nav(tcx.perms) %}
|
{% call staff_nav::staff_nav(tcx.perms) %}
|
||||||
<hr>
|
<hr>
|
||||||
<h1>Dočasně nedostupné</h1>
|
<h1>Dočasně nedostupné</h1>
|
||||||
<hr>
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
Načítá se…
Odkázat v novém úkolu
Zablokovat Uživatele