added management options for media
This commit is contained in:
@@ -2,19 +2,31 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>Add Group</title>
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha3/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
</head>
|
||||
<body>
|
||||
<h1>Add Group</h1>
|
||||
<form method="POST">
|
||||
<label>Group Name:</label>
|
||||
<input type="text" name="group_name" required><br>
|
||||
<label>Select Players:</label><br>
|
||||
{% for player in players %}
|
||||
<input type="checkbox" name="players" value="{{ player.id }}">
|
||||
{{ player.username }}<br>
|
||||
{% endfor %}
|
||||
<button type="submit">Create Group</button>
|
||||
</form>
|
||||
<a href="{{ url_for('dashboard') }}">Back to Dashboard</a>
|
||||
<div class="container py-5">
|
||||
<h1 class="text-center mb-4">Add Group</h1>
|
||||
<form action="{{ url_for('add_group') }}" method="post">
|
||||
<div class="mb-3">
|
||||
<label for="name" class="form-label">Group Name</label>
|
||||
<input type="text" class="form-control" id="name" name="name" required>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="players" class="form-label">Select Players</label><br>
|
||||
{% for player in players %}
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="checkbox" name="players" value="{{ player.id }}" id="player{{ player.id }}">
|
||||
<label class="form-check-label" for="player{{ player.id }}">
|
||||
{{ player.username }}
|
||||
</label>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary">Create Group</button>
|
||||
</form>
|
||||
<a href="{{ url_for('dashboard') }}" class="btn btn-secondary mt-3">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>
|
||||
|
||||
@@ -2,20 +2,32 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>Add Player</title>
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha3/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
</head>
|
||||
<body>
|
||||
<h1>Add Player</h1>
|
||||
<form method="POST">
|
||||
<label>Username:</label>
|
||||
<input type="text" name="username" required><br>
|
||||
<label>Hostname:</label>
|
||||
<input type="text" name="hostname" required><br>
|
||||
<label>IP:</label>
|
||||
<input type="text" name="ip" required><br>
|
||||
<label>Password:</label>
|
||||
<input type="password" name="password" required><br>
|
||||
<button type="submit">Add Player</button>
|
||||
</form>
|
||||
<a href="{{ url_for('dashboard') }}">Back to Dashboard</a>
|
||||
<div class="container py-5">
|
||||
<h1 class="text-center mb-4">Add Player</h1>
|
||||
<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" id="username" name="username" required>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="hostname" class="form-label">Hostname</label>
|
||||
<input type="text" class="form-control" id="hostname" name="hostname" required>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="ip" class="form-label">IP Address</label>
|
||||
<input type="text" class="form-control" id="ip" name="ip" required>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="password" class="form-label">Password</label>
|
||||
<input type="password" class="form-control" id="password" name="password" required>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary">Add Player</button>
|
||||
</form>
|
||||
<a href="{{ url_for('dashboard') }}" class="btn btn-secondary mt-3">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>
|
||||
|
||||
@@ -28,6 +28,25 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Players in Group Section -->
|
||||
<div class="card mb-4">
|
||||
<div class="card-header bg-secondary text-white">
|
||||
<h2>Players in Group</h2>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<ul class="list-group">
|
||||
{% for player in group.players %}
|
||||
<li class="list-group-item d-flex justify-content-between align-items-center">
|
||||
<div>{{ player.username }} ({{ player.ip }})</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>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Upload Content Section -->
|
||||
<div class="card mb-4">
|
||||
<div class="card-header bg-success text-white">
|
||||
@@ -48,6 +67,33 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Manage Group Content Section -->
|
||||
<div class="card mb-4">
|
||||
<div class="card-header bg-warning text-dark">
|
||||
<h2>Manage Group Content</h2>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<ul class="list-group">
|
||||
{% for content in group.content %}
|
||||
<li class="list-group-item d-flex justify-content-between align-items-center">
|
||||
<div>{{ content.file_name }} - {{ content.duration }} seconds</div>
|
||||
<div>
|
||||
<!-- Edit Duration Form -->
|
||||
<form action="{{ url_for('edit_group_content', content_id=content.id) }}" method="post" class="d-inline">
|
||||
<input type="number" name="duration" value="{{ content.duration }}" class="form-control d-inline-block" style="width: 80px;" required>
|
||||
<button type="submit" class="btn btn-sm btn-warning">Edit</button>
|
||||
</form>
|
||||
<!-- Delete Content Form -->
|
||||
<form action="{{ url_for('delete_group_content', content_id=content.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 content?');">Delete</button>
|
||||
</form>
|
||||
</div>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<a href="{{ url_for('dashboard') }}" class="btn btn-secondary">Back to Dashboard</a>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -14,7 +14,12 @@
|
||||
<h4 class="text-center">Member of Group(s):</h4>
|
||||
<ul class="list-group">
|
||||
{% for group in player.groups %}
|
||||
<li class="list-group-item">{{ group.name }}</li>
|
||||
<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>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% else %}
|
||||
@@ -34,6 +39,7 @@
|
||||
<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">
|
||||
@@ -45,6 +51,7 @@
|
||||
<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>
|
||||
@@ -52,6 +59,7 @@
|
||||
</div>
|
||||
|
||||
<!-- Upload Section -->
|
||||
{% if not player.groups %}
|
||||
<div class="card mb-4">
|
||||
<div class="card-header bg-success text-white">
|
||||
<h2>Upload Content</h2>
|
||||
@@ -70,8 +78,10 @@
|
||||
</form>
|
||||
</div>
|
||||
</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>
|
||||
|
||||
Reference in New Issue
Block a user