- Add custom border, background, and spacing utilities to base template - Enhance message notification styling and layout - Update delete modal button appearance and behavior - Refine comment card component with Tailwind classes and responsive behavior - Adjust sidebar responsiveness for mobile view
77 lines
5.3 KiB
HTML
77 lines
5.3 KiB
HTML
{% extends "base_authenticated.html" %}
|
|
{% block title %}{{ issue.title }}{% endblock %}
|
|
{% block content_inner %}
|
|
<div class="max-w-4xl mx-auto">
|
|
<div class="card-surface overflow-hidden mb-6">
|
|
<div class="p-6">
|
|
<div class="flex items-start justify-between mb-4">
|
|
<div>
|
|
<div class="flex items-center gap-2 text-sm text-tertiary mb-1">
|
|
<a href="{% url 'issue_list' %}" class="hover:text-blue-600">Issues</a>
|
|
<span>/</span>
|
|
<span class="text-primary">{{ issue.title|truncatechars:30 }}</span>
|
|
</div>
|
|
<h1 class="text-2xl font-bold text-primary">{{ issue.title }}</h1>
|
|
</div>
|
|
<div class="flex gap-2">
|
|
<a href="{% url 'issue_edit' issue.pk %}" class="px-3 py-1.5 rounded-lg text-sm font-medium text-secondary hover:bg-hover border border-soft transition-colors">Edit</a>
|
|
{% if user.is_admin %}
|
|
<label for="delete-modal-issue" class="px-3 py-1.5 rounded-lg text-sm font-medium bg-red-50 text-red-700 hover:bg-red-100 border border-red-200 transition-colors cursor-pointer">Delete</label>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
<div class="flex flex-wrap gap-2 mb-4">
|
|
<span class="text-xs px-2 py-1 rounded-full font-medium border {% if issue.status == 'open' %}bg-blue-50 text-blue-700 border-blue-200{% elif issue.status == 'in_progress' %}bg-amber-50 text-amber-700 border-amber-200{% elif issue.status == 'resolved' %}bg-green-50 text-green-700 border-green-200{% else %}bg-gray-50 text-gray-700 border-gray-200{% endif %}">
|
|
{{ issue.get_status_display }}
|
|
</span>
|
|
<span class="text-xs px-2 py-1 rounded-full font-medium border {% if issue.priority == 'high' %}bg-red-50 text-red-700 border-red-200{% elif issue.priority == 'medium' %}bg-amber-50 text-amber-700 border-amber-200{% else %}bg-blue-50 text-blue-700 border-blue-200{% endif %}">
|
|
{{ issue.get_priority_display }}
|
|
</span>
|
|
</div>
|
|
<div class="grid grid-cols-2 md:grid-cols-3 gap-3 p-4 bg-hover rounded-xl mb-6">
|
|
<div><p class="text-xs text-muted uppercase font-medium">Project</p><p class="text-sm font-semibold text-primary mt-0.5"><a href="{% url 'project_detail' issue.project.pk %}" class="hover:text-blue-600">{{ issue.project.name }}</a></p></div>
|
|
<div><p class="text-xs text-muted uppercase font-medium">Reporter</p><p class="text-sm font-semibold text-primary mt-0.5">{{ issue.reporter.username }}</p></div>
|
|
<div><p class="text-xs text-muted uppercase font-medium">Assignee</p><p class="text-sm font-semibold text-primary mt-0.5">{{ issue.assignee.username|default:"Unassigned" }}</p></div>
|
|
</div>
|
|
<div class="prose prose-sm max-w-none">
|
|
<div class="text-secondary">{{ issue.description|safe }}</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="card-surface overflow-hidden">
|
|
<div class="px-6 py-4 border-b border-subtle">
|
|
<h2 class="font-semibold text-primary">Comments ({{ comments.count }})</h2>
|
|
</div>
|
|
<div class="p-6">
|
|
<div id="comment-list" class="space-y-4 mb-6">
|
|
{% for comment in comments %}
|
|
<div class="flex gap-3">
|
|
<div class="w-8 h-8 rounded-full bg-blue-500 flex items-center justify-center text-white text-xs font-bold flex-shrink-0">{{ comment.author.username|first|upper }}</div>
|
|
<div class="flex-1">
|
|
<div class="flex items-center gap-2 mb-1">
|
|
<span class="text-sm font-semibold text-primary">{{ comment.author.username }}</span>
|
|
<span class="text-xs text-muted">{{ comment.created_at|timesince }} ago</span>
|
|
</div>
|
|
<p class="text-sm text-secondary">{{ comment.body }}</p>
|
|
</div>
|
|
</div>
|
|
{% empty %}
|
|
<p class="text-sm text-muted text-center py-4">No comments yet. Be the first to comment.</p>
|
|
{% endfor %}
|
|
</div>
|
|
<form method="post" action="{% url 'issue_comment' issue.pk %}"
|
|
hx-target="#comment-list" hx-swap="innerHTML"
|
|
class="border-t border-subtle pt-4">
|
|
{% csrf_token %}
|
|
<label class="text-sm font-medium text-secondary mb-2 block">Add a comment</label>
|
|
<textarea name="body" rows="2" class="w-full px-3 py-2 rounded-lg border border-soft bg-white text-sm text-primary focus:outline-none focus:ring-2 focus:ring-blue-500/30 focus:border-blue-500 transition-colors resize-y" placeholder="Write your comment..." required></textarea>
|
|
<button type="submit" class="mt-2 px-3 py-1.5 rounded-lg text-sm font-medium bg-blue-600 text-white hover:bg-blue-700 transition-colors">Post Comment</button>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% url 'issue_delete' issue.pk as delete_url %}
|
|
{% include "components/delete_modal.html" with modal_id="delete-modal-issue" delete_url=delete_url %}
|
|
{% endblock %}
|