2024-11-22 09:48:11 +00:00
|
|
|
{% import "macros.html" as macros %}
|
|
|
|
<!DOCTYPE html>
|
|
|
|
<html lang="en">
|
|
|
|
<head>
|
|
|
|
<meta charset="UTF-8" />
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
|
|
|
|
<meta http-equiv="x-ua-compatible" content="ie=edge" />
|
|
|
|
<title>Forgejo Spam Admin</title>
|
|
|
|
</head>
|
|
|
|
<style>
|
2024-11-22 15:26:17 +00:00
|
|
|
.main {
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
gap: 30px;
|
|
|
|
align-items: center;
|
|
|
|
}
|
|
|
|
|
|
|
|
.users {
|
2024-11-22 09:48:11 +00:00
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
gap: 15px;
|
|
|
|
}
|
2024-11-22 15:26:17 +00:00
|
|
|
|
2024-11-22 09:48:11 +00:00
|
|
|
.user {
|
|
|
|
display: flex;
|
|
|
|
flex-direction: row;
|
|
|
|
gap: 10px;
|
2024-11-22 15:26:17 +00:00
|
|
|
align-items: center;
|
2024-11-23 10:46:47 +00:00
|
|
|
border: 1px dotted #000;
|
|
|
|
padding: 3px 8px 3px 8px;
|
|
|
|
margin: 3px;
|
2024-11-22 09:48:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.user-card {
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
}
|
|
|
|
|
|
|
|
.user-name {
|
|
|
|
display: flex;
|
|
|
|
flex-direction: row;
|
|
|
|
flex-wrap: wrap;
|
|
|
|
gap: 10px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.user-info {
|
|
|
|
display: flex;
|
|
|
|
flex-direction: row;
|
|
|
|
flex-wrap: wrap;
|
|
|
|
gap: 10px;
|
|
|
|
}
|
2024-11-22 15:26:17 +00:00
|
|
|
|
|
|
|
.user-classification {
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
gap: 3px;
|
|
|
|
}
|
|
|
|
|
|
|
|
input.radio-classify {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
input.radio-classify + label {
|
|
|
|
border: 1px solid #000;
|
|
|
|
padding: 2px;
|
|
|
|
text-align: center;
|
|
|
|
}
|
|
|
|
input.radio-spam:checked + label {
|
|
|
|
border: 1px solid #d00400;
|
|
|
|
background: #d00400;
|
|
|
|
color: #fff;
|
|
|
|
}
|
|
|
|
input.radio-legit:checked + label {
|
|
|
|
border: 1px solid #048e02;
|
|
|
|
background: #048e02;
|
|
|
|
color: #fff;
|
|
|
|
}
|
|
|
|
|
|
|
|
.score {
|
|
|
|
padding-left: 3px;
|
|
|
|
padding-right: 3px;
|
2024-11-23 10:46:47 +00:00
|
|
|
width: 2.8em;
|
2024-11-22 15:26:17 +00:00
|
|
|
text-align: center;
|
|
|
|
flex-grow: 0;
|
|
|
|
flex-shrink: 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
.score-high {
|
|
|
|
background: #ff696b;
|
|
|
|
}
|
|
|
|
.score-mid {
|
|
|
|
background: #ffa769;
|
|
|
|
}
|
|
|
|
.score-low {
|
|
|
|
background: #5fd770;
|
|
|
|
}
|
2024-11-22 09:48:11 +00:00
|
|
|
</style>
|
|
|
|
<body>
|
2024-11-22 15:26:17 +00:00
|
|
|
<div class="main">
|
2024-11-23 11:33:54 +00:00
|
|
|
<div class="stats">
|
|
|
|
Users: unclassified: {{unclassified_users_count}} | total: {{total_users_count}}
|
|
|
|
</div>
|
2024-11-23 11:42:53 +00:00
|
|
|
<div class="sort-options">
|
|
|
|
<a href="/?sort=spam">Sort: Spam first</a> |
|
|
|
|
<a href="/?sort=legit">Sort: Legit first</a> |
|
|
|
|
<a href="/?sort=random">Sort: Random</a>
|
|
|
|
</div>
|
|
|
|
<form method="post">
|
2024-11-22 15:26:17 +00:00
|
|
|
<div class="users">
|
|
|
|
{% for id_user_score in users %}
|
|
|
|
{% set user_id = id_user_score[0] %}
|
|
|
|
{% set user = id_user_score[1] %}
|
|
|
|
{% set score = id_user_score[2] %}
|
2024-11-22 09:48:11 +00:00
|
|
|
<div class="user">
|
|
|
|
<div class="user-classification">
|
2024-11-22 15:26:17 +00:00
|
|
|
<input type="radio" name="{{user_id}}" id="{{user_id}}-spam" value="spam"
|
|
|
|
class="radio-classify radio-spam"
|
|
|
|
{% if score >= 0.8 %}checked{% endif %}
|
|
|
|
/>
|
|
|
|
<label for="{{user_id}}-spam">Spam</label>
|
|
|
|
<input type="radio" name="{{user_id}}" id="{{user_id}}-legit" value="legit"
|
|
|
|
class="radio-classify radio-legit"
|
|
|
|
{% if score < 0.8 %}checked{% endif %}
|
|
|
|
/>
|
|
|
|
<label for="{{user_id}}-legit">Legit</label>
|
|
|
|
</div>
|
|
|
|
<div class="score
|
|
|
|
{% if score >= 0.8 %} score-high {% endif %}
|
|
|
|
{% if score < 0.8 and score > 0.3 %} score-mid {% endif %}
|
|
|
|
{% if score <= 0.3 %} score-low {% endif %}
|
|
|
|
">
|
|
|
|
{{ score | round(precision=2) }}
|
2024-11-22 09:48:11 +00:00
|
|
|
</div>
|
|
|
|
<div class="user-card">
|
|
|
|
<div class="user-name">
|
2024-11-23 11:42:53 +00:00
|
|
|
<div><strong><a href="https://git.deuxfleurs.fr/{{user.login}}">{{ user.login }}</a></strong></div>
|
2024-11-23 10:46:47 +00:00
|
|
|
{%- if user.full_name %}<div><strong>({{ user.full_name }})</strong></div>{% endif -%}
|
2024-11-22 09:48:11 +00:00
|
|
|
</div>
|
|
|
|
<div class="user-info">
|
|
|
|
{%- if user.location %}<div>[L] {{ user.location }}</div>{% endif -%}
|
|
|
|
{%- if user.website %}<div>[W] {{ user.website }}</div>{% endif -%}
|
|
|
|
</div>
|
|
|
|
{%- if user.description %}<div>[D] {{ user.description }}</div>{% endif -%}
|
|
|
|
{%- if user.repos | length > 0 %}
|
|
|
|
<div class="user-repos">
|
|
|
|
<div>Repositories:</div>
|
|
|
|
{% for repo in user.repos %}
|
|
|
|
<div>{{ macros::compact(name=repo[1].name, desc=repo[1].description) }}</div>
|
|
|
|
{% endfor %}
|
|
|
|
</div>
|
|
|
|
{% endif -%}
|
|
|
|
{%- if user.issues | length > 0 %}
|
|
|
|
<div class="user-issues">
|
|
|
|
<div>Issues:</div>
|
|
|
|
{% for issue in user.issues %}
|
|
|
|
<div>{{ macros::compact(name=issue[1].title, desc=issue[1].body) }}</div>
|
|
|
|
{% endfor %}
|
|
|
|
</div>
|
|
|
|
{% endif -%}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{% endfor %}
|
|
|
|
|
|
|
|
</div>
|
2024-11-22 15:26:17 +00:00
|
|
|
|
|
|
|
<input type="submit" value="Apply" class="button" style="width: 200px; height: 30px"/>
|
2024-11-22 09:48:11 +00:00
|
|
|
</form>
|
2024-11-23 11:42:53 +00:00
|
|
|
</div>
|
2024-11-22 09:48:11 +00:00
|
|
|
|
|
|
|
</body>
|
|
|
|
</html>
|