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]]
|
||||
name = "html-minifier"
|
||||
version = "4.0.0"
|
||||
version = "5.0.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "18f74036e4be1b97eaf78bcf795d55002eccf613d5c4705bf78d3b92649ab00f"
|
||||
checksum = "cb8f62e1c8ee7bbdda853aebbbfb78b75a549a45ab031665a5da07a1579a1ad8"
|
||||
dependencies = [
|
||||
"cow-utils",
|
||||
"educe",
|
||||
@ -1753,9 +1753,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "minifier"
|
||||
version = "0.2.2"
|
||||
version = "0.3.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8eb022374af2f446981254e6bf9efb6e2c9e1a53176d395fca02792fd4435729"
|
||||
checksum = "95bbbf96b9ac3482c2a25450b67a15ed851319bc5fabf3b40742ea9066e84282"
|
||||
|
||||
[[package]]
|
||||
name = "minimal-lexical"
|
||||
|
@ -44,7 +44,7 @@ toml = "0.8.6"
|
||||
[build-dependencies]
|
||||
anyhow = "1.0.74"
|
||||
glob = "0.3.1"
|
||||
html-minifier = "4.0.0"
|
||||
html-minifier = "5.0.0"
|
||||
|
||||
[profile.dev]
|
||||
opt-level = 1
|
||||
|
@ -2,12 +2,20 @@ use actix_web::{get, web::Data, HttpRequest, HttpResponse};
|
||||
use askama::Template;
|
||||
|
||||
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)]
|
||||
#[template(path = "index.html")]
|
||||
|
||||
struct IndexTemplate {
|
||||
tcx: TemplateCtx,
|
||||
boards: Vec<Board>,
|
||||
posts: Vec<Post>,
|
||||
files: Vec<Post>,
|
||||
}
|
||||
@ -15,10 +23,12 @@ struct IndexTemplate {
|
||||
#[get("/")]
|
||||
pub async fn index(ctx: Data<Ctx>, req: HttpRequest) -> Result<HttpResponse, NekrochanError> {
|
||||
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 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)
|
||||
}
|
||||
|
@ -20,7 +20,7 @@ details {
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
details:last-child {
|
||||
details:last-of-type {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
@ -228,7 +228,6 @@ summary {
|
||||
|
||||
.board-links {
|
||||
padding: 2px;
|
||||
border-bottom: 1px solid var(--box-border);
|
||||
}
|
||||
|
||||
.link-separator::after {
|
||||
@ -249,6 +248,11 @@ summary {
|
||||
clear: both;
|
||||
}
|
||||
|
||||
.footer {
|
||||
text-align: center;
|
||||
font-size: 8pt;
|
||||
}
|
||||
|
||||
.post {
|
||||
margin-bottom: 8px;
|
||||
padding: 8px;
|
||||
@ -420,7 +424,7 @@ summary {
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.recent-posts {
|
||||
.infobox-list {
|
||||
list-style-type: none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
|
@ -29,6 +29,14 @@
|
||||
{% endif %}
|
||||
</span>
|
||||
</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>
|
||||
</html>
|
||||
|
@ -17,4 +17,4 @@
|
||||
<input class="button" type="submit" value="Upravit">
|
||||
</form>
|
||||
</div>
|
||||
{% endblock content %}
|
||||
{% endblock %}
|
||||
|
@ -8,13 +8,27 @@
|
||||
<h1 class="title">{{ tcx.cfg.site.name }}</h1>
|
||||
<p class="description">{{ tcx.cfg.site.description }}</p>
|
||||
</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() %}
|
||||
<div class="infobox">
|
||||
<div class="infobox-head">
|
||||
Nejnovější příspěvky
|
||||
</div>
|
||||
<div class="infobox-content">
|
||||
<ul class="recent-posts">
|
||||
<ul class="infobox-list">
|
||||
{% for post in posts %}
|
||||
<li><b>/{{ post.board }}/</b>: <a href="{{ post.post_url() }}">{{ post.content_nomarkup|inline_post }}</a></li>
|
||||
{% endfor %}
|
||||
|
@ -64,5 +64,4 @@
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
<hr>
|
||||
{% endblock %}
|
||||
|
@ -34,8 +34,8 @@
|
||||
<input class="button" type="submit" value="Odstranit vybrané">
|
||||
{% endif %}
|
||||
</form>
|
||||
<hr>
|
||||
{% if tcx.perms.owner() %}
|
||||
<hr>
|
||||
<h2>Vytvořit účet</h2>
|
||||
<form method="post" action="/staff/actions/create-account">
|
||||
<table class="form-table">
|
||||
@ -52,6 +52,5 @@
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
<hr>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
@ -42,5 +42,4 @@
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
<hr>
|
||||
{% endblock %}
|
||||
|
@ -41,5 +41,4 @@
|
||||
|
||||
<input class="button" type="submit" value="Odstranit vybrané">
|
||||
</form>
|
||||
<hr>
|
||||
{% endblock %}
|
||||
|
@ -174,5 +174,4 @@
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
<hr>
|
||||
{% endblock %}
|
||||
|
@ -76,5 +76,4 @@
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
<hr>
|
||||
{% endblock %}
|
||||
|
@ -26,5 +26,4 @@
|
||||
</div>
|
||||
<hr>
|
||||
{% call pagination::pagination("/staff/logs", pages, page) %}
|
||||
<hr>
|
||||
{% endblock %}
|
||||
|
@ -131,5 +131,4 @@
|
||||
{% endif %}
|
||||
</table>
|
||||
</form>
|
||||
<hr>
|
||||
{% endblock %}
|
||||
|
@ -10,5 +10,4 @@
|
||||
{% call staff_nav::staff_nav(tcx.perms) %}
|
||||
<hr>
|
||||
<h1>Dočasně nedostupné</h1>
|
||||
<hr>
|
||||
{% endblock %}
|
||||
|
Načítá se…
Odkázat v novém úkolu
Zablokovat Uživatele