Release 1.6.1
This commit is contained in:
@@ -104,13 +104,6 @@
|
||||
data-current-transition="{{ d.transition or 'none' }}"
|
||||
data-current-show-overlay="{{ '1' if d.show_overlay else '0' }}"
|
||||
data-current-ticker-enabled="{{ '1' if d.ticker_enabled else '0' }}"
|
||||
data-current-ticker-rss-url="{{ d.ticker_rss_url or '' }}"
|
||||
data-current-ticker-color="{{ d.ticker_color or '' }}"
|
||||
data-current-ticker-bg-color="{{ d.ticker_bg_color or '' }}"
|
||||
data-current-ticker-bg-opacity="{{ d.ticker_bg_opacity or '' }}"
|
||||
data-current-ticker-font-family="{{ d.ticker_font_family or '' }}"
|
||||
data-current-ticker-font-size-px="{{ d.ticker_font_size_px or '' }}"
|
||||
data-current-ticker-speed="{{ d.ticker_speed or '' }}"
|
||||
data-legacy-playlist-id="{{ d.assigned_playlist_id or '' }}"
|
||||
data-active-playlist-ids="{{ d.display_playlists | map(attribute='playlist_id') | list | join(',') }}"
|
||||
>
|
||||
@@ -179,61 +172,13 @@
|
||||
<div class="form-text">If your company has an overlay uploaded, it will be displayed on top of the content.</div>
|
||||
</div>
|
||||
|
||||
<div class="card" style="border: 1px solid rgba(0,0,0,0.10);">
|
||||
<div class="card-body">
|
||||
<div class="d-flex justify-content-between align-items-center">
|
||||
<div>
|
||||
<div class="fw-bold">Ticker tape</div>
|
||||
<div class="text-muted small">Scroll RSS headlines at the bottom of the display.</div>
|
||||
</div>
|
||||
<div class="form-check form-switch">
|
||||
<input class="form-check-input" type="checkbox" id="editTickerEnabled" />
|
||||
<label class="form-check-label" for="editTickerEnabled">Enabled</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mt-3">
|
||||
<label class="form-label" for="editTickerRssUrl">RSS feed URL</label>
|
||||
<input class="form-control" id="editTickerRssUrl" type="url" placeholder="https://example.com/feed.xml" />
|
||||
<div class="form-text">Tip: use a public RSS/Atom feed. Headlines are fetched server-side.</div>
|
||||
</div>
|
||||
|
||||
<div class="row g-2 mt-2">
|
||||
<div class="col-12 col-md-5">
|
||||
<label class="form-label" for="editTickerColor">Text color</label>
|
||||
<input class="form-control form-control-color" id="editTickerColor" type="color" value="#ffffff" title="Choose text color" />
|
||||
</div>
|
||||
<div class="col-12 col-md-5">
|
||||
<label class="form-label" for="editTickerFontSize">Font size (px)</label>
|
||||
<input class="form-control" id="editTickerFontSize" type="number" min="10" max="200" step="1" placeholder="28" />
|
||||
</div>
|
||||
<div class="col-12 col-md-7">
|
||||
<label class="form-label" for="editTickerFontFamily">Font</label>
|
||||
<select class="form-select" id="editTickerFontFamily">
|
||||
<option value="system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif">System (default)</option>
|
||||
<option value="Arial, Helvetica, sans-serif">Arial</option>
|
||||
<option value="Segoe UI, Arial, sans-serif">Segoe UI</option>
|
||||
<option value="Roboto, Arial, sans-serif">Roboto</option>
|
||||
<option value="Georgia, serif">Georgia</option>
|
||||
<option value="Times New Roman, Times, serif">Times New Roman</option>
|
||||
<option value="ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace">Monospace</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-12 col-md-7">
|
||||
<label class="form-label" for="editTickerBgColor">Background color</label>
|
||||
<input class="form-control form-control-color" id="editTickerBgColor" type="color" value="#000000" title="Choose background color" />
|
||||
</div>
|
||||
<div class="col-12 col-md-5">
|
||||
<label class="form-label" for="editTickerBgOpacity">Background opacity</label>
|
||||
<input class="form-range" id="editTickerBgOpacity" type="range" min="0" max="100" step="1" />
|
||||
<div class="form-text"><span id="editTickerBgOpacityLabel">75</span>%</div>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<label class="form-label" for="editTickerSpeed">Speed</label>
|
||||
<input class="form-range" id="editTickerSpeed" type="range" min="1" max="100" step="1" />
|
||||
<div class="form-text">Slower ⟷ Faster</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-check form-switch mb-2">
|
||||
<input class="form-check-input" type="checkbox" id="editTickerEnabled" />
|
||||
<label class="form-check-label" for="editTickerEnabled">
|
||||
Enable ticker tape on this display
|
||||
</label>
|
||||
<div class="form-text">
|
||||
RSS feed + styling is configured in <a href="{{ url_for('company.my_company') }}">My Company</a>.
|
||||
</div>
|
||||
</div>
|
||||
<hr class="my-3" />
|
||||
@@ -382,31 +327,9 @@
|
||||
const plTransitionEl = document.getElementById('editPlaylistsTransitionSelect');
|
||||
const plShowOverlayEl = document.getElementById('editPlaylistsShowOverlayCheck');
|
||||
const tickerEnabledEl = document.getElementById('editTickerEnabled');
|
||||
const tickerRssUrlEl = document.getElementById('editTickerRssUrl');
|
||||
const tickerColorEl = document.getElementById('editTickerColor');
|
||||
const tickerBgColorEl = document.getElementById('editTickerBgColor');
|
||||
const tickerBgOpacityEl = document.getElementById('editTickerBgOpacity');
|
||||
const tickerBgOpacityLabelEl = document.getElementById('editTickerBgOpacityLabel');
|
||||
const tickerFontFamilyEl = document.getElementById('editTickerFontFamily');
|
||||
const tickerFontSizeEl = document.getElementById('editTickerFontSize');
|
||||
const tickerSpeedEl = document.getElementById('editTickerSpeed');
|
||||
let activePlDisplayId = null;
|
||||
let activePlButton = null;
|
||||
|
||||
function setRangeValue(rangeEl, labelEl, value, fallback) {
|
||||
if (!rangeEl) return;
|
||||
const n = parseInt(value || '', 10);
|
||||
const v = Number.isFinite(n) ? n : fallback;
|
||||
rangeEl.value = String(v);
|
||||
if (labelEl) labelEl.textContent = String(v);
|
||||
}
|
||||
|
||||
function onOpacityInput() {
|
||||
if (!tickerBgOpacityEl || !tickerBgOpacityLabelEl) return;
|
||||
tickerBgOpacityLabelEl.textContent = String(tickerBgOpacityEl.value || '0');
|
||||
}
|
||||
if (tickerBgOpacityEl) tickerBgOpacityEl.addEventListener('input', onOpacityInput);
|
||||
|
||||
function updatePlDescCount() {
|
||||
if (!plDescInputEl || !plDescCountEl) return;
|
||||
plDescCountEl.textContent = String((plDescInputEl.value || '').length);
|
||||
@@ -477,14 +400,6 @@
|
||||
const raw = (btn.dataset.currentTickerEnabled || '').toLowerCase();
|
||||
tickerEnabledEl.checked = raw === '1' || raw === 'true' || raw === 'yes' || raw === 'on';
|
||||
}
|
||||
if (tickerRssUrlEl) tickerRssUrlEl.value = btn.dataset.currentTickerRssUrl || '';
|
||||
if (tickerColorEl) tickerColorEl.value = btn.dataset.currentTickerColor || '#ffffff';
|
||||
if (tickerBgColorEl) tickerBgColorEl.value = btn.dataset.currentTickerBgColor || '#000000';
|
||||
setRangeValue(tickerBgOpacityEl, tickerBgOpacityLabelEl, btn.dataset.currentTickerBgOpacity, 75);
|
||||
onOpacityInput();
|
||||
if (tickerFontFamilyEl) tickerFontFamilyEl.value = btn.dataset.currentTickerFontFamily || 'system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif';
|
||||
if (tickerFontSizeEl) tickerFontSizeEl.value = btn.dataset.currentTickerFontSizePx || '';
|
||||
setRangeValue(tickerSpeedEl, null, btn.dataset.currentTickerSpeed, 25);
|
||||
|
||||
const selected = computeActiveIdsFromDataset(btn);
|
||||
renderPlaylistCheckboxes(selected);
|
||||
@@ -502,13 +417,6 @@
|
||||
const transition = plTransitionEl ? (plTransitionEl.value || 'none') : 'none';
|
||||
const showOverlay = plShowOverlayEl ? !!plShowOverlayEl.checked : false;
|
||||
const tickerEnabled = tickerEnabledEl ? !!tickerEnabledEl.checked : false;
|
||||
const tickerRssUrl = tickerRssUrlEl ? (tickerRssUrlEl.value || '').trim() : '';
|
||||
const tickerColor = tickerColorEl ? (tickerColorEl.value || '').trim() : '';
|
||||
const tickerBgColor = tickerBgColorEl ? (tickerBgColorEl.value || '').trim() : '';
|
||||
const tickerBgOpacity = tickerBgOpacityEl ? (tickerBgOpacityEl.value || '').trim() : '';
|
||||
const tickerFontFamily = tickerFontFamilyEl ? (tickerFontFamilyEl.value || '').trim() : '';
|
||||
const tickerFontSizePx = tickerFontSizeEl ? (tickerFontSizeEl.value || '').trim() : '';
|
||||
const tickerSpeed = tickerSpeedEl ? (tickerSpeedEl.value || '').trim() : '';
|
||||
plSaveBtn.disabled = true;
|
||||
try {
|
||||
const [updatedPlaylists, updatedDesc] = await Promise.all([
|
||||
@@ -517,14 +425,7 @@
|
||||
description: desc,
|
||||
transition,
|
||||
show_overlay: showOverlay,
|
||||
ticker_enabled: tickerEnabled,
|
||||
ticker_rss_url: tickerRssUrl,
|
||||
ticker_color: tickerColor,
|
||||
ticker_bg_color: tickerBgColor,
|
||||
ticker_bg_opacity: tickerBgOpacity,
|
||||
ticker_font_family: tickerFontFamily,
|
||||
ticker_font_size_px: tickerFontSizePx,
|
||||
ticker_speed: tickerSpeed
|
||||
ticker_enabled: tickerEnabled
|
||||
})
|
||||
]);
|
||||
|
||||
@@ -553,34 +454,6 @@
|
||||
: tickerEnabled;
|
||||
activePlButton.dataset.currentTickerEnabled = newTickerEnabled ? '1' : '0';
|
||||
|
||||
activePlButton.dataset.currentTickerRssUrl = (updatedDesc && typeof updatedDesc.ticker_rss_url === 'string')
|
||||
? (updatedDesc.ticker_rss_url || '')
|
||||
: tickerRssUrl;
|
||||
|
||||
activePlButton.dataset.currentTickerColor = (updatedDesc && typeof updatedDesc.ticker_color === 'string')
|
||||
? (updatedDesc.ticker_color || '')
|
||||
: tickerColor;
|
||||
|
||||
activePlButton.dataset.currentTickerBgColor = (updatedDesc && typeof updatedDesc.ticker_bg_color === 'string')
|
||||
? (updatedDesc.ticker_bg_color || '')
|
||||
: tickerBgColor;
|
||||
|
||||
activePlButton.dataset.currentTickerBgOpacity = (updatedDesc && (typeof updatedDesc.ticker_bg_opacity === 'number' || typeof updatedDesc.ticker_bg_opacity === 'string'))
|
||||
? String(updatedDesc.ticker_bg_opacity || '')
|
||||
: String(tickerBgOpacity || '');
|
||||
|
||||
activePlButton.dataset.currentTickerFontFamily = (updatedDesc && typeof updatedDesc.ticker_font_family === 'string')
|
||||
? (updatedDesc.ticker_font_family || '')
|
||||
: tickerFontFamily;
|
||||
|
||||
activePlButton.dataset.currentTickerFontSizePx = (updatedDesc && (typeof updatedDesc.ticker_font_size_px === 'number' || typeof updatedDesc.ticker_font_size_px === 'string'))
|
||||
? String(updatedDesc.ticker_font_size_px || '')
|
||||
: String(tickerFontSizePx || '');
|
||||
|
||||
activePlButton.dataset.currentTickerSpeed = (updatedDesc && (typeof updatedDesc.ticker_speed === 'number' || typeof updatedDesc.ticker_speed === 'string'))
|
||||
? String(updatedDesc.ticker_speed || '')
|
||||
: String(tickerSpeed || '');
|
||||
|
||||
showToast('Display updated', 'text-bg-success');
|
||||
refreshPreviewIframe(activePlDisplayId);
|
||||
if (plModal) plModal.hide();
|
||||
|
||||
@@ -184,4 +184,131 @@
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card card-elevated mt-4">
|
||||
<div class="card-header">
|
||||
<h2 class="h5 mb-0">Ticker tape (RSS)</h2>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="text-muted small mb-3">
|
||||
Configure the RSS feed and styling for the ticker tape. Individual displays can enable/disable the ticker from the Dashboard.
|
||||
</div>
|
||||
|
||||
<form method="post" action="{{ url_for('company.update_company_ticker_settings') }}" class="d-flex flex-column gap-3">
|
||||
<div>
|
||||
<label class="form-label" for="companyTickerRssUrl">RSS feed URL</label>
|
||||
<input
|
||||
class="form-control"
|
||||
id="companyTickerRssUrl"
|
||||
name="ticker_rss_url"
|
||||
type="url"
|
||||
value="{{ company.ticker_rss_url or '' }}"
|
||||
placeholder="https://example.com/feed.xml"
|
||||
/>
|
||||
<div class="form-text">Leave empty to disable headlines (even if displays have ticker enabled).</div>
|
||||
</div>
|
||||
|
||||
<div class="row g-2">
|
||||
<div class="col-12 col-md-4">
|
||||
<label class="form-label" for="companyTickerColor">Text color</label>
|
||||
<input
|
||||
class="form-control form-control-color"
|
||||
id="companyTickerColor"
|
||||
name="ticker_color"
|
||||
type="color"
|
||||
value="{{ company.ticker_color or '#ffffff' }}"
|
||||
title="Choose text color"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-12 col-md-4">
|
||||
<label class="form-label" for="companyTickerBgColor">Background color</label>
|
||||
<input
|
||||
class="form-control form-control-color"
|
||||
id="companyTickerBgColor"
|
||||
name="ticker_bg_color"
|
||||
type="color"
|
||||
value="{{ company.ticker_bg_color or '#000000' }}"
|
||||
title="Choose background color"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-12 col-md-4">
|
||||
<label class="form-label" for="companyTickerBgOpacity">Background opacity</label>
|
||||
<input
|
||||
class="form-range"
|
||||
id="companyTickerBgOpacity"
|
||||
name="ticker_bg_opacity"
|
||||
type="range"
|
||||
min="0"
|
||||
max="100"
|
||||
step="1"
|
||||
value="{{ company.ticker_bg_opacity if company.ticker_bg_opacity is not none else 75 }}"
|
||||
/>
|
||||
<div class="form-text"><span id="companyTickerBgOpacityLabel">{{ company.ticker_bg_opacity if company.ticker_bg_opacity is not none else 75 }}</span>%</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row g-2">
|
||||
<div class="col-12 col-md-6">
|
||||
<label class="form-label" for="companyTickerFontFamily">Font</label>
|
||||
<select class="form-select" id="companyTickerFontFamily" name="ticker_font_family">
|
||||
{% set ff = company.ticker_font_family or 'system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif' %}
|
||||
<option value="system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif" {{ 'selected' if ff == 'system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif' else '' }}>System (default)</option>
|
||||
<option value="Arial, Helvetica, sans-serif" {{ 'selected' if ff == 'Arial, Helvetica, sans-serif' else '' }}>Arial</option>
|
||||
<option value="Segoe UI, Arial, sans-serif" {{ 'selected' if ff == 'Segoe UI, Arial, sans-serif' else '' }}>Segoe UI</option>
|
||||
<option value="Roboto, Arial, sans-serif" {{ 'selected' if ff == 'Roboto, Arial, sans-serif' else '' }}>Roboto</option>
|
||||
<option value="Georgia, serif" {{ 'selected' if ff == 'Georgia, serif' else '' }}>Georgia</option>
|
||||
<option value="Times New Roman, Times, serif" {{ 'selected' if ff == 'Times New Roman, Times, serif' else '' }}>Times New Roman</option>
|
||||
<option value="ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, Courier New, monospace" {{ 'selected' if ff == 'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, Courier New, monospace' else '' }}>Monospace</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-12 col-md-3">
|
||||
<label class="form-label" for="companyTickerFontSize">Font size (px)</label>
|
||||
<input
|
||||
class="form-control"
|
||||
id="companyTickerFontSize"
|
||||
name="ticker_font_size_px"
|
||||
type="number"
|
||||
min="10"
|
||||
max="200"
|
||||
step="1"
|
||||
value="{{ company.ticker_font_size_px if company.ticker_font_size_px is not none else 28 }}"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-12 col-md-3">
|
||||
<label class="form-label" for="companyTickerSpeed">Speed</label>
|
||||
<input
|
||||
class="form-range"
|
||||
id="companyTickerSpeed"
|
||||
name="ticker_speed"
|
||||
type="range"
|
||||
min="1"
|
||||
max="100"
|
||||
step="1"
|
||||
value="{{ company.ticker_speed if company.ticker_speed is not none else 25 }}"
|
||||
/>
|
||||
<div class="form-text">Slower ⟷ Faster</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<button class="btn btn-brand" type="submit">Save ticker settings</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block page_scripts %}
|
||||
<script>
|
||||
(function () {
|
||||
const opacityEl = document.getElementById('companyTickerBgOpacity');
|
||||
const opacityLabelEl = document.getElementById('companyTickerBgOpacityLabel');
|
||||
function syncOpacity() {
|
||||
if (!opacityEl || !opacityLabelEl) return;
|
||||
opacityLabelEl.textContent = String(opacityEl.value || '0');
|
||||
}
|
||||
if (opacityEl) opacityEl.addEventListener('input', syncOpacity);
|
||||
syncOpacity();
|
||||
})();
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
||||
Reference in New Issue
Block a user