admin stuff
This commit is contained in:
3
views/admin.html
Normal file
3
views/admin.html
Normal file
@ -0,0 +1,3 @@
|
||||
{{include main/header_admin}}
|
||||
|
||||
{{include main/footer}}
|
@ -51,7 +51,13 @@
|
||||
<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>
|
||||
<span class="badge badge-dark"><a class="dest-link" href="{{=item.dest}}" target="_blank">{{=item.mime}}</a> / {{=item.size}}</span>
|
||||
<span class="badge badge-dark"><time class="timeago" title="{{=item.timestamp}}" datetime="{{=item.timestamp}}">{{=item.timestamp}}</time></span>
|
||||
<span class="badge badge-dark">{{=lul}}</span>
|
||||
<span class="badge badge-dark">
|
||||
{{if session}}
|
||||
<a href="#">delete</a>
|
||||
{{else}}
|
||||
{{=lul}}
|
||||
{{/if}}
|
||||
</span>
|
||||
<span class="badge badge-dark" id="tags">
|
||||
{{if typeof item.tags !== "undefined"}}
|
||||
{{each item.tags as tag}}
|
||||
|
17
views/login.html
Normal file
17
views/login.html
Normal file
@ -0,0 +1,17 @@
|
||||
<!doctype f0ck>
|
||||
<html theme="{{if typeof theme !== "undefined" }}{{=theme}}{{/if}}">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
<title>f0ck login</title>
|
||||
<link href="/s/css/f0ck.css" rel="stylesheet" />
|
||||
</head>
|
||||
<body type="login">
|
||||
<form class="login-form" method="post" action="/login">
|
||||
<p><a href="/"><img src="/s/img/f0ck_small.png" /></a></p>
|
||||
<input type="text" name="username" placeholder="username" autocomplete="off" required />
|
||||
<input type="password" name="password" placeholder="password" autocomplete="off" required />
|
||||
<button type="submit">Login</button>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
40
views/main/footer_admin.html
Normal file
40
views/main/footer_admin.html
Normal file
@ -0,0 +1,40 @@
|
||||
<script>
|
||||
var userMenuDiv = document.getElementById("userMenu");
|
||||
var userMenu = document.getElementById("userButton");
|
||||
var navMenuDiv = document.getElementById("nav-content");
|
||||
var navMenu = document.getElementById("nav-toggle");
|
||||
document.onclick = check;
|
||||
function check(e) {
|
||||
var target = (e && e.target) || (event && event.srcElement);
|
||||
if(!checkParent(target, userMenuDiv)) {
|
||||
if(checkParent(target, userMenu)) {
|
||||
if(userMenuDiv.classList.contains("invisible"))
|
||||
userMenuDiv.classList.remove("invisible");
|
||||
else
|
||||
userMenuDiv.classList.add("invisible");
|
||||
}
|
||||
else
|
||||
userMenuDiv.classList.add("invisible");
|
||||
}
|
||||
if(!checkParent(target, navMenuDiv)) {
|
||||
if(checkParent(target, navMenu)) {
|
||||
if(navMenuDiv.classList.contains("hidden"))
|
||||
navMenuDiv.classList.remove("hidden");
|
||||
else
|
||||
navMenuDiv.classList.add("hidden");
|
||||
}
|
||||
else
|
||||
navMenuDiv.classList.add("hidden");
|
||||
}
|
||||
}
|
||||
function checkParent(t, elm) {
|
||||
while(t.parentNode) {
|
||||
if(t == elm)
|
||||
return true;
|
||||
t = t.parentNode;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
18
views/main/header_admin.html
Normal file
18
views/main/header_admin.html
Normal file
@ -0,0 +1,18 @@
|
||||
<!cocktype big f0ck>
|
||||
<html lang="en" theme="{{if typeof theme !== "undefined" }}{{=theme}}{{/if}}">
|
||||
<head>
|
||||
<title>{{if data.title}}{{=data.title}}{{else}}f0ck!{{/if}}</title>
|
||||
<link rel="icon" type="image/gif" href="/s/img/favicon.gif" />
|
||||
<link rel="stylesheet" href="/s/css/f0ck.css">
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<meta name="description" content="f0ck.me is the place where internet purists gather to celebrate content of all kinds">
|
||||
{{if data.item}}
|
||||
<meta property="og:site_name" content="f0ck.me" />
|
||||
<meta property="og:description"/>
|
||||
<meta name="Description"/>
|
||||
<meta property="og:image" content="{{=item.thumbnail}}" />
|
||||
{{/if}}
|
||||
</head>
|
||||
<body>
|
||||
{{include snippets/navbar_admin}}
|
@ -3,7 +3,17 @@
|
||||
<div class="navigation-links">
|
||||
<ul class="navbar-nav">
|
||||
<li class="nav-item">
|
||||
{{if session}}
|
||||
<li class="nav-item dropdown">
|
||||
<a class="nav-link" href="/admin" content="{{=session.user}}" data-toggle="dropdown">Admin</a>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a href="/admin">Adminpanel</a></li>
|
||||
<li><a href="/logout">Logout</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
{{else}}
|
||||
<a class="nav-link" href="/about"><span class="nav-link-identifier">About</span></a>
|
||||
{{/if}}
|
||||
</li>
|
||||
<li class="nav-item dropdown" id="themes">
|
||||
<a class="nav-link" href="#" content="{{=theme}}" data-toggle="dropdown">Theme</a>
|
||||
|
38
views/snippets/navbar_admin.html
Normal file
38
views/snippets/navbar_admin.html
Normal file
@ -0,0 +1,38 @@
|
||||
<nav class="navbar navbar-expand-lg">
|
||||
<a class="navbar-brand" href="/admin"><span class="f0ck">F0CK</span></a>
|
||||
<div class="navigation-links">
|
||||
<ul class="navbar-nav">
|
||||
<li class="nav-item dropdown" id="themes">
|
||||
<a class="nav-link" href="#" content="{{=theme}}" data-toggle="dropdown">Theme</a>
|
||||
<ul class="dropdown-menu">
|
||||
{{each themes as t}}
|
||||
<li><a href="/theme/{{=t}}">{{=t}}</a></li>
|
||||
{{/each}}
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#">
|
||||
<span class="nav-link-identifier">blah</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#">
|
||||
<span class="nav-link-identifier">blah</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#">
|
||||
<span class="nav-link-identifier">blah</span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="collapse navbar-collapse show" id="navbarSupportedContent">
|
||||
<div class="pagination-container-fluid">
|
||||
<div class="pagination-wrapper">
|
||||
Henlo, {{=session.user}} <a href="/logout">Logout</a>
|
||||
{{include partials/pagination}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
Reference in New Issue
Block a user