potential fix for the last fucked up commits xd

This commit is contained in:
x
2026-01-24 10:58:22 +01:00
parent 9c9309435d
commit 2229f32dd3
4 changed files with 18 additions and 14 deletions

View File

@@ -56,6 +56,7 @@ export default (router, tpl) => {
// Inject missing variables normally provided by req or middleware
data.url = { pathname: `/${req.params.itemid}` }; // Template expects url.pathname
data.fullscreen = req.cookies.fullscreen || 0; // Index.mjs uses req.cookies.fullscreen
data.hidePagination = true;
// Render both the item content and the pagination
const itemHtml = tpl.render('ajax-item', data);

View File

@@ -39,7 +39,7 @@ export default router => {
mime ilike ${mime} and
active = 'true'
${isFav ? db`and fu."user" = ${user}` : db`and items.username ilike ${user}`}
${tag ? db`and tags.normalized ilike ${'%' + tag + '%'}` : db``}
${tag ? db`and tags.normalized ilike '%' || slugify(${tag}) || '%'` : db``}
${!hasSession && globalfilter ? db`and items.id not in (select item_id from tags_assign where item_id = items.id and (${db.unsafe(globalfilter)}))` : db``}
order by random()
limit 1

View File

@@ -103,6 +103,10 @@ export default (router, tpl) => {
});
}
if (mode === 'item') {
data.hidePagination = true;
}
return res.reply({ body: tpl.render(mode, data, req) });
});
@@ -134,8 +138,7 @@ export default (router, tpl) => {
};
await db`
insert into "user_options" ${
db(blah, 'user_id', 'mode', 'theme')
insert into "user_options" ${db(blah, 'user_id', 'mode', 'theme')
}
on conflict ("user_id") do update set
mode = excluded.mode,

View File

@@ -39,7 +39,7 @@
</div>
</div>
<!-- show pagination only for tags and main page -->
@if(!/^\/\d+$/.test(url.pathname))
@if(typeof hidePagination === 'undefined' || !hidePagination)
<div class="collapse navbar-collapse show" id="navbarSupportedContent">
<div class="pagination-container-fluid">
<div class="pagination-wrapper">
@@ -74,7 +74,7 @@
</ol>
</div>
<!-- show pagination only for tags and main page -->
@if(!(/\/\d+$/.test(url.pathname) && !/\/p\/\d+$/.test(url.pathname)))
@if(typeof hidePagination === 'undefined' || !hidePagination)
<div class="collapse navbar-collapse show" id="navbarSupportedContent">
<div class="pagination-container-fluid">
<div class="pagination-wrapper">