edited230126
This commit is contained in:
@@ -27,10 +27,6 @@
|
||||
<div class="col-md-6">
|
||||
<h2 class="h5">Users</h2>
|
||||
<form method="post" action="{{ url_for('admin.create_company_user', company_id=company.id) }}" class="card card-body mb-3">
|
||||
<div class="mb-2">
|
||||
<label class="form-label">Username</label>
|
||||
<input class="form-control" name="username" required />
|
||||
</div>
|
||||
<div class="mb-2">
|
||||
<label class="form-label">Email</label>
|
||||
<input class="form-control" type="email" name="email" required />
|
||||
@@ -46,7 +42,7 @@
|
||||
{% for u in company.users %}
|
||||
<div class="list-group-item d-flex justify-content-between align-items-center">
|
||||
<div>
|
||||
<strong>{{ u.username }}</strong>
|
||||
<strong>{{ u.email or "(no email)" }}</strong>
|
||||
<div class="text-muted">{{ u.email or "(no email set)" }}</div>
|
||||
</div>
|
||||
<div class="d-flex align-items-center gap-2">
|
||||
@@ -79,7 +75,17 @@
|
||||
<div class="list-group-item">
|
||||
<div class="d-flex justify-content-between">
|
||||
<div>
|
||||
<strong>{{ d.name }}</strong>
|
||||
<form method="post" action="{{ url_for('admin.update_display_name', display_id=d.id) }}" class="d-flex gap-2 align-items-center">
|
||||
<input
|
||||
class="form-control form-control-sm"
|
||||
style="max-width: 260px"
|
||||
name="name"
|
||||
value="{{ d.name }}"
|
||||
required
|
||||
maxlength="120"
|
||||
/>
|
||||
<button class="btn btn-outline-primary btn-sm" type="submit">Save</button>
|
||||
</form>
|
||||
<div class="text-muted monospace">Token: {{ d.token }}</div>
|
||||
<div class="text-muted">Player URL: <a href="{{ url_for('display.display_player', token=d.token) }}" target="_blank">{{ url_for('display.display_player', token=d.token, _external=true) }}</a></div>
|
||||
</div>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
</div>
|
||||
|
||||
<div class="row mt-4">
|
||||
<div class="col-md-6">
|
||||
<div class="col-md-12">
|
||||
<h2 class="h5">Companies</h2>
|
||||
<form method="post" action="{{ url_for('admin.create_company') }}" class="card card-body mb-3">
|
||||
<div class="input-group">
|
||||
@@ -25,30 +25,5 @@
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
<h2 class="h5">Users</h2>
|
||||
<div class="list-group">
|
||||
{% for u in users %}
|
||||
<div class="list-group-item d-flex justify-content-between align-items-center">
|
||||
<div>
|
||||
<div><strong>{{ u.username }}</strong> {% if u.is_admin %}<span class="badge bg-dark">admin</span>{% endif %}</div>
|
||||
<div class="text-muted">
|
||||
{% if u.company %}Company: {{ u.company.name }}{% else %}No company{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
{% if not u.is_admin %}
|
||||
<form method="post" action="{{ url_for('admin.impersonate', user_id=u.id) }}">
|
||||
<button class="btn btn-warning btn-sm" type="submit">Impersonate</button>
|
||||
</form>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="text-muted">No users yet.</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
<h1 class="h3 mb-3">Login</h1>
|
||||
<form method="post" class="card card-body">
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Username</label>
|
||||
<input class="form-control" name="username" autocomplete="username" required />
|
||||
<label class="form-label">Email</label>
|
||||
<input class="form-control" type="email" name="email" autocomplete="email" required />
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Password</label>
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
</ul>
|
||||
<ul class="navbar-nav ms-auto">
|
||||
{% if current_user.is_authenticated %}
|
||||
<li class="nav-item"><span class="navbar-text me-3">Logged in as <strong>{{ current_user.username }}</strong></span></li>
|
||||
<li class="nav-item"><span class="navbar-text me-3">Logged in as <strong>{{ current_user.email }}</strong></span></li>
|
||||
<li class="nav-item"><a class="btn btn-outline-light btn-sm me-2" href="{{ url_for('auth.change_password') }}">Change password</a></li>
|
||||
{% if session.get('impersonator_admin_id') %}
|
||||
<li class="nav-item"><a class="btn btn-warning btn-sm me-2" href="{{ url_for('auth.stop_impersonation') }}">Stop impersonation</a></li>
|
||||
|
||||
@@ -38,17 +38,29 @@
|
||||
<div class="d-flex justify-content-between align-items-center">
|
||||
<div>
|
||||
<div><strong>{{ d.name }}</strong></div>
|
||||
<div class="text-muted">Player URL: <a href="{{ url_for('display.display_player', token=d.token, _external=true) }}" target="_blank">open</a></div>
|
||||
{% if d.description %}
|
||||
<div class="text-muted">{{ d.description }}</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div style="min-width: 220px;">
|
||||
<form method="post" action="{{ url_for('company.assign_playlist', display_id=d.id) }}" class="d-flex gap-2">
|
||||
<select class="form-select form-select-sm" name="playlist_id">
|
||||
<option value="">(none)</option>
|
||||
{% for p in playlists %}
|
||||
<option value="{{ p.id }}" {% if d.assigned_playlist_id == p.id %}selected{% endif %}>{{ p.name }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
<button class="btn btn-primary btn-sm" type="submit">Assign</button>
|
||||
<form method="post" action="{{ url_for('company.update_display', display_id=d.id) }}" class="d-flex flex-column gap-2">
|
||||
<input
|
||||
class="form-control form-control-sm"
|
||||
name="description"
|
||||
placeholder="Description (e.g. entrance, office)"
|
||||
value="{{ d.description or '' }}"
|
||||
maxlength="200"
|
||||
/>
|
||||
|
||||
<div class="d-flex gap-2">
|
||||
<select class="form-select form-select-sm" name="playlist_id">
|
||||
<option value="">(none)</option>
|
||||
{% for p in playlists %}
|
||||
<option value="{{ p.id }}" {% if d.assigned_playlist_id == p.id %}selected{% endif %}>{{ p.name }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
<button class="btn btn-primary btn-sm" type="submit">Save</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -82,6 +82,18 @@
|
||||
el.src = item.url;
|
||||
stage.appendChild(el);
|
||||
timer = setTimeout(next, (item.duration || 10) * 1000);
|
||||
} else if (item.type === 'youtube') {
|
||||
const el = document.createElement('iframe');
|
||||
// item.url is a base embed URL produced server-side (https://www.youtube-nocookie.com/embed/<id>)
|
||||
// Add common playback params client-side.
|
||||
const u = item.url || '';
|
||||
const sep = u.includes('?') ? '&' : '?';
|
||||
el.src = `${u}${sep}autoplay=1&mute=1&controls=0&rel=0&playsinline=1`;
|
||||
stage.appendChild(el);
|
||||
|
||||
// YouTube iframes don't reliably emit an "ended" event without the JS API.
|
||||
// We keep it simple: play for the configured duration (default 30s).
|
||||
timer = setTimeout(next, (item.duration || 30) * 1000);
|
||||
} else {
|
||||
timer = setTimeout(next, 5000);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user