Files
devplacepy/devplacepy/templates/issue_detail.html
T
retoor 6f340a6818 feat: add per-user avatar seed regeneration with irreversible random avatar replacement
Implement a new `avatar_seed` column on the users table that overrides the username-based seed for Multiavatar generation. Introduce a null-safe `avatar_seed(user)` choke point in `avatar.py` that resolves `user.get("avatar_seed") or user.get("username")`, registered as a Jinja global so every render site (`_avatar_link.html`, `avatar_url(...)` calls, SEO `og_image`, issues ad-hoc dicts, devRant payload/PNG) propagates a regenerated seed. Add `POST /profile/{username}/regenerate-avatar` endpoint (owner-or-admin only) that writes a fresh `generate_uid()` to `avatar_seed`, invalidates the target's user cache, and audits `profile.avatar.regenerate`. The previous seed is overwritten and never stored, making regeneration irreversible. Document the feature in `AGENTS.md` and `README.md`, add the API endpoint to `docs_api.py`, and include the `regenerate_avatar` Devii tool in `CONFIRM_REQUIRED`.
2026-06-27 22:31:34 +00:00

94 lines
4.8 KiB
HTML

{% extends "base.html" %}
{% block extra_head %}
<link rel="stylesheet" href="{{ static_url('/static/css/issues.css') }}">
{% endblock %}
{% block content %}
<div class="issues-layout issue-detail">
<div class="issue-detail-nav">
<a href="/issues" class="issue-back">&#x2190; All issues</a>
{% if issue.html_url %}<a href="{{ issue.html_url }}" class="issue-gitea-link" target="_blank" rel="noopener noreferrer">View on Gitea</a>{% endif %}
</div>
<div class="card issue-detail-card">
<div class="issue-detail-header">
<span class="issue-number">#{{ issue.number }}</span>
<h1 class="issue-detail-title">{{ render_title(issue.title) }}</h1>
<span class="issue-status {{ issue.state }}"><span class="sr-only">Status: </span>{{ issue.state }}</span>
</div>
<div class="issue-meta">
{% if issue.is_local_author %}
{% set _user = {'username': issue.author_username, 'avatar_seed': issue.author_avatar_seed} %}{% set _size = 24 %}{% set _size_class = "sm" %}{% include "_avatar_link.html" %}
{% endif %}
<span class="issue-author">{{ issue.author_username }}</span>
<span class="issue-dot">&middot;</span>
<span class="issue-date">{{ local_dt(issue.created_at) }}</span>
</div>
{% if viewer_is_admin %}
<div class="issue-admin-actions">
{% if issue.state == 'open' %}
<form method="POST" action="/issues/{{ issue.number }}/status">
<input type="hidden" name="status" value="closed">
<button type="submit" class="btn btn-secondary btn-sm"><span class="btn-spinner" aria-hidden="true"></span>Close ticket</button>
</form>
{% else %}
<form method="POST" action="/issues/{{ issue.number }}/status">
<input type="hidden" name="status" value="open">
<button type="submit" class="btn btn-secondary btn-sm"><span class="btn-spinner" aria-hidden="true"></span>Reopen ticket</button>
</form>
{% endif %}
</div>
{% endif %}
<div class="issue-detail-body rendered-content">{{ render_content(body) }}</div>
{% if attachments %}
{% set _attachments = attachments %}{% set _delete_base = "/issues/" ~ issue.number ~ "/attachments" %}{% include "_issue_attachments.html" %}
{% endif %}
{% if can_attach %}
<form class="issue-attach-form" data-issue-attach data-action="/issues/{{ issue.number }}/attachments">
{% include "_attachment_form.html" %}
<button type="submit" class="btn btn-secondary btn-sm"><span class="btn-spinner" aria-hidden="true"></span>Attach files</button>
</form>
{% endif %}
</div>
<section class="comments-section">
<h3>Updates &amp; comments</h3>
{% for comment in comments %}
<div class="issue-comment">
<div class="issue-comment-head">
{% if comment.is_local_author %}
{% set _user = {'username': comment.author_username, 'avatar_seed': comment.author_avatar_seed} %}{% set _size = 20 %}{% set _size_class = "sm" %}{% include "_avatar_link.html" %}
{% else %}
<span class="issue-comment-badge"><span class="sr-only">Developer reply from </span>dev</span>
{% endif %}
<span class="issue-author">{{ comment.author_username }}</span>
<span class="issue-dot">&middot;</span>
<span class="issue-date">{{ local_dt(comment.created_at) }}</span>
</div>
<div class="issue-comment-body rendered-content">{{ render_content(comment.body) }}</div>
{% if comment.attachments %}
{% set _attachments = comment.attachments %}{% set _delete_base = "/issues/" ~ issue.number ~ "/comments/" ~ comment.id ~ "/attachments" %}{% include "_issue_attachments.html" %}
{% endif %}
</div>
{% else %}
<p class="no-comments-msg">No updates yet.</p>
{% endfor %}
{% if can_comment %}
<form method="POST" action="/issues/{{ issue.number }}/comment" class="comment-form issue-comment-form">
<textarea name="body" required aria-required="true" maxlength="5000" placeholder="Add a comment (posted to the tracker)..." class="min-h-120" data-mention aria-label="Add a comment"></textarea>
<div class="issue-comment-form-footer">
{% include "_attachment_form.html" %}
<button type="submit" class="btn btn-primary btn-sm"><span class="btn-spinner" aria-hidden="true"></span>Comment</button>
</div>
</form>
{% else %}
<p class="no-comments-msg"><a href="/auth/login">Log in</a> to comment.</p>
{% endif %}
</section>
</div>
{% endblock %}