Merge pull request 'adding search description for mobile view and small admin page restructuring' (#29) from dev into master

Reviewed-on: #29
This commit is contained in:
Kibi Kelburton 2022-05-08 01:16:48 +02:00
commit d57908f82e
5 changed files with 29 additions and 18 deletions

View File

@ -1790,6 +1790,11 @@ table img {
.results {
padding: 5px;
}
.mview_desc {
visibility: hidden;
}
/* fix for mobile table view in search! */
@media screen and (max-width: 650px) {
table {
@ -1822,4 +1827,7 @@ table img {
position: relative;
width: 100%;
}
.mview_desc {
visibility: visible;
}
}

View File

@ -2,4 +2,9 @@
import postgres from "postgres";
import cfg from "./config.mjs";
export default postgres(cfg.sql);
const db = postgres(cfg.sql);
if(cfg.sql.schema)
await db.unsafe(`set schema '${cfg.sql.schema}';`);
export default db;

View File

@ -1,3 +1,10 @@
@include(snippets/header_admin)
<div class="container">
<h1>Henlo, {{ session.user }}</h1>
<p>Hier entsteht eine Internetpräsenz!</p>
<img src="/s/img/favicon.gif" alt="f0ck bash">
<p>@if(typeof totals !== "undefined")
total: {{ totals.total }} | tagged: {{ totals.tagged }} | untagged: {{ totals.untagged }} | sfw: {{ totals.sfw }} | nsfw: {{ totals.nsfw }}
@endif</p>
</div>
@include(snippets/footer)

View File

@ -21,11 +21,11 @@
@each(result as line)
<tr>
<td style="width: 128px;"><a href="/tag/{!! line.tag !!}/{{ line.id }}" target="_blank"><img src="/t/{{ line.id }}.webp" /></a></td>
<td><a href="/tag/{!! line.tag !!}/{{ line.id }}" target="_blank">{{ line.id }}</a></td>
<td><a href="/tag/{!! line.tag !!}">{!! line.tag !!}</a></td>
<td>{{ line.mime }}</td>
<td><a href="/user/{!! line.username !!}/f0cks/{{ line.id }}">{!! line.username !!}</a></td>
<td>{{ line.score?.toFixed(2) }}</td>
<td><span class="mview_desc">ID:</span><a href="/tag/{!! line.tag !!}/{{ line.id }}" target="_blank">{{ line.id }}</a></td>
<td><span class="mview_desc">Tag:</span><a href="/tag/{!! line.tag !!}">{!! line.tag !!}</a></td>
<td><span class="mview_desc">Mime:</span>{{ line.mime }}</td>
<td><span class="mview_desc">User:</span><a href="/user/{!! line.username !!}/f0cks/{{ line.id }}">{!! line.username !!}</a></td>
<td><span class="mview_desc">Score:</span>{{ line.score?.toFixed(2) }}</td>
</tr>
@endeach
</tbody>

View File

@ -20,18 +20,9 @@
<span class="nav-link-identifier">Log</span>
</a>
</li>
@if(typeof totals !== "undefined")
<li class="nav-item" style="width: 100%; text-align: center">
total:&nbsp;{{ totals.total }}&nbsp;|&nbsp;tagged:&nbsp;{{ totals.tagged }}&nbsp;|&nbsp;untagged:&nbsp;{{ totals.untagged }}&nbsp;|&nbsp;sfw:&nbsp;{{ totals.sfw }}&nbsp;|&nbsp;nsfw:&nbsp;{{ totals.nsfw }}
<li class="nav-item">
<a class="nav-link" href="/logout">Logout</a>
</li>
@endif
</ul>
</div>
<div class="collapse navbar-collapse show" id="navbarSupportedContent">
<div class="pagination-container-fluid">
<div class="pagination-wrapper">
Henlo, {{ session.user }}&nbsp;&nbsp;<a href="/logout">Logout</a>
</div>
</div>
</div>
</nav>