96 lines
4.0 KiB
HTML
96 lines
4.0 KiB
HTML
{% extends "base.html" %}
|
|
|
|
{% block title %}Teams - SEREACT Web Client{% endblock %}
|
|
|
|
{% block content %}
|
|
<div class="d-flex justify-content-between align-items-center mb-4">
|
|
<h2><i class="fas fa-users"></i> Teams</h2>
|
|
<a href="{{ url_for('create_team') }}" class="btn btn-primary">
|
|
<i class="fas fa-plus"></i> Create Team
|
|
</a>
|
|
</div>
|
|
|
|
{% if teams %}
|
|
<div class="row">
|
|
{% for team in teams %}
|
|
<div class="col-md-6 col-lg-4 mb-4">
|
|
<div class="card h-100">
|
|
<div class="card-body">
|
|
<h5 class="card-title">
|
|
<i class="fas fa-users text-primary"></i> {{ team.name }}
|
|
</h5>
|
|
<p class="card-text">{{ team.description or 'No description provided' }}</p>
|
|
<div class="text-muted small">
|
|
<div><i class="fas fa-calendar"></i> Created: {{ team.created_at.strftime('%Y-%m-%d %H:%M') if team.created_at else 'Unknown' }}</div>
|
|
{% if team.updated_at and team.updated_at != team.created_at %}
|
|
<div><i class="fas fa-edit"></i> Updated: {{ team.updated_at.strftime('%Y-%m-%d %H:%M') }}</div>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
<div class="card-footer bg-transparent">
|
|
<div class="btn-group w-100" role="group">
|
|
<a href="{{ url_for('edit_team', team_id=team.id) }}" class="btn btn-outline-primary btn-sm">
|
|
<i class="fas fa-edit"></i> Edit
|
|
</a>
|
|
<button type="button" class="btn btn-outline-danger btn-sm"
|
|
onclick="confirmDelete('{{ team.name }}', '{{ url_for('delete_team', team_id=team.id) }}')">
|
|
<i class="fas fa-trash"></i> Delete
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endfor %}
|
|
</div>
|
|
{% else %}
|
|
<div class="text-center py-5">
|
|
<i class="fas fa-users fa-4x text-muted mb-3"></i>
|
|
<h4 class="text-muted">No Teams Found</h4>
|
|
<p class="text-muted">Create your first team to get started.</p>
|
|
<a href="{{ url_for('create_team') }}" class="btn btn-primary">
|
|
<i class="fas fa-plus"></i> Create First Team
|
|
</a>
|
|
</div>
|
|
{% endif %}
|
|
|
|
<!-- Delete Confirmation Modal -->
|
|
<div class="modal fade" id="deleteModal" tabindex="-1">
|
|
<div class="modal-dialog">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<h5 class="modal-title">
|
|
<i class="fas fa-exclamation-triangle text-warning"></i> Confirm Delete
|
|
</h5>
|
|
<button type="button" class="btn-close" data-bs-dismiss="modal"></button>
|
|
</div>
|
|
<div class="modal-body">
|
|
<p>Are you sure you want to delete the team "<span id="deleteTeamName"></span>"?</p>
|
|
<div class="alert alert-warning" role="alert">
|
|
<i class="fas fa-exclamation-triangle"></i>
|
|
<strong>Warning:</strong> This action cannot be undone. All associated data may be affected.
|
|
</div>
|
|
</div>
|
|
<div class="modal-footer">
|
|
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">
|
|
<i class="fas fa-times"></i> Cancel
|
|
</button>
|
|
<form id="deleteForm" method="POST" style="display: inline;">
|
|
<button type="submit" class="btn btn-danger">
|
|
<i class="fas fa-trash"></i> Delete Team
|
|
</button>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endblock %}
|
|
|
|
{% block scripts %}
|
|
<script>
|
|
function confirmDelete(teamName, deleteUrl) {
|
|
document.getElementById('deleteTeamName').textContent = teamName;
|
|
document.getElementById('deleteForm').action = deleteUrl;
|
|
new bootstrap.Modal(document.getElementById('deleteModal')).show();
|
|
}
|
|
</script>
|
|
{% endblock %} |