forked from retoor/devplacepy
feat: add file attachment support to issue tracker with Gitea mirroring
Implement full attachment CRUD for issues and comments, restricted to open issues only. Attachments are stored locally and mirrored to the Gitea tracker via new `mirror_attachment_to_gitea` and `set_gitea_asset_id` functions. Add `gitea_asset_id` column to the attachments table, extend `IssueForm` and `IssueCommentForm` with `attachment_uids` field, and expose new API endpoints for listing, adding, and deleting issue attachments. Update agent configuration to include web research tools, and document the new capability in README, AGENTS.md, and CLAUDE.md.
This commit is contained in:
@@ -41,6 +41,17 @@
|
||||
{% 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">
|
||||
@@ -58,6 +69,9 @@
|
||||
<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>
|
||||
@@ -67,6 +81,7 @@
|
||||
<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>
|
||||
|
||||
Reference in New Issue
Block a user