forked from retoor/devplacepy
fix: rename bug card anchor to div with _card_link include and add admin role tests
The bug list template wraps each bug in a `<div class="bug-card card-link-host">` instead of a bare `<a>`, pulling in `_card_link.html` for proper link semantics. Two new integration tests (`test_bug_detail_renders_for_member` and `test_bug_detail_renders_for_admin`) verify that the `/bugs/{number}` endpoint returns 200 for both roles, that the "Close ticket" button is absent for members and present for admins, and that the JSON response exposes `viewer_is_admin` as a boolean. Supporting helpers `_role_user` and `_open_ticket` create users with a specific role and open a Gitea-backed ticket.
This commit is contained in:
@@ -25,7 +25,10 @@
|
||||
{% else %}
|
||||
<div class="bugs-list">
|
||||
{% for bug in bugs %}
|
||||
<a class="bug-card" href="/bugs/{{ bug.number }}">
|
||||
<div class="bug-card card-link-host">
|
||||
{% set _href = "/bugs/" ~ bug.number %}
|
||||
{% set _label = bug.title %}
|
||||
{% include "_card_link.html" %}
|
||||
<div class="bug-card-header">
|
||||
<span class="bug-number">#{{ bug.number }}</span>
|
||||
<span class="bug-title">{{ bug.title }}</span>
|
||||
@@ -41,7 +44,7 @@
|
||||
<span class="bug-dot">·</span>
|
||||
<span class="bug-comments">{{ bug.comments_count }} comment{{ '' if bug.comments_count == 1 else 's' }}</span>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="empty-state">No bug reports yet.</div>
|
||||
{% endfor %}
|
||||
|
||||
Reference in New Issue
Block a user