diff --git a/APP/src/app/features/meal-attendance/pages/attendance-counter-page/attendance-counter-page.component.html b/APP/src/app/features/meal-attendance/pages/attendance-counter-page/attendance-counter-page.component.html index cded19a..a607239 100644 --- a/APP/src/app/features/meal-attendance/pages/attendance-counter-page/attendance-counter-page.component.html +++ b/APP/src/app/features/meal-attendance/pages/attendance-counter-page/attendance-counter-page.component.html @@ -10,6 +10,9 @@ {{ connected ? 'Live · 即時連線中' : 'Connecting… · 連線中' }} +
+ View only · 唯讀 — counting opens on Sunday · 主日開放計數 +
@@ -22,17 +25,19 @@
diff --git a/APP/src/app/features/meal-attendance/pages/attendance-counter-page/attendance-counter-page.component.scss b/APP/src/app/features/meal-attendance/pages/attendance-counter-page/attendance-counter-page.component.scss index d71460e..b57724d 100644 --- a/APP/src/app/features/meal-attendance/pages/attendance-counter-page/attendance-counter-page.component.scss +++ b/APP/src/app/features/meal-attendance/pages/attendance-counter-page/attendance-counter-page.component.scss @@ -79,6 +79,19 @@ } } +/* Shown only when it's not the worship day — the page is view-only. */ +.ac__readonly { + margin-top: 0.65rem; + display: inline-block; + padding: 0.4rem 0.85rem; + border-radius: 999px; + font-size: 0.78rem; + font-weight: 600; + color: #fbbf24; + background: rgba(251, 191, 36, 0.12); + border: 1px solid rgba(251, 191, 36, 0.3); +} + /* ── Counter rows ──────────────────────────────────────────────────────── */ .ac__rows { display: flex; @@ -171,6 +184,7 @@ -webkit-text-fill-color: transparent; &:active { transform: scale(0.94); } + &:disabled { cursor: default; } &[data-key='adult'] { background-image: linear-gradient(135deg, #38bdf8, #6366f1); } &[data-key='youth'] { background-image: linear-gradient(135deg, #34d399, #14b8a6); } diff --git a/APP/src/app/features/meal-attendance/pages/attendance-counter-page/attendance-counter-page.component.ts b/APP/src/app/features/meal-attendance/pages/attendance-counter-page/attendance-counter-page.component.ts index 094bce6..8368389 100644 --- a/APP/src/app/features/meal-attendance/pages/attendance-counter-page/attendance-counter-page.component.ts +++ b/APP/src/app/features/meal-attendance/pages/attendance-counter-page/attendance-counter-page.component.ts @@ -26,6 +26,13 @@ export class AttendanceCounterPageComponent implements OnInit, OnDestroy { */ readonly worshipSunday = this.currentWeekSunday(); + /** + * Counting is only allowed on the worship day itself. On any other day the page + * is read-only so volunteers can review the latest count without changing it. + * getDay() returns 0 on Sunday. + */ + readonly isSunday = new Date().getDay() === 0; + /** The Sunday that opens the week containing today. */ private currentWeekSunday(): Date { const now = new Date(); @@ -111,6 +118,9 @@ export class AttendanceCounterPageComponent implements OnInit, OnDestroy { /** Optimistic +/-: update the screen instantly, debounce the write to the DB. */ bump(key: AttendanceCategory, step: number): void { + if (!this.isSunday) { + return; // read-only outside the worship day + } if (this.local[key] + step < 0) { return; // never count below zero } @@ -121,6 +131,9 @@ export class AttendanceCounterPageComponent implements OnInit, OnDestroy { /** Open the direct-entry dialog for a row, pre-filled with the current count. */ openEditor(row: CounterRow): void { + if (!this.isSunday) { + return; // read-only outside the worship day + } this.editing = row; this.editValue = this.local[row.key]; } diff --git a/APP/src/assets/AppLogo.png b/APP/src/assets/AppLogo.png new file mode 100644 index 0000000..fe0928f Binary files /dev/null and b/APP/src/assets/AppLogo.png differ diff --git a/APP/src/assets/AppLogo.svg b/APP/src/assets/AppLogo.svg new file mode 100644 index 0000000..44b41e8 --- /dev/null +++ b/APP/src/assets/AppLogo.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/APP/src/index.html b/APP/src/index.html index bf3b33c..f614947 100644 --- a/APP/src/index.html +++ b/APP/src/index.html @@ -6,7 +6,9 @@ ROLCC AC - + + +