updated to video upload

This commit is contained in:
2025-01-23 16:31:57 +02:00
parent 4b8d075bfe
commit 70a0065b98
28 changed files with 619 additions and 420 deletions

View File

@@ -3,13 +3,26 @@
<head>
<title>Player Schedule</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;
}
</style>
</head>
<body>
<body class="{{ 'dark-mode' if theme == 'dark' else '' }}">
<div class="container py-5">
<h1 class="text-center mb-4">Player Schedule for {{ player.username }}</h1>
<!-- Player Info Section -->
<div class="card mb-4">
<div class="card mb-4 {{ 'dark-mode' if theme == 'dark' else '' }}">
<div class="card-header bg-info text-white">
<h2>Player Info</h2>
</div>
@@ -32,76 +45,24 @@
<h4 class="text-center">Member of Group(s):</h4>
<ul class="list-group">
{% for group in player.groups %}
<li class="list-group-item d-flex justify-content-between align-items-center">
<div>{{ group.name }}</div>
<form action="{{ url_for('remove_player_from_group', group_id=group.id, player_id=player.id) }}" method="post" class="d-inline">
<button type="submit" class="btn btn-sm btn-danger" onclick="return confirm('Are you sure you want to remove this player from the group?');">Remove</button>
</form>
</li>
<li class="list-group-item {{ 'dark-mode' if theme == 'dark' else '' }}">{{ group.name }}</li>
{% endfor %}
</ul>
{% else %}
<h4 class="text-center">Not a member of any group</h4>
<p class="text-center">This player is not a member of any groups.</p>
{% endif %}
</div>
<!-- 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>
{% if not player.groups %}
<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>
{% endif %}
</li>
{% endfor %}
</ul>
</div>
</div>
<!-- Upload Section -->
{% if not player.groups %}
<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>
<!-- Replace Upload Content Card with Button -->
{% if current_user.role == 'admin' %}
<div class="text-center mb-4">
<a href="{{ url_for('upload_content', target_type='player', target_id=player.id, return_url=request.url) }}" class="btn btn-primary">Upload Content</a>
</div>
{% endif %}
<a href="{{ url_for('dashboard') }}" class="btn btn-secondary">Back to Dashboard</a>
<a href="{{ url_for('player_fullscreen', player_id=player.id) }}" class="btn btn-primary">Full Screen</a>
</div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha3/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>