Files
digiserver/templates/integrate_player.html
2025-01-25 20:03:47 +02:00

119 lines
5.2 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<title>Integrate Player</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha3/dist/css/bootstrap.min.css" rel="stylesheet">
<style>
body.dark-mode {
background-color: #121212;
color: #ffffff;
}
.card.dark-mode {
background-color: #1e1e1e;
color: #ffffff;
}
.dark-mode label, .dark-mode th, .dark-mode td {
color: #ffffff;
}
.logo {
max-height: 100px;
margin-right: 20px;
}
</style>
</head>
<body class="{{ 'dark-mode' if theme == 'dark' else '' }}">
<div class="container py-5">
<div class="d-flex justify-content-start align-items-center mb-4">
{% if logo_exists %}
<img src="{{ url_for('static', filename='uploads/logo.png') }}" alt="Logo" class="logo">
{% endif %}
<h1 class="mb-0">Integrate Player</h1>
</div>
<!-- Players Section -->
<div class="card mb-4 {{ 'dark-mode' if theme == 'dark' else '' }}">
<div class="card-header">
<h2>Players</h2>
</div>
<div class="card-body">
<ul class="list-group">
{% for player in players %}
<li class="list-group-item d-flex justify-content-between align-items-center">
<div>
<strong>{{ player.username }}</strong>
</div>
<div>
<a href="{{ url_for('player_page', player_id=player.id) }}" class="btn btn-sm btn-primary">View</a>
<form action="{{ url_for('delete_player', player_id=player.id) }}" method="post" style="display:inline;">
<button type="submit" class="btn btn-sm btn-danger" onclick="return confirm('Are you sure you want to delete this player?');">Delete</button>
</form>
</div>
</li>
{% endfor %}
</ul>
</div>
</div>
<!-- Add Player Section -->
<div class="card mb-4 {{ 'dark-mode' if theme == 'dark' else '' }}">
<div class="card-header">
<h2>Add Player</h2>
</div>
<div class="card-body">
<form action="{{ url_for('add_player') }}" method="post">
<div class="mb-3">
<label for="username" class="form-label">Username</label>
<input type="text" class="form-control {{ 'dark-mode' if theme == 'dark' else '' }}" id="username" name="username" required>
</div>
<div class="mb-3">
<label for="password" class="form-label">Password</label>
<input type="password" class="form-control {{ 'dark-mode' if theme == 'dark' else '' }}" id="password" name="password" required>
</div>
<button type="submit" class="btn btn-primary">Add Player</button>
</form>
</div>
</div>
<!-- Groups Section -->
<div class="card mb-4 {{ 'dark-mode' if theme == 'dark' else '' }}">
<div class="card-header bg-success text-white">
<h2>Groups</h2>
</div>
<div class="card-body">
<div class="row">
{% for group in groups %}
<div class="col-md-4 mb-3">
<div class="card {{ 'dark-mode' if theme == 'dark' else '' }}">
<div class="card-body">
<h5 class="card-title">{{ group.name }}</h5>
<p class="card-text">{{ group.players | length }} players</p>
<div class="input-group">
<input type="text" class="form-control" value="{{ url_for('group_fullscreen', group_id=group.id, _external=True) }}" readonly>
<button class="btn btn-primary" onclick="copyToClipboard(this)">Copy</button>
</div>
<a href="{{ url_for('group_fullscreen', group_id=group.id) }}" class="btn btn-primary mt-2" target="_blank">Fullscreen Link</a>
</div>
</div>
</div>
{% endfor %}
</div>
</div>
</div>
<a href="{{ url_for('dashboard') }}" class="btn btn-secondary">Back to Dashboard</a>
</div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha3/dist/js/bootstrap.bundle.min.js"></script>
<script>
function copyToClipboard(button) {
const input = button.previousElementSibling;
input.select();
input.setSelectionRange(0, 99999); // For mobile devices
document.execCommand("copy");
button.textContent = "Copied!";
setTimeout(() => {
button.textContent = "Copy";
}, 2000);
}
</script>
</body>
</html>