cleaning the app
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
9
app.py
9
app.py
@@ -293,14 +293,7 @@ def add_player():
|
||||
return redirect(url_for('dashboard'))
|
||||
return render_template('add_player.html')
|
||||
|
||||
@app.route('/integrate_player')
|
||||
@login_required
|
||||
@admin_required
|
||||
def integrate_player():
|
||||
players = Player.query.all()
|
||||
return render_template('integrate_player.html', players=players)
|
||||
|
||||
@app.route('/edit_player/<int:player_id>', methods=['GET', 'POST'])
|
||||
@app.route('/player/<int:player_id>/edit', methods=['GET', 'POST'])
|
||||
@login_required
|
||||
@admin_required
|
||||
def edit_player(player_id):
|
||||
|
||||
Binary file not shown.
@@ -16,7 +16,6 @@ SQLAlchemy==2.0.37
|
||||
typing_extensions==4.12.2
|
||||
Werkzeug==3.1.3
|
||||
gunicorn==20.1.0
|
||||
|
||||
pdf2image==1.17.0
|
||||
pillow==11.1.0
|
||||
setuptools==75.8.0
|
||||
@@ -50,6 +50,7 @@
|
||||
</div>
|
||||
<div>
|
||||
<a href="{{ url_for('player_page', player_id=player.id) }}" class="btn btn-sm btn-secondary">Manage Player</a>
|
||||
<a href="{{ url_for('edit_player', player_id=player.id, return_url=url_for('dashboard')) }}" class="btn btn-sm btn-secondary">Edit Player</a>
|
||||
<a href="{{ url_for('player_fullscreen', player_id=player.id) }}" class="btn btn-sm btn-primary">Full Screen</a>
|
||||
{% if current_user.role == 'admin' %}
|
||||
<form action="{{ url_for('delete_player', player_id=player.id) }}" method="post" style="display:inline;">
|
||||
@@ -77,18 +78,6 @@
|
||||
<a href="{{ url_for('upload_content') }}" class="btn btn-warning btn-lg">Upload Content</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Integrate Player Section -->
|
||||
{% if current_user.role == 'admin' %}
|
||||
<div class="card mb-4 {{ 'dark-mode' if theme == 'dark' else '' }}">
|
||||
<div class="card-header bg-dark text-white">
|
||||
<h2>Integrate Player</h2>
|
||||
</div>
|
||||
<div class="card-body text-center">
|
||||
<a href="{{ url_for('integrate_player') }}" class="btn btn-dark btn-lg">Integrate Player</a>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<!-- App Settings Section -->
|
||||
|
||||
@@ -1,100 +0,0 @@
|
||||
<!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>
|
||||
|
||||
|
||||
<!-- 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>
|
||||
Reference in New Issue
Block a user