admin the second lol
All checks were successful
fetch npm modules / f0ck the f0cker (push) Successful in 18s
All checks were successful
fetch npm modules / f0ck the f0cker (push) Successful in 18s
This commit is contained in:
parent
c79cca18cf
commit
058fe94fd1
2
f0ck.sql
2
f0ck.sql
@ -131,7 +131,7 @@ CREATE TABLE public."user" (
|
||||
login character varying(255) NOT NULL,
|
||||
"user" character varying(255) NOT NULL,
|
||||
password character varying(167) NOT NULL,
|
||||
level integer NOT NULL
|
||||
admin boolean NOT NULL
|
||||
);
|
||||
|
||||
ALTER TABLE public."user" OWNER TO f0ck;
|
||||
|
@ -14,7 +14,7 @@ export default (router, tpl) => {
|
||||
const user = decodeURIComponent(req.params.user);
|
||||
|
||||
const query = await db`
|
||||
select "user".user, "user".created_at, user_options.*
|
||||
select "user".user, "user".admin, "user".created_at, user_options.*
|
||||
from user_options
|
||||
left join "user" on "user".id = user_options.user_id
|
||||
where "user".user ilike ${user}
|
||||
@ -35,13 +35,15 @@ export default (router, tpl) => {
|
||||
user: user,
|
||||
mode: req.session.mode,
|
||||
fav: false,
|
||||
session: !!req.session
|
||||
session: !!req.session,
|
||||
limit: 99999999
|
||||
});
|
||||
const favs = await f0cklib.getf0cks({
|
||||
user: user,
|
||||
mode: req.session.mode,
|
||||
fav: true,
|
||||
session: !!req.session
|
||||
session: !!req.session,
|
||||
limit: 99999999
|
||||
});
|
||||
|
||||
const count = {
|
||||
|
@ -8,13 +8,13 @@ export default (router, tpl) => {
|
||||
try {
|
||||
const list = await db`
|
||||
select
|
||||
"user".user,
|
||||
"user".user, "user".admin,
|
||||
coalesce("user_options".avatar, ${await lib.getDefaultAvatar()}) as avatar,
|
||||
count(distinct(tag_id, item_id)) as count
|
||||
from "tags_assign"
|
||||
left join "user" on "user".id = "tags_assign".user_id
|
||||
left join "user_options" on "user_options".user_id = "user".id
|
||||
group by "user".user, "user_options".avatar
|
||||
group by "user".user, "user_options".avatar, "user".admin
|
||||
order by count desc
|
||||
`;
|
||||
const stats = await lib.countf0cks();
|
||||
|
@ -11,8 +11,8 @@
|
||||
@for(let i = 0; i < list.length; i++)
|
||||
<tr>
|
||||
<td>{{ i + 1 }}</td>
|
||||
<td><a href="/{{ list[i].avatar }}"><img class="avatar" src="/t/{{ list[i].avatar }}.webp" /></a></td>
|
||||
<td><a href="/user/{!! list[i].user !!}">{!! list[i].user !!}</a></td>
|
||||
<td><a href="/{{ list[i].avatar }}"><img class="avatar" src="/t/{{ list[i].avatar }}.webp"></a></td>
|
||||
<td>@if(list[i].admin)⭐ @endif<a href="/user/{!! list[i].user !!}">{!! list[i].user !!}</a></td>
|
||||
<td>{{ list[i].count }}</td>
|
||||
</tr>
|
||||
@endfor
|
||||
|
@ -5,7 +5,7 @@
|
||||
<ul class="navbar-nav">
|
||||
<li class="nav-item dropdown">
|
||||
<a class="nav-link user" href="#" content="{{ session.user }}" data-toggle="dropdown">
|
||||
<img src="@if(session.avatar)/t/{{ session.avatar }}.webp@else/s/img/ava/default.png@endif" class="avatar" /><span>{{ session.user }}</span>
|
||||
<img src="@if(session.avatar)/t/{{ session.avatar }}.webp@else/s/img/ava/default.png@endif" class="avatar"><span>@if(session.admin)⭐ @endif{{ session.user }}</span>
|
||||
</a>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a href="/user/{{ session.user.toLowerCase() }}">my profile</a></li>
|
||||
|
@ -8,7 +8,7 @@
|
||||
@endif
|
||||
<div class="layersoffear">
|
||||
<div class="profile_head_username">
|
||||
<span>{{ user.user }}</span>
|
||||
<span>@if(user.admin)⭐ @endif{{ user.user }}</span>
|
||||
</div>
|
||||
<div class="profile_head_user_stats">
|
||||
ID: {{ user.user_id }} – Joined: {{ user.created_at }}
|
||||
|
Loading…
Reference in New Issue
Block a user