diff --git a/src/inc/routeinc/f0cklib.mjs b/src/inc/routeinc/f0cklib.mjs index 3fc7d37..87d3a13 100644 --- a/src/inc/routeinc/f0cklib.mjs +++ b/src/inc/routeinc/f0cklib.mjs @@ -978,6 +978,7 @@ export default { is_oc: actitem.is_oc || false, is_repost: actitem.checksum ? actitem.checksum.includes('_bypass_') : false, reposts: repostItems, + show_repost_row: !!((session || cfg.websrv.expose_repost_links_to_guests || cfg.websrv.expose_repost_links) && (actitem.checksum?.includes('_bypass_') || (repostItems && repostItems.length > 0))), width: actitem.width || null, height: actitem.height || null, original_filename: actitem.original_filename || null, diff --git a/src/inc/routes/index.mjs b/src/inc/routes/index.mjs index 0392294..efbaca9 100644 --- a/src/inc/routes/index.mjs +++ b/src/inc/routes/index.mjs @@ -390,6 +390,8 @@ export default (router, tpl) => { data.current_user_hall_slug = (data.tmp && data.tmp.userHall && typeof data.tmp.userHall === 'object') ? data.tmp.userHall.slug : (data.tmp && data.tmp.userHall ? data.tmp.userHall : ''); data.current_user_hall_owner = (data.tmp && data.tmp.userHallOwner) ? data.tmp.userHallOwner : ''; data.item_has_dimensions = !!(item.width && item.height); + data.show_repost_row = !!((data.session || cfg.websrv.expose_repost_links_to_guests || cfg.websrv.expose_repost_links) && (item.is_repost || (item.reposts && item.reposts.length > 0))); + data.item.show_repost_row = data.show_repost_row; } res.setHeader('Cache-Control', 'no-store, no-cache, must-revalidate, proxy-revalidate'); diff --git a/views/item-partial-legacy.html b/views/item-partial-legacy.html index 7d67099..a292511 100644 --- a/views/item-partial-legacy.html +++ b/views/item-partial-legacy.html @@ -329,7 +329,7 @@
{{ item.checksum.split('_bypass_')[0] }}
@endif - @if((session || expose_repost_links_to_guests) && (item.is_repost || (item.reposts && item.reposts.length > 0))) + @if(show_repost_row) Repost diff --git a/views/item-partial-modern.html b/views/item-partial-modern.html index 5498fce..f2f20eb 100644 --- a/views/item-partial-modern.html +++ b/views/item-partial-modern.html @@ -274,7 +274,7 @@
{{ item.checksum.split('_bypass_')[0] }}
@endif - @if((session || expose_repost_links_to_guests) && (item.is_repost || (item.reposts && item.reposts.length > 0))) + @if(show_repost_row) Repost