<% if (['image', 'animation'].includes(ctx.post.type)) { %> - + <% } else if (ctx.post.type === 'flash') { %> From 486fc345fe16adfc3368988bd492acef6e9ed865 Mon Sep 17 00:00:00 2001 From: Eva Date: Wed, 17 May 2023 21:55:30 +0200 Subject: [PATCH 07/30] client/pools, client/tags: move description before details --- client/html/pool_summary.tpl | 12 ++++++------ client/html/tag_summary.tpl | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/client/html/pool_summary.tpl b/client/html/pool_summary.tpl index 8f4e27d0..a81808dd 100644 --- a/client/html/pool_summary.tpl +++ b/client/html/pool_summary.tpl @@ -1,4 +1,10 @@
+
+ <%= ctx.makeMarkdown(ctx.pool.description || 'This pool has no description yet.') %> +

This pool has '><%- ctx.pool.postCount %> post(s).

+
+
+
Category: @@ -14,10 +20,4 @@ -->
- -
-
- <%= ctx.makeMarkdown(ctx.pool.description || 'This pool has no description yet.') %> -

This pool has '><%- ctx.pool.postCount %> post(s).

-
diff --git a/client/html/tag_summary.tpl b/client/html/tag_summary.tpl index 06e25479..5bd595e1 100644 --- a/client/html/tag_summary.tpl +++ b/client/html/tag_summary.tpl @@ -1,4 +1,10 @@
+
+ <%= ctx.makeMarkdown(ctx.tag.description || 'This tag has no description yet.') %> +

This tag has '><%- ctx.tag.postCount %> usage(s).

+
+
+
Category: @@ -32,10 +38,4 @@ -->
- -
-
- <%= ctx.makeMarkdown(ctx.tag.description || 'This tag has no description yet.') %> -

This tag has '><%- ctx.tag.postCount %> usage(s).

-
From f590dc6a41353f538cb2ed259c3130c2a7fe2004 Mon Sep 17 00:00:00 2001 From: Eva Date: Wed, 17 May 2023 21:45:48 +0200 Subject: [PATCH 08/30] client/pools, client/tags: obvious button to access posts list --- client/css/core-general.styl | 5 +++++ client/html/pool.tpl | 1 + client/html/tag.tpl | 1 + 3 files changed, 7 insertions(+) diff --git a/client/css/core-general.styl b/client/css/core-general.styl index 7e5883aa..430848b7 100644 --- a/client/css/core-general.styl +++ b/client/css/core-general.styl @@ -106,6 +106,11 @@ form .fa-question-circle-o background-color: $scrollbar-bg-color &::-webkit-scrollbar-thumb background-color: $scrollbar-thumb-color + li[data-name=view] + background: $button-enabled-background-color + margin-right: 1em + a + color: $button-enabled-text-color >.content-wrapper:not(.transparent) background: $top-navigation-color padding: 1.8em diff --git a/client/html/pool.tpl b/client/html/pool.tpl index 831d07c6..e368c066 100644 --- a/client/html/pool.tpl +++ b/client/html/pool.tpl @@ -2,6 +2,7 @@

<%- ctx.getPrettyName(ctx.pool.names[0]) %>

From ce613c5adecd7a46e503d887794abfd4b8141517 Mon Sep 17 00:00:00 2001 From: Eva Date: Mon, 22 May 2023 13:00:32 +0200 Subject: [PATCH 14/30] client/posts: page exit confirmation for bulk edit actions --- client/js/views/posts_header_view.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/client/js/views/posts_header_view.js b/client/js/views/posts_header_view.js index 38a4aa98..58d0ec21 100644 --- a/client/js/views/posts_header_view.js +++ b/client/js/views/posts_header_view.js @@ -60,12 +60,14 @@ class BulkSafetyEditor extends BulkEditor { e.preventDefault(); this.toggleOpen(true); this.dispatchEvent(new CustomEvent("open", { detail: {} })); + misc.enableExitConfirmation(); } _evtCloseLinkClick(e) { e.preventDefault(); this.toggleOpen(false); this.dispatchEvent(new CustomEvent("close", { detail: {} })); + misc.disableExitConfirmation(); } } @@ -130,6 +132,7 @@ class BulkTagEditor extends BulkEditor { this.toggleOpen(true); this.focus(); this.dispatchEvent(new CustomEvent("open", { detail: {} })); + misc.enableExitConfirmation(); } _evtCloseLinkClick(e) { @@ -138,6 +141,7 @@ class BulkTagEditor extends BulkEditor { this.toggleOpen(false); this.blur(); this.dispatchEvent(new CustomEvent("close", { detail: {} })); + misc.disableExitConfirmation(); } } @@ -160,12 +164,14 @@ class BulkDeleteEditor extends BulkEditor { e.preventDefault(); this.toggleOpen(true); this.dispatchEvent(new CustomEvent("open", { detail: {} })); + misc.enableExitConfirmation(); } _evtCloseLinkClick(e) { e.preventDefault(); this.toggleOpen(false); this.dispatchEvent(new CustomEvent("close", { detail: {} })); + misc.disableExitConfirmation(); } } From ae72d7563155ee00cc83f28b76d8177972bd3c43 Mon Sep 17 00:00:00 2001 From: Eva Date: Sat, 23 Mar 2024 17:40:25 +0100 Subject: [PATCH 15/30] client/posts: redirect away from /edit when no post edit permissions --- client/js/controllers/post_main_controller.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/client/js/controllers/post_main_controller.js b/client/js/controllers/post_main_controller.js index 95cfdb52..06f613c3 100644 --- a/client/js/controllers/post_main_controller.js +++ b/client/js/controllers/post_main_controller.js @@ -281,7 +281,16 @@ module.exports = (router) => { if (ctx.state.parameters) { Object.assign(ctx.parameters, ctx.state.parameters); } - ctx.controller = new PostMainController(ctx, true); + const canEditPosts = api.hasPrivilege("posts:edit"); + if (canEditPosts) { + ctx.controller = new PostMainController(ctx, true); + } else { + router.show(uri.formatClientLink( + "post", + ctx.parameters.id, + ctx.parameters ? { query: ctx.parameters.query } : {} + )); + } }); router.enter(["post", ":id"], (ctx, next) => { // restore parameters from history state From ae856055317a1e7b86877e12598dc06e79d5b4a8 Mon Sep 17 00:00:00 2001 From: Eva Date: Thu, 27 Mar 2025 18:17:00 +0100 Subject: [PATCH 16/30] client/posts: filter out empty post source lines --- client/js/models/post.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/js/models/post.js b/client/js/models/post.js index 2fb3d34c..2025242d 100644 --- a/client/js/models/post.js +++ b/client/js/models/post.js @@ -75,7 +75,7 @@ class Post extends events.EventTarget { } get sourceSplit() { - return this._source.split("\n"); + return this._source.split("\n").filter((s) => s); } get canvasWidth() { From de9b8fdce37577dea76b49350a619063606c4f23 Mon Sep 17 00:00:00 2001 From: Eva Date: Fri, 26 May 2023 08:54:55 +0200 Subject: [PATCH 17/30] client/snapshots: display pool name --- client/html/snapshots_page.tpl | 2 +- client/js/views/snapshots_page_view.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/client/html/snapshots_page.tpl b/client/html/snapshots_page.tpl index 6650d651..f26ff030 100644 --- a/client/html/snapshots_page.tpl +++ b/client/html/snapshots_page.tpl @@ -12,7 +12,7 @@ <%= item.operation %> - <%= ctx.makeResourceLink(item.type, item.id) %> + <%= ctx.makeResourceLink(item.type, item.id, item.data) %>