Planner: Add event sits on the same row as the Calendar | Tasks switch
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
8d38584d37
commit
b8ab84a009
3 files changed
+9
-6
No files matched your search
+5
-4
@@ -6,10 +6,11 @@ function viewPlanner(args = []) {
|
||||
const want = args[0] && ok.includes(args[0]) ? args[0] : store.get('planner_pane', ok[0]);
|
||||
location.replace('#/' + (ok.includes(want) ? want : ok[0] || 'home'));
|
||||
}
|
||||
/** The page heading, with a Calendar | Tasks switch when this person may use both. */
|
||||
function plannerHead(active) {
|
||||
/** The page heading, with a Calendar | Tasks switch when this person may use both. `extra` (a button, say) sits on the same row, at the right. */
|
||||
function plannerHead(active, extra = '') {
|
||||
try { localStorage.setItem(nk('planner_pane'), JSON.stringify(active)); } catch {}
|
||||
const panes = PLANNER_PANES.filter(p => allowed(p[0]));
|
||||
if (panes.length < 2) return `<h1>${esc((PLANNER_PANES.find(p => p[0] === active) || [0, 'Planner'])[1])}</h1>`;
|
||||
return `<h1>Planner</h1><div class="seg" role="tablist" aria-label="Planner">${panes.map(([k, l]) => `<a href="#/${k}" role="tab" aria-selected="${k === active}" class="${k === active ? 'on' : ''}">${l}</a>`).join('')}</div>`;
|
||||
const seg = panes.length < 2 ? '' : `<div class="seg" role="tablist" aria-label="Planner">${panes.map(([k, l]) => `<a href="#/${k}" role="tab" aria-selected="${k === active}" class="${k === active ? 'on' : ''}">${l}</a>`).join('')}</div>`;
|
||||
const title = panes.length < 2 ? (PLANNER_PANES.find(p => p[0] === active) || [0, 'Planner'])[1] : 'Planner';
|
||||
return `<h1>${esc(title)}</h1>${seg || extra ? `<div class="prow">${seg}${extra}</div>` : ''}`;
|
||||
}
|
||||
Reference in new issue
Block a user