routes and stuff

This commit is contained in:
Flummi
2021-12-06 10:21:11 +01:00
parent 43665884f6
commit f7313d864c
9 changed files with 216 additions and 151 deletions

View File

@ -2,7 +2,7 @@
<div class="index-container">
<div id="posts">
@each(items as item)
<a href="/@if(typeof filter !== "undefined"){{ filter }}/@endif{{ item.id }}" data-mime="{{ item.mime }}" data-mode="{{ item.tag_id ? ['','sfw','nsfw'][item.tag_id] : 'null' }}" style="background-image: url('/t/{{ item.id }}.png')"><p></p></a>
<a href="/{{ link }}@if(link.length != 0)/@endif{{ item.id }}" data-mime="{{ item.mime }}" data-mode="{{ item.tag_id ? ['','sfw','nsfw'][item.tag_id] : 'null' }}" style="background-image: url('/t/{{ item.id }}.png')"><p></p></a>
@endeach
</div>
</div>

View File

@ -4,7 +4,7 @@
<div class="next-post">
@if(pagination.prev)
<div class="arrow-next">
<a id="next" href="{{ pagination.link }}{{ pagination.prev }}"></a>
<a id="next" href="/{{ link }}@if(link.length != 0)/@endif{{ pagination.prev }}"></a>
</div>
@else
<div class="arrow-next">
@ -20,7 +20,7 @@
preload="auto" autoplay controls loop playsinline></video>
</div>
@elseif(item.mime.startsWith("audio"))
<div class="embed-responsive embed-responsive-16by9" style="background: url('@if(item.coverart)//f0ck.me{{ item.coverart }}@else/s/img/200.gif@endif') no-repeat center / contain black;"></div>
<div class="embed-responsive embed-responsive-16by9" style="background: url('@if(item.coverart)//f0ck.me{{ item.coverart }}@else/s/img/200.gif@endif') no-repeat center / contain black;">
<audio id="my-video" class="embed-responsive-item" autoplay controls loop src="{{ item.dest }}" data-setup="{}" poster="@if(item.coverart){{ item.coverart }}@else/s/img/200.gif@endif" type="{{ item.mime }}"></audio>
</div>
@elseif(item.mime.startsWith("image"))
@ -36,7 +36,7 @@
<div class="previous-post">
@if(pagination.next)
<div class="arrow-prev">
<a id="prev" href="{{ pagination.link }}{{ pagination.next }}"></a>
<a id="prev" href="/{{ link }}@if(link.length != 0)/@endif{{ pagination.next }}"></a>
</div>
@else
<div class="arrow-prev">
@ -47,7 +47,7 @@
</div>
<div class="metadata">
<span class="badge badge-dark">
<a href="/{{ item.id }}" style="--hover-image: url('/t/{{ item.id }}.png');" class="id-link">{{ item.id }}</a>@if(session) (<span id="a_username">{{ user.name }}</span>)@endif
<a href="/{{ item.id }}" style="--hover-image: url('/t/{{ item.id }}.png');" class="id-link">{{ item.id }}</a>@if(session) (<a id="a_username" href="/user/{{ user.name.toLowerCase() }}@if(tmp.mime)/{{ tmp.mime }}@endif">{{ user.name }}</a>)@endif
</span>
<span class="badge badge-dark">{{ user.network }} / {{ user.channel }}</span>
<span class="badge badge-dark image-source"><a class="post_source" title="{{ item.src.long }}" href="{{ item.src.long }}" target="_blank">{{ item.src.short }}</a></span>

View File

