,
pub password: String,
@@ -28,7 +28,6 @@ impl TemplateCtx {
let boards = ctx.cache().lrange("board_ids", 0, -1).await?;
let account = account_from_auth_opt(ctx, req).await?;
- let logged_in = account.is_some();
let perms = match &account {
Some(account) => account.perms(),
@@ -50,15 +49,17 @@ impl TemplateCtx {
let (ip, _) = ip_from_req(req)?;
let yous = ctx.cache().zrange(format!("by_ip:{ip}"), 0, -1).await?;
+ let account = account.map(|account| account.username);
+
let tcx = Self {
cfg,
boards,
- logged_in,
perms,
name,
password,
ip,
yous,
+ account,
};
Ok(tcx)
diff --git a/static/style.css b/static/style.css
index f8421ea..9a0d66d 100755
--- a/static/style.css
+++ b/static/style.css
@@ -54,7 +54,7 @@ summary {
padding: 0;
}
-.edit-post {
+.edit-box {
display: block;
width: 100%;
}
@@ -65,7 +65,7 @@ summary {
.form-table textarea,
.form-table select,
.input-wrapper,
-.edit-post {
+.edit-box {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
@@ -85,15 +85,11 @@ summary {
}
.form-table textarea,
-.edit-post {
+.edit-box {
height: 8rem;
resize: none;
}
-.form-table .submit .button {
- display: block;
- width: 100%;
-}
.reply-mode {
font-weight: bold;
@@ -139,6 +135,10 @@ summary {
margin-bottom: 0;
}
+.news {
+ margin: 8px 0;
+}
+
.box {
background-color: var(--box-color);
border-right: 1px solid var(--box-border);
@@ -213,6 +213,12 @@ summary {
table-layout: fixed;
}
+.form-table .button,
+.full-width {
+ display: block;
+ width: 100%;
+}
+
.banner {
display: block;
width: 100%;
diff --git a/templates/action.html b/templates/action.html
index 4fdaf35..30fc3d3 100644
--- a/templates/action.html
+++ b/templates/action.html
@@ -4,6 +4,7 @@
{% block content %}
+
Výsledek
Výsledek |
diff --git a/templates/banned.html b/templates/banned.html
index 51a0691..85877e3 100644
--- a/templates/banned.html
+++ b/templates/banned.html
@@ -52,7 +52,7 @@
|
-
+ |
|
diff --git a/templates/base.html b/templates/base.html
index ba1c614..4c53d24 100755
--- a/templates/base.html
+++ b/templates/base.html
@@ -16,11 +16,18 @@
{% endblock %}
diff --git a/templates/index.html b/templates/index.html
index 8466a4b..559faac 100755
--- a/templates/index.html
+++ b/templates/index.html
@@ -18,12 +18,14 @@
-
- {{ news.title }}
- {{ news.author }} - {{ news.created|czech_datetime }}
-
-
- {{ news.content|safe }}
+
+
+ {{ news.title }}
+ {{ news.author }} - {{ news.created|czech_datetime }}
+
+
+ {{ news.content|safe }}
+
|
diff --git a/templates/login.html b/templates/login.html
index 3735568..7f4d12a 100755
--- a/templates/login.html
+++ b/templates/login.html
@@ -9,14 +9,14 @@
diff --git a/templates/macros/catalog-entry.html b/templates/macros/catalog-entry.html
index a58c533..596d17d 100644
--- a/templates/macros/catalog-entry.html
+++ b/templates/macros/catalog-entry.html
@@ -18,6 +18,6 @@
{% endif %}
- {{ post.content|add_yous(post.board, tcx.yous)|safe }}
+ {{ post.content|add_yous(post.board, tcx.yous)|safe }}
{% endmacro %}
diff --git a/templates/macros/post-actions.html b/templates/macros/post-actions.html
index ebdebe6..7ec4ea6 100644
--- a/templates/macros/post-actions.html
+++ b/templates/macros/post-actions.html
@@ -40,7 +40,7 @@
-
+ |
|
-
+ |
{% endif %}
|
-
+ |
|
-
+ |
| Obsah |
-
+
|
Soubory |
- 1 %} multiple="multiple"{% endif %}{% if (!reply && board.config.0.require_thread_file) || (reply && board.config.0.require_reply_file) %} required="required"{% endif %}>
+ 1 %} multiple="multiple"{% endif %}{% if (!reply && board.config.0.require_thread_file) || (reply && board.config.0.require_reply_file) %} required=""{% endif %}>
|
@@ -58,7 +58,7 @@
-
+
|
{% endif %}
@@ -69,7 +69,7 @@
-
+
|
{% endif %}
@@ -77,9 +77,9 @@
{% endif %}
{% if reply %}
- |
+ |
{% else %}
- |
+ |
{% endif %}
diff --git a/templates/macros/post.html b/templates/macros/post.html
index 015f904..0ae6d07 100644
--- a/templates/macros/post.html
+++ b/templates/macros/post.html
@@ -57,6 +57,6 @@
{% endfor %}
{% endif %}
- {{ post.content|add_yous(post.board, tcx.yous)|safe }}
+ {{ post.content|add_yous(post.board, tcx.yous)|safe }}
{% endmacro %}
diff --git a/templates/macros/staff-nav.html b/templates/macros/staff-nav.html
index 7da8429..fede065 100644
--- a/templates/macros/staff-nav.html
+++ b/templates/macros/staff-nav.html
@@ -18,5 +18,9 @@
{% if tcx.perms.owner() || tcx.perms.reports() %}
[Hlášení]
{% endif %}
+
+ {% if tcx.perms.owner() || tcx.perms.news() %}
+ [Novinky]
+ {% endif %}
{% endmacro %}
diff --git a/templates/news.html b/templates/news.html
new file mode 100644
index 0000000..71d10d0
--- /dev/null
+++ b/templates/news.html
@@ -0,0 +1,19 @@
+{% extends "base.html" %}
+
+{% block title %}Novinky{% endblock %}
+
+{% block content %}
+
+
Novinky
+ {% for newspost in news %}
+
+
+ {{ newspost.title }}
+ {{ newspost.author }} - {{ newspost.created|czech_datetime }}
+
+
+
{{ newspost.content|safe }}
+
+ {% endfor %}
+
+{% endblock %}
\ No newline at end of file
diff --git a/templates/staff/account.html b/templates/staff/account.html
index 790d433..2e67809 100755
--- a/templates/staff/account.html
+++ b/templates/staff/account.html
@@ -13,14 +13,14 @@
@@ -31,18 +31,18 @@
@@ -55,12 +55,12 @@
Potvrdit |
-
+
|
- |
+ |
diff --git a/templates/staff/accounts.html b/templates/staff/accounts.html
index fe9c890..a03e789 100755
--- a/templates/staff/accounts.html
+++ b/templates/staff/accounts.html
@@ -41,14 +41,14 @@
diff --git a/templates/staff/banners.html b/templates/staff/banners.html
index b9e32ee..1da830b 100755
--- a/templates/staff/banners.html
+++ b/templates/staff/banners.html
@@ -35,10 +35,10 @@
diff --git a/templates/staff/bans.html b/templates/staff/bans.html
index 1716f3f..939dc03 100755
--- a/templates/staff/bans.html
+++ b/templates/staff/bans.html
@@ -26,7 +26,13 @@
{% for ban in bans %}
|
- {{ ban.ip_range.network() }}-{{ ban.ip_range.broadcast() }} |
+
+ {% if ban.ip_range.network() == ban.ip_range.broadcast() %}
+ {{ ban.ip_range.ip() }}
+ {% else %}
+ {{ ban.ip_range.network() }}-{{ ban.ip_range.broadcast() }}
+ {% endif %}
+ |
{% if let Some(board) = ban.board %}/{{ board }}/{% else %}Všechny{% endif %} |
{{ ban.reason }} |
{{ ban.issued_by }} |
diff --git a/templates/staff/board-config.html b/templates/staff/board-config.html
index c44ea67..56ddda4 100755
--- a/templates/staff/board-config.html
+++ b/templates/staff/board-config.html
@@ -23,32 +23,32 @@
Výchozí jméno |
- |
+ |
Velikost stránky |
- |
+ |
Počet stránek |
- |
+ |
Limit souborů |
- |
+ |
Limit naťuknutí |
- |
+ |
Limit odpovědí |
- |
+ |
@@ -156,21 +156,21 @@
Interval antispamu (IP) |
- |
+ |
Interval antispamu (Obsah) |
- |
+ |
Interval antispamu (IP+Obsah) |
- |
+ |
- |
+ |
diff --git a/templates/staff/boards.html b/templates/staff/boards.html
index 27282a1..32d4fd3 100755
--- a/templates/staff/boards.html
+++ b/templates/staff/boards.html
@@ -43,14 +43,14 @@
{% endif %}
@@ -61,18 +61,18 @@
diff --git a/templates/staff/edit-news.html b/templates/staff/edit-news.html
new file mode 100644
index 0000000..e348529
--- /dev/null
+++ b/templates/staff/edit-news.html
@@ -0,0 +1,24 @@
+{% extends "base.html" %}
+
+{% block title %}Upravit příspěvky{% endblock %}
+
+{% block content %}
+
+{% endblock %}
diff --git a/templates/staff/logs.html b/templates/staff/logs.html
deleted file mode 100755
index ff518c3..0000000
--- a/templates/staff/logs.html
+++ /dev/null
@@ -1,29 +0,0 @@
-{% import "../macros/pagination.html" as pagination %}
-{% import "../macros/staff-nav.html" as staff_nav %}
-
-{% extends "base.html" %}
-
-{% block title %}Záznamy{% endblock %}
-
-{% block content %}
-Záznamy
-{% call staff_nav::staff_nav() %}
-
-Záznamy
-
-
-
- Zpráva |
- Datum |
-
- {% for record in records %}
-
- {{ record.message }} |
- {{ record.created|czech_datetime }} |
-
- {% endfor %}
-
-
-
-{% call pagination::pagination("/staff/logs", pages, page) %}
-{% endblock %}
diff --git a/templates/staff/news.html b/templates/staff/news.html
new file mode 100644
index 0000000..f3ea3c9
--- /dev/null
+++ b/templates/staff/news.html
@@ -0,0 +1,51 @@
+{% import "../macros/staff-nav.html" as staff_nav %}
+
+{% extends "base.html" %}
+
+{% block title %}Novinky{% endblock %}
+
+{% block content %}
+Novinky
+{% call staff_nav::staff_nav() %}
+
+Novinky
+
+
+Vytvořit novinky
+
+{% endblock %}
diff --git a/templates/staff/permissions.html b/templates/staff/permissions.html
index cf6ddfa..8c54cd5 100755
--- a/templates/staff/permissions.html
+++ b/templates/staff/permissions.html
@@ -43,6 +43,15 @@
+
+ Vlastní capcode |
+
+
+
+
+ |
+
+
Záznamy |
@@ -88,6 +97,15 @@
|
+
+ Novinky |
+
+
+
+
+ |
+
+
Obejít ban |
@@ -124,9 +142,18 @@
|
+
+ Obejít antispam |
+
+
+
+
+ |
+
+
{% if tcx.perms.owner() %}
- |
+ |
{% endif %}