<% // Bottom-tab navigation — mobile-only (hidden ≥768px via CSS). // // Tabs: // logged-out: Home · Zoek · Inloggen (3 tabs) // logged-in: Home · Zoek · [Plus] · [Prutter] · Profiel // The Plus tab is a FAB-style center action (accent bg, slightly raised). // It only appears for users with create-post permission. // Prutter only appears when the site has DMs enabled. const _siteUrlBase = (typeof siteUrlBase !== 'undefined' && siteUrlBase) ? siteUrlBase : ''; const _path = (typeof currentPath !== 'undefined' && currentPath) ? currentPath : '/'; const _canPost = !!(user && (typeof canMutate === 'undefined' || canMutate) && permissions && permissions.canCreatePost && permissions.canCreatePost(user, site)); const _ownProfile = user ? ('/users/' + user.username) : null; const _isHub = (typeof tenancy !== 'undefined' && tenancy === 'hub'); // Home in hub mode ALWAYS goes to the hub root (/), not to an artist's sub-home. // In solo/circle _siteUrlBase is empty, so it stays '/'. const _homeHref = (_isHub ? '' : _siteUrlBase) + '/'; // Strip site prefix for cleaner matching function _normalize(p) { if (_siteUrlBase && p.indexOf(_siteUrlBase) === 0) return p.slice(_siteUrlBase.length) || '/'; return p; } const _p = _normalize(_path); let _active = null; // In hub, Home is only active on the real hub root, not on an artist sub-home. if (_isHub ? (_path === '/') : (_p === '/' || _p === '')) _active = 'home'; else if (_p.indexOf('/search') === 0 || _p.indexOf('/tag/') === 0 || _p.indexOf('/type/') === 0) _active = 'search'; else if (_p === '/posts/new' || /^\/posts\/[^/]+\/edit$/.test(_p)) _active = 'create'; else if (_p.indexOf('/account') === 0 || (_ownProfile && _p.indexOf(_ownProfile) === 0)) _active = 'profile'; else if (_p.indexOf('/auth/login') === 0) _active = 'login'; %>