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>
|
|
|
|
<!-- Font Awesome -->
|
|
|
|
<!-- <link -->
|
|
|
|
<!-- rel="stylesheet" -->
|
|
|
|
<!-- href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css" -->
|
|
|
|
<!-- /> -->
|
|
|
|
<!-- Google Fonts Roboto -->
|
|
|
|
<!-- <link -->
|
|
|
|
<!-- rel="stylesheet" -->
|
|
|
|
<!-- href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700;900&display=swap" -->
|
|
|
|
<!-- /> -->
|
|
|
|
<!-- MDB -->
|
|
|
|
<!-- <link rel="stylesheet" href="css/mdb.min.css" /> -->
|
|
|
|
</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-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;
|
|
|
|
width: 3em;
|
|
|
|
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>
|
|
|
|
<form method="post">
|
2024-11-22 15:26:17 +00:00
|
|
|
<div class="main">
|
|
|
|
<div class="users">
|
2024-11-22 09:48:11 +00:00
|
|
|
|
2024-11-22 15:26:17 +00:00
|
|
|
{% 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">
|
|
|
|
<div>{{ user.login }}</div>
|
|
|
|
{%- if user.full_name %}<div>({{ user.full_name }})</div>{% endif -%}
|
|
|
|
</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"/>
|
|
|
|
</div>
|
2024-11-22 09:48:11 +00:00
|
|
|
</form>
|
|
|
|
|
|
|
|
</body>
|
|
|
|
</html>
|