145 lines
6.7 KiB
HTML
145 lines
6.7 KiB
HTML
{% extends "base.html" %}
|
|
|
|
{% block title %}{{ action }} Team - SEREACT Web Client{% endblock %}
|
|
|
|
{% block content %}
|
|
<div class="row justify-content-center">
|
|
<div class="col-md-8">
|
|
<div class="card">
|
|
<div class="card-header">
|
|
<h5 class="mb-0">
|
|
<i class="fas fa-users"></i> {{ action }} Team
|
|
</h5>
|
|
</div>
|
|
<div class="card-body">
|
|
<form method="POST">
|
|
<div class="mb-3">
|
|
<label for="name" class="form-label">
|
|
<i class="fas fa-tag"></i> Team Name *
|
|
</label>
|
|
<input type="text" class="form-control" id="name" name="name"
|
|
value="{{ team.name if team else '' }}"
|
|
placeholder="Enter team name" required>
|
|
<div class="form-text">
|
|
A unique name for this team
|
|
</div>
|
|
</div>
|
|
|
|
<div class="mb-3">
|
|
<label for="description" class="form-label">
|
|
<i class="fas fa-align-left"></i> Description
|
|
</label>
|
|
<textarea class="form-control" id="description" name="description"
|
|
rows="3" placeholder="Enter team description">{{ team.description if team else '' }}</textarea>
|
|
<div class="form-text">
|
|
Optional description of the team's purpose or role
|
|
</div>
|
|
</div>
|
|
|
|
{% if team %}
|
|
<div class="mb-3">
|
|
<label class="form-label">
|
|
<i class="fas fa-info-circle"></i> Team Information
|
|
</label>
|
|
<div class="card bg-light">
|
|
<div class="card-body">
|
|
<div class="row">
|
|
<div class="col-md-6">
|
|
<small class="text-muted">
|
|
<i class="fas fa-calendar"></i> Created:
|
|
{{ team.created_at.strftime('%Y-%m-%d %H:%M') if team.created_at else 'Unknown' }}
|
|
</small>
|
|
</div>
|
|
<div class="col-md-6">
|
|
<small class="text-muted">
|
|
<i class="fas fa-edit"></i> Updated:
|
|
{{ team.updated_at.strftime('%Y-%m-%d %H:%M') if team.updated_at else 'Unknown' }}
|
|
</small>
|
|
</div>
|
|
</div>
|
|
<div class="mt-2">
|
|
<small class="text-muted">
|
|
<i class="fas fa-fingerprint"></i> ID: {{ team.id }}
|
|
</small>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
|
|
<div class="d-grid gap-2 d-md-flex justify-content-md-end">
|
|
<a href="{{ url_for('teams') }}" class="btn btn-secondary">
|
|
<i class="fas fa-arrow-left"></i> Back to Teams
|
|
</a>
|
|
<button type="submit" class="btn btn-primary">
|
|
<i class="fas fa-save"></i> {{ action }} Team
|
|
</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
|
|
{% if action == 'Edit' %}
|
|
<div class="card mt-4">
|
|
<div class="card-header bg-danger text-white">
|
|
<h6 class="mb-0">
|
|
<i class="fas fa-exclamation-triangle"></i> Danger Zone
|
|
</h6>
|
|
</div>
|
|
<div class="card-body">
|
|
<p class="text-muted">
|
|
Deleting a team is permanent and cannot be undone. All associated data may be affected.
|
|
</p>
|
|
<button type="button" class="btn btn-outline-danger"
|
|
onclick="confirmDelete('{{ team.name }}', '{{ url_for('delete_team', team_id=team.id) }}')">
|
|
<i class="fas fa-trash"></i> Delete Team
|
|
</button>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 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.
|
|
</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>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
{% endblock %}
|
|
|
|
{% block scripts %}
|
|
{% if action == 'Edit' %}
|
|
<script>
|
|
function confirmDelete(teamName, deleteUrl) {
|
|
document.getElementById('deleteTeamName').textContent = teamName;
|
|
document.getElementById('deleteForm').action = deleteUrl;
|
|
new bootstrap.Modal(document.getElementById('deleteModal')).show();
|
|
}
|
|
</script>
|
|
{% endif %}
|
|
{% endblock %} |