style: enhance layout and functionality of duty markers and calendar
- Updated CSS for `.day` and `.access-denied` to improve layout and visual consistency. - Introduced a new function `dutyOverlapsLocalRange` in `dateUtils.js` to check duty overlaps within a specified date range. - Refactored `dutyItemHtml` in `dutyList.js` to utilize `formatTimeLocal` for time formatting, enhancing readability. - Added utility functions in `hints.js` for parsing duty marker data and building time prefixes, streamlining hint rendering logic. - Improved the `showAccessDenied` function in `ui.js` to display detailed server messages when access is denied.
This commit is contained in:
@@ -16,7 +16,7 @@ import {
|
||||
|
||||
/**
|
||||
* Show access-denied view and hide calendar/list/loading/error.
|
||||
* @param {string} [serverDetail] - message from API 403 detail (unused; kept for callers)
|
||||
* @param {string} [serverDetail] - message from API 403 detail (shown below main text when present)
|
||||
*/
|
||||
export function showAccessDenied(serverDetail) {
|
||||
if (headerEl) headerEl.hidden = true;
|
||||
@@ -25,7 +25,16 @@ export function showAccessDenied(serverDetail) {
|
||||
if (dutyListEl) dutyListEl.hidden = true;
|
||||
if (loadingEl) loadingEl.classList.add("hidden");
|
||||
if (errorEl) errorEl.hidden = true;
|
||||
if (accessDeniedEl) accessDeniedEl.hidden = false;
|
||||
if (accessDeniedEl) {
|
||||
accessDeniedEl.innerHTML = "<p>Доступ запрещён.</p>";
|
||||
if (serverDetail && serverDetail.trim()) {
|
||||
const detail = document.createElement("p");
|
||||
detail.className = "access-denied-detail";
|
||||
detail.textContent = serverDetail;
|
||||
accessDeniedEl.appendChild(detail);
|
||||
}
|
||||
accessDeniedEl.hidden = false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user