This commit is contained in:
x 2025-04-21 14:48:40 +02:00
parent a3b66567c9
commit e18270a1ce
6 changed files with 31 additions and 26 deletions

View File

@ -120,10 +120,9 @@ html[theme="orange"] .image-brand {
.tag { .tag {
box-shadow: 1px 1px 1px black; box-shadow: 1px 1px 1px black;
display: grid; display: grid;
grid-template-rows: auto; margin: 5px;
grid-template-columns: 1fr auto; grid-template-columns: auto;
margin: 10px; grid-template-rows: 1fr;
margin-right: 10px;
} }
.navigation-rechts { .navigation-rechts {
@ -148,4 +147,15 @@ html[theme="orange"] .image-brand {
.dropdown-menu.shii { .dropdown-menu.shii {
width: auto; width: auto;
}
@media (min-width: 900px) {
.tags {
grid-template-columns: repeat(auto-fill, 20em);
justify-content: center;
}
}
.tag img {
width: 100%;
} }

View File

@ -4,20 +4,22 @@ import lib from "../../inc/lib.mjs";
import f0cklib from "../routeinc/f0cklib.mjs"; import f0cklib from "../routeinc/f0cklib.mjs";
export default (router, tpl) => { export default (router, tpl) => {
router.get(/^\/tags$/,lib.loggedin, async (req, res) => { router.get(/^\/tags$/, async (req, res) => {
const phrase = cfg.websrv.phrases[~~(Math.random() * cfg.websrv.phrases.length)]; const phrase = cfg.websrv.phrases[~~(Math.random() * cfg.websrv.phrases.length)];
const nsfp = cfg.nsfp.map(n => `${n}`);
const toptags = await db` const toptags = await db`
SELECT t.id, t.tag, COUNT(DISTINCT ta.item_id) AS total_items SELECT t.id, t.tag, COUNT(DISTINCT ta.item_id) AS total_items
FROM tags t FROM tags t
LEFT JOIN tags_assign ta ON t.id = ta.tag_id LEFT JOIN tags_assign ta ON t.id = ta.tag_id
WHERE t.id not in (${db.unsafe(nsfp)})
GROUP BY t.id, t.tag GROUP BY t.id, t.tag
ORDER BY total_items DESC ORDER BY total_items DESC
LIMIT 500 LIMIT 500
; ;
`; `;
res.reply({ res.reply({
body: tpl.render('tags', { body: tpl.render('tags', {
toptags, toptags,

View File

@ -110,7 +110,7 @@ process.on('unhandledRejection', err => {
db({ db({
user_id: +user[0].id, user_id: +user[0].id,
mode: user[0].mode ?? 0, mode: user[0].mode ?? 0,
theme: req.session.theme ?? 'f0ck', theme: req.session.theme ?? 'atmos',
fullscreen: req.session.fullscreen || 0 fullscreen: req.session.fullscreen || 0
}, 'user_id', 'mode', 'theme', 'fullscreen') }, 'user_id', 'mode', 'theme', 'fullscreen')
} }

View File

@ -114,24 +114,6 @@
</span> </span>
</div> </div>
</div> </div>
@if(session)
<comentario-count path="/{{ item.id }}"
placeholder="..."
error-text="ERR"
zero-text="foobar"
prefix="("
suffix=")"></comentario-count>
<div class="comments">
<script defer src="https://c.w0bm.com/comentario.js"></script>
<comentario-comments auto-init="false"
no-fonts="true">
</comentario-comments>
</div>
@else
@endif
</div>
</div> </div>
</div> </div>
@include(snippets/footer) @include(snippets/footer)

View File

@ -166,6 +166,7 @@
</div> </div>
</nav> </nav>
@else @else
<!-- not logged in -->
<nav class="navbar navbar-expand-lg"> <nav class="navbar navbar-expand-lg">
<a class="navbar-brand" href="/"><img class="image-brand" src="/s/img/w0bm_mosh_banner_by_marderchen.gif" alt="w...?"><span class="f0ck" width="" height=""></span></a> <a class="navbar-brand" href="/"><img class="image-brand" src="/s/img/w0bm_mosh_banner_by_marderchen.gif" alt="w...?"><span class="f0ck" width="" height=""></span></a>
@ -182,6 +183,16 @@
@endeach @endeach
</ul> </ul>
</li> </li>
<li class="nav-item">
<a id="explore-tags" class="nav-link" href="/tags">
<span class="nav-link-identifier">Tags</span>
</a>
</li>
<li class="nav-item">
<a id="random" class="nav-link" href="/random">
<span class="nav-link-identifier">Random</span>
</a>
</li>
</ul> </ul>
</div> </div>
<!-- rechte seite --> <!-- rechte seite -->

View File

@ -5,7 +5,7 @@
<div class="tags"> <div class="tags">
@each(toptags as toptag) @each(toptags as toptag)
<div class="tag badge badge-light mr-2"> <div class="tag badge badge-light mr-2">
<!-- <img src="/s/img/tags/{!! toptag.tag !!}.webp" alt=""> -->
<div class="tagbox-body"> <div class="tagbox-body">
<span class="toptag_id">{!! toptag.tag !!}</span> <span class="toptag_id">{!! toptag.tag !!}</span>
<span class="toptag_tag"><a href="/tag/{!! toptag.tag !!}">{{ toptag.total_items }}</a></span> <span class="toptag_tag"><a href="/tag/{!! toptag.tag !!}">{{ toptag.total_items }}</a></span>