Collections/templates/partials/category_detail.twig
Edwin Noorlander 9f9617ca45 Add development documentation and enhance SPA navigation with category/item detail views
- Add DEVELOPMENT.md with complete LXC environment setup guide
- Implement dynamic category tree with item navigation in sidebar
- Add category detail view with items list via AJAX
- Add item edit form with delete functionality
- Enhance SPA routing to support query parameters for categories/items
- Update Bootstrap styling with icons and improved navigation
- Include SQLite database in repository for development
2025-11-12 09:51:01 +01:00

39 lines
1.8 KiB
Twig

<div class="d-flex justify-content-between align-items-center mb-4">
<h2>{{ category.name }}</h2>
<button class="btn btn-primary" onclick="fetchContent('/parts')">Add New Item</button>
</div>
<div class="card">
<div class="card-header">
<h5 class="mb-0">Items in this Category</h5>
</div>
<div class="card-body">
{% if items|length > 0 %}
<div class="list-group">
{% for item in items %}
<div class="list-group-item d-flex justify-content-between align-items-center">
<div>
<h6 class="mb-1">{{ item.name }}</h6>
{% if item.description %}
<p class="mb-1 text-muted">{{ item.description }}</p>
{% endif %}
{% if item.location %}
<small class="text-muted">📍 {{ item.location }}</small>
{% endif %}
</div>
<div>
<button class="btn btn-sm btn-outline-primary edit-btn" data-id="{{ item.id }}">Edit</button>
<button class="btn btn-sm btn-outline-danger delete-btn" data-id="{{ item.id }}">Delete</button>
{% if item.id_code %}
<a href="/print/{{ item.id }}" target="_blank" class="btn btn-sm btn-outline-secondary">QR</a>
{% endif %}
</div>
</div>
{% endfor %}
</div>
{% else %}
<p class="text-muted">No items in this category yet.</p>
<button class="btn btn-primary" onclick="fetchContent('/parts')">Add First Item</button>
{% endif %}
</div>
</div>