forgery/templates/ui.html

48 lines
1.9 KiB
HTML

{% import "macros.html" as macros %}
{% macro user_card(user_id, user, score, score_approx, is_spam) %}
<div class="user">
<div class="user-classification">
<input type="radio" name="{{user_id}}" id="{{user_id}}-spam" value="spam"
class="radio-classify radio-spam"
{% if is_spam %}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 not is_spam %}checked{% endif %}
/>
<label for="{{user_id}}-legit">Legit</label>
</div>
<div class="score score-{{score_approx}}">
{{ score | round(precision=2) }}
</div>
<div class="user-card">
<div class="user-name">
<div><strong><a href="https://git.deuxfleurs.fr/{{user.login}}">{{ user.login }}</a></strong></div>
{%- if user.full_name %}<div><strong>({{ user.full_name }})</strong></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>
{% endmacro user_card %}