functioning
This commit is contained in:
@@ -18,12 +18,22 @@
|
||||
<div class="card-body">
|
||||
<ul class="list-group">
|
||||
{% for player in players %}
|
||||
<!-- ...existing code... -->
|
||||
|
||||
<li class="list-group-item d-flex justify-content-between align-items-center">
|
||||
<div>
|
||||
<strong>{{ player.username }}</strong> ({{ player.ip }})
|
||||
</div>
|
||||
<a href="{{ url_for('player_page', player_id=player.id) }}" class="btn btn-sm btn-secondary">View Schedule</a>
|
||||
<div>
|
||||
<a href="{{ url_for('player_page', player_id=player.id) }}" class="btn btn-sm btn-secondary">View Schedule</a>
|
||||
<a href="{{ url_for('player_fullscreen', player_id=player.id) }}" class="btn btn-sm btn-primary">Full Screen</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>
|
||||
|
||||
<!-- ...existing code... -->
|
||||
{% endfor %}
|
||||
</ul>
|
||||
<div class="mt-3">
|
||||
|
||||
49
templates/player_fullscreen.html
Normal file
49
templates/player_fullscreen.html
Normal file
@@ -0,0 +1,49 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Player Fullscreen Schedule</title>
|
||||
<style>
|
||||
body, html {
|
||||
height: 100%;
|
||||
margin: 0;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
background-color: black;
|
||||
}
|
||||
img {
|
||||
max-width: 100%;
|
||||
max-height: 100%;
|
||||
display: none;
|
||||
}
|
||||
img.active {
|
||||
display: block;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="content">
|
||||
{% for item in content %}
|
||||
<img src="{{ url_for('static', filename='uploads/' ~ item.file_name) }}" alt="Content Image" data-duration="{{ item.duration }}">
|
||||
{% endfor %}
|
||||
</div>
|
||||
<script>
|
||||
const images = document.querySelectorAll('#content img');
|
||||
let index = 0;
|
||||
|
||||
function showNextImage() {
|
||||
images.forEach((img, i) => {
|
||||
img.classList.toggle('active', i === index);
|
||||
});
|
||||
const duration = images[index].getAttribute('data-duration') * 1000;
|
||||
index = (index + 1) % images.length;
|
||||
setTimeout(showNextImage, duration);
|
||||
}
|
||||
|
||||
if (images.length > 0) {
|
||||
images[0].classList.add('active');
|
||||
showNextImage();
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -2,14 +2,64 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>Player Schedule</title>
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha3/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
</head>
|
||||
<body>
|
||||
<h1>Player Schedule</h1>
|
||||
<ul>
|
||||
{% for item in schedule %}
|
||||
<li>{{ item.file }} - {{ item.duration }} seconds</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
<a href="{{ url_for('dashboard') }}">Back to Dashboard</a>
|
||||
<div class="container py-5">
|
||||
<h1 class="text-center mb-4">Player Schedule for {{ player.username }}</h1>
|
||||
|
||||
<!-- Schedule Section -->
|
||||
<div class="card mb-4">
|
||||
<div class="card-header bg-primary text-white">
|
||||
<h2>Schedule</h2>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<ul class="list-group">
|
||||
{% for item in content %}
|
||||
<li class="list-group-item d-flex justify-content-between align-items-center">
|
||||
<div>
|
||||
{{ item.file_name }} - {{ item.duration }} seconds
|
||||
</div>
|
||||
<div>
|
||||
<!-- Edit Duration Form -->
|
||||
<form action="{{ url_for('edit_content', content_id=item.id) }}" method="post" class="d-inline">
|
||||
<input type="number" name="duration" value="{{ item.duration }}" class="form-control d-inline-block" style="width: 80px;" required>
|
||||
<button type="submit" class="btn btn-sm btn-warning">Edit</button>
|
||||
</form>
|
||||
<!-- Delete Resource Form -->
|
||||
<form action="{{ url_for('delete_content', content_id=item.id) }}" method="post" class="d-inline">
|
||||
<button type="submit" class="btn btn-sm btn-danger" onclick="return confirm('Are you sure you want to delete this resource?');">Delete</button>
|
||||
</form>
|
||||
</div>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Upload Section -->
|
||||
<div class="card mb-4">
|
||||
<div class="card-header bg-success text-white">
|
||||
<h2>Upload Content</h2>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form action="{{ url_for('upload_content_to_player', player_id=player.id) }}" method="post" enctype="multipart/form-data">
|
||||
<div class="mb-3">
|
||||
<label for="files" class="form-label">Select Images</label>
|
||||
<input type="file" class="form-control" id="files" name="files" multiple required>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="duration" class="form-label">Display Duration (seconds)</label>
|
||||
<input type="number" class="form-control" id="duration" name="duration" required>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary">Upload</button>
|
||||
</form>
|
||||
</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>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
Reference in New Issue
Block a user