fix: Refactor navbar styling in layout editor and update page title in layout designer

This commit is contained in:
Matt Batchelder
2026-04-10 20:32:49 -04:00
parent 8edcdedcd5
commit c4e26cc5b7
4 changed files with 20 additions and 16 deletions

View File

@@ -162,7 +162,6 @@ table tbody tr:focus-within {
.navbar-default { .navbar-default {
background: var(--ots-surface-2); background: var(--ots-surface-2);
border: 1px solid var(--ots-border); border: 1px solid var(--ots-border);
box-shadow: var(--ots-shadow-sm);
} }
/* Horizontal nav mode: remove sidebar margins from #content-wrapper */ /* Horizontal nav mode: remove sidebar margins from #content-wrapper */

View File

@@ -809,7 +809,18 @@ html, body, #page-wrapper, .ots-main, .ots-content, .page-content {
padding: 0 !important; padding: 0 !important;
} }
/* --- 14b. Hide the page behind the editor (body class set by JS) --------- */ /* --- 14b. Layout editor: reset OTS navbar styling so Xibo's bundled editor CSS
controls the top bar appearance unimpeded. -------------------------------- */
body.editor-opened .navbar,
body.editor-opened .navbar-default,
#layout-editor .navbar,
#layout-editor .navbar-default {
background: transparent !important;
border: none !important;
box-shadow: none !important;
}
/* --- 14c. Hide the page behind the editor (body class set by JS) --------- */
body.ots-playlist-editor-active .ots-sidebar { body.ots-playlist-editor-active .ots-sidebar {
visibility: hidden !important; visibility: hidden !important;
} }
@@ -4314,7 +4325,6 @@ body.ots-light-mode .ots-table-toolbar .btn-primary {
background-color: var(--color-primary) !important; background-color: var(--color-primary) !important;
border-color: var(--color-primary) !important; border-color: var(--color-primary) !important;
color: #ffffff !important; color: #ffffff !important;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
transition: all 0.15s ease !important; transition: all 0.15s ease !important;
} }
@@ -4322,7 +4332,6 @@ body.ots-light-mode .ots-table-toolbar .btn-primary {
#list_button:hover { #list_button:hover {
background-color: var(--color-primary-light) !important; background-color: var(--color-primary-light) !important;
border-color: var(--color-primary-light) !important; border-color: var(--color-primary-light) !important;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
transform: translateY(-1px); transform: translateY(-1px);
} }
@@ -4344,39 +4353,33 @@ body.ots-light-mode .ots-table-toolbar .btn-primary {
background-color: #10b981 !important; background-color: #10b981 !important;
border-color: #10b981 !important; border-color: #10b981 !important;
color: #ffffff !important; color: #ffffff !important;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
} }
.ots-table-toolbar .btn-success:hover { .ots-table-toolbar .btn-success:hover {
background-color: #059669 !important; background-color: #059669 !important;
border-color: #059669 !important; border-color: #059669 !important;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
} }
.ots-table-toolbar .btn-primary { .ots-table-toolbar .btn-primary {
background-color: var(--ots-primary) !important; background-color: var(--ots-primary) !important;
border-color: var(--ots-primary) !important; border-color: var(--ots-primary) !important;
color: #ffffff !important; color: #ffffff !important;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
} }
.ots-table-toolbar .btn-primary:hover { .ots-table-toolbar .btn-primary:hover {
background-color: var(--ots-primary) !important; background-color: var(--ots-primary) !important;
border-color: var(--ots-primary) !important; border-color: var(--ots-primary) !important;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
} }
.ots-table-toolbar .btn-warning { .ots-table-toolbar .btn-warning {
background-color: #f59e0b !important; background-color: #f59e0b !important;
border-color: #f59e0b !important; border-color: #f59e0b !important;
color: #ffffff !important; color: #ffffff !important;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
} }
.ots-table-toolbar .btn-warning:hover { .ots-table-toolbar .btn-warning:hover {
background-color: #d97706 !important; background-color: #d97706 !important;
border-color: #d97706 !important; border-color: #d97706 !important;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
} }
.ots-table-card .dataTables_wrapper, .ots-table-card .dataTables_wrapper,
@@ -4747,7 +4750,6 @@ body.ots-light-mode .ots-displays-page #datatable-container .XiboData table.data
.media-item:hover { .media-item:hover {
border-color: var(--color-primary); border-color: var(--color-primary);
box-shadow: 0 4px 12px rgba(var(--ots-primary-rgb), 0.2);
transform: translateY(-4px); transform: translateY(-4px);
} }
@@ -4880,7 +4882,6 @@ body.ots-light-mode .ots-displays-page #datatable-container .XiboData table.data
background-color: rgba(var(--ots-primary-rgb), 0.12) !important; background-color: rgba(var(--ots-primary-rgb), 0.12) !important;
border-color: rgba(var(--ots-primary-rgb), 0.3) !important; border-color: rgba(var(--ots-primary-rgb), 0.3) !important;
color: var(--color-primary-light) !important; color: var(--color-primary-light) !important;
box-shadow: 0 2px 8px rgba(var(--ots-primary-rgb), 0.1) !important;
} }
.btn-icon:active { .btn-icon:active {
@@ -4905,7 +4906,6 @@ body.ots-light-mode .ots-displays-page #datatable-container .XiboData table.data
.btn-icon.btn-success:hover { .btn-icon.btn-success:hover {
background-color: rgba(34, 197, 94, 0.15) !important; background-color: rgba(34, 197, 94, 0.15) !important;
border-color: rgba(34, 197, 94, 0.4) !important; border-color: rgba(34, 197, 94, 0.4) !important;
box-shadow: 0 2px 8px rgba(34, 197, 94, 0.1) !important;
} }
/* ============================================================================ /* ============================================================================

View File

@@ -175,8 +175,13 @@
credentials: "include" // sends the CMS session cookie; follow redirects (default) credentials: "include" // sends the CMS session cookie; follow redirects (default)
}) })
.then(function (response) { .then(function (response) {
// If the browser ended up on the login page, the session is not authenticated var finalUrl = response.url || "";
if (!response.url || response.url.indexOf("/login") !== -1) { // Not authenticated if redirected outside the CMS base path (e.g. to a SAML IdP
// at /auth/… the same origin) or to a known CMS auth page (/login, /saml/…).
var expectedBase = window.location.origin + cmsBase;
var isOffBase = cmsBase !== "" && !finalUrl.startsWith(expectedBase);
var isAuthPage = finalUrl.indexOf("/login") !== -1 || finalUrl.indexOf("/saml") !== -1;
if (!finalUrl || isOffBase || isAuthPage) {
throw new Error("unauthenticated"); throw new Error("unauthenticated");
} }
return response; return response;

View File

@@ -34,7 +34,7 @@
{% extends "authed.twig" %} {% extends "authed.twig" %}
{% import "inline.twig" as inline %} {% import "inline.twig" as inline %}
{% block title %}{{ "Layout Editor"|trans }} | {% endblock %} {% block title %}{{ layout.layout }} | {{ "Layout Designer"|trans }} | {% endblock %}
{% set hideNavigation = "1" %} {% set hideNavigation = "1" %}
{% set forceHide = true %} {% set forceHide = true %}