@ -1,15 +1,15 @@
@if(typeof pagination !== "undefined")
@if(pagination)
<nav class="pagination">
<a href="{{ pagination.link }}{{ pagination.start }}" class="page-item-1 btn start@if(!pagination.prev) disabled@endif">&laquo;</a>
<a href="{{ pagination.link }}{{ pagination.prev }}" class="page-item-2 btn prev@if(!pagination.prev) disabled@endif">&lsaquo;</a>
<a href="/{{ pagination.link }}@if(pagination.link.length != 0)/@endif@if(!pagination.uff)p/@endif{{ pagination.start }}" class="page-item-1 btn start@if(!pagination.prev) disabled@endif">&laquo;</a>
<a href="/{{ pagination.link }}@if(pagination.link.length != 0)/@endif@if(!pagination.uff)p/@endif{{ pagination.prev }}" class="page-item-2 btn prev@if(!pagination.prev) disabled@endif">&lsaquo;</a>
@each(pagination.cheat as i)
@if(i == pagination.page)
<span class="btn disabled">{{ i }}</span>
@else
<a href="{{ pagination.link }}{{ i }}" class="pagination-int-item btn">{{ i }}</a>
<a href="/{{ pagination.link }}@if(pagination.link.length != 0)/@endif@if(!pagination.uff)p/@endif{{ i }}" class="pagination-int-item btn">{{ i }}</a>
@endif
@endeach
<a href="{{ pagination.link }}{{ pagination.next }}" class="page-item-3 btn next@if(!pagination.next) disabled@endif">&rsaquo;</a>
<a href="{{ pagination.link }}{{ pagination.end }}" class="page-item-4 btn start@if(!pagination.next) disabled@endif">&raquo;</a>
<a href="/{{ pagination.link }}@if(pagination.link.length != 0)/@endif@if(!pagination.uff)p/@endif{{ pagination.next }}" class="page-item-3 btn next@if(!pagination.next) disabled@endif">&rsaquo;</a>
<a href="/{{ pagination.link }}@if(pagination.link.length != 0)/@endif@if(!pagination.uff)p/@endif{{ pagination.end }}" class="page-item-4 btn start@if(!pagination.next) disabled@endif">&raquo;</a>
</nav>
@endif

View File

@ -29,12 +29,12 @@
</li>
<span class="placeholder">&nbsp;</span>
<li class="nav-item dropdown">
<a class="nav-link ddcontent" href="#"@if(typeof filter !== "undefined") content="{{ filter }}" data-toggle="dropdown"@endif>Filter@if(typeof filter === "undefined")&nbsp;&#9660;@endif</a>
<a class="nav-link ddcontent" href="#"@if(tmp.mime) content="{{ tmp.mime }}" data-toggle="dropdown"@endif>Filter@if(!tmp.mime)&nbsp;&#9660;@endif</a>
<ul class="dropdown-menu">
<li><a class="dropdown-item" href="/">All</a></li>
<li><a class="dropdown-item" href="/audio">Audio</a></li>
<li><a class="dropdown-item" href="/video">Video</a></li>
<li><a class="dropdown-item" href="/image">Image</a></li>
<li><a class="dropdown-item" href="/@if(tmp.user)user/{{ tmp.user }}/@endif">All</a></li>
<li><a class="dropdown-item" href="/@if(tmp.user)user/{{ tmp.user }}/@endifaudio">Audio</a></li>
<li><a class="dropdown-item" href="/@if(tmp.user)user/{{ tmp.user }}/@endifvideo">Video</a></li>
<li><a class="dropdown-item" href="/@if(tmp.user)user/{{ tmp.user }}/@endifimage">Image</a></li>
</ul>
</li>
@if(session)
@ -48,7 +48,7 @@
</li>
@endif
<li class="nav-item">
<a id="random" class="nav-link" href="/random@if(typeof filter !== "undefined")/{{ filter }}@endif">
<a id="random" class="nav-link" href="/random@if(tmp.user)/user/{{ tmp.user }}@endif@if(tmp.mime)/{{ tmp.mime }}@endif">
<span class="nav-link-identifier">Random</span>
</a>
</li>

View File

@ -36,7 +36,6 @@
<div class="pagination-container-fluid">
<div class="pagination-wrapper">
Henlo, {{ session.user }}&nbsp;&nbsp;<a href="/logout">Logout</a>
@include(partials/pagination)
</div>
</div>
</div>