lots of changes

This commit is contained in:
2026-07-28 14:43:54 +03:30
parent b129d871c3
commit d94ba86953
13 changed files with 406 additions and 36 deletions
+2
View File
@@ -5,7 +5,9 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta name="color-scheme" content="light">
<meta name="theme-color" content="#285b48">
<title>{{.Title}} · Hamkar</title>
<link rel="icon" type="image/svg+xml" href="/static/favicon.svg">
<script src="/static/theme.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/Vazirmatn-font-face.css">
<link rel="stylesheet" href="/static/style.css">
+3 -3
View File
@@ -8,8 +8,8 @@
<div class="dashboard-grid">
<section class="card presence-card">
<div class="presence-top">
<div><p class="eyebrow">TODAYS PRESENCE</p><h2>{{if .Attendance}}{{if .Attendance.CheckOut.Valid}}Day complete{{else}}Youre checked in{{end}}{{else}}Ready when you are{{end}}</h2></div>
<span class="live-badge"><i></i> {{if and .Attendance (not .Attendance.CheckOut.Valid)}}ACTIVE{{else}}TODAY{{end}}</span>
<div><p class="eyebrow">TODAYS PRESENCE</p><h2>{{if .Attendance}}{{if .Attendance.CheckOut}}Day complete{{else}}Youre checked in{{end}}{{else}}Ready when you are{{end}}</h2></div>
<span class="live-badge"><i></i> {{if and .Attendance (not .Attendance.CheckOut)}}ACTIVE{{else}}TODAY{{end}}</span>
</div>
{{if .Attendance}}
<div class="time-line">
@@ -18,7 +18,7 @@
<div><small>CHECKED OUT</small><strong>{{timeHM .Attendance.CheckOut}}</strong></div>
<div><small>LOCATION</small><strong>{{if eq .Attendance.Mode "remote"}}Remote{{else}}Office{{end}}</strong></div>
</div>
{{if not .Attendance.CheckOut.Valid}}
{{if not .Attendance.CheckOut}}
<form method="post" action="/attendance/check-out">
<input type="hidden" name="csrf" value="{{.CSRF}}">
<button class="button dark full">Check out</button>
+66 -10
View File
@@ -1,18 +1,73 @@
{{define "day.html"}}
{{template "shell-start" .}}
<header class="page-head day-page-head">
<div><p class="eyebrow">TEAM DAY</p><h1>Whos working?</h1><p>See the teams presence, remote work, and absences for one day.</p></div>
<form method="get" action="/day" class="day-date-form">
<label>Persian date
<span class="jalali-field">
<input name="date" value="{{.Day.Jalali}}" data-jalali-picker required autocomplete="off" inputmode="numeric" pattern="[0-9]{4}-[0-9]{2}-[0-9]{2}">
<button type="button" class="jalali-trigger" aria-label="Choose team date" title="Open Persian calendar"></button>
</span>
</label>
<button class="button primary" type="submit">View day</button>
</form>
<div>
<p class="eyebrow">{{if .Week.Enabled}}TEAM WEEK{{else}}TEAM DAY{{end}}</p>
<h1>{{if .Week.Enabled}}Team schedule{{else}}Whos working?{{end}}</h1>
<p>{{if .Week.Enabled}}See everyones weekly office, remote, and absence plan.{{else}}See the teams presence, remote work, and absences for one day.{{end}}</p>
</div>
<div class="day-view-controls">
<nav class="view-switch" aria-label="Schedule view">
<a href="/day?date={{.Day.Jalali}}" class="{{if not .Week.Enabled}}active{{end}}">Day</a>
<a href="/day?date={{.Day.Jalali}}&view=week" class="{{if .Week.Enabled}}active{{end}}">Week</a>
</nav>
<form method="get" action="/day" class="day-date-form">
{{if .Week.Enabled}}<input type="hidden" name="view" value="week">{{end}}
<label>Persian date
<span class="jalali-field">
<input name="date" value="{{.Day.Jalali}}" data-jalali-picker required autocomplete="off" inputmode="numeric" pattern="[0-9]{4}-[0-9]{2}-[0-9]{2}">
<button type="button" class="jalali-trigger" aria-label="Choose team date" title="Open Persian calendar"></button>
</span>
</label>
<button class="button primary" type="submit">View</button>
</form>
</div>
</header>
{{template "notice" .}}
{{if .Week.Enabled}}
<div class="week-layout">
<section class="card week-calendar">
<header class="week-toolbar">
<div class="week-navigation">
<a href="/day?date={{.Week.Prev}}&view=week" aria-label="Previous week"></a>
<div><p class="eyebrow">SATURDAY — FRIDAY</p><h2>{{.Week.StartJalali}} — {{.Week.EndJalali}}</h2></div>
<a href="/day?date={{.Week.Next}}&view=week" aria-label="Next week"></a>
</div>
<div class="week-totals">
<span><i class="presence-mark present"></i><strong>{{.Week.Present}}</strong> Present</span>
<span><i class="presence-mark remote"></i><strong>{{.Week.Remote}}</strong> Remote</span>
<span><i class="presence-mark absent"></i><strong>{{.Week.Absent}}</strong> Absent</span>
</div>
</header>
<div class="week-grid">
{{range .Week.Days}}
<section class="week-day-column {{if .IsToday}}today{{end}} {{if eq .Weekday "Friday"}}friday{{end}}">
<a class="week-day-head" href="/day?date={{.Jalali}}">
<span>{{.Weekday}}</span>
<strong>{{.Jalali}}</strong>
<small>{{.Gregorian}}{{if .DayNote}} · {{.DayNote}}{{end}}</small>
</a>
<div class="week-day-counts">
<span class="present">{{.Present}}</span><span class="remote">{{.Remote}}</span><span class="absent">{{.Absent}}</span>
</div>
<div class="week-records">
{{range .Members}}
<article class="week-record {{.Status}}">
<div class="week-record-person">
{{if .User.AvatarURL}}<img class="avatar" src="{{.User.AvatarURL}}" alt="">{{else}}<span class="avatar">{{initial .User.DisplayName}}</span>{{end}}
<span><strong>{{.User.DisplayName}}</strong><small>{{.Detail}}</small></span>
</div>
<span class="week-record-status"><i class="presence-mark {{.Status}}"></i>{{.Label}}</span>
</article>
{{end}}
</div>
</section>
{{end}}
</div>
</section>
</div>
{{else}}
<div class="day-layout">
<section class="card day-summary-card">
<div class="day-date-nav">
@@ -52,5 +107,6 @@
{{end}}
</section>
</div>
{{end}}
{{template "shell-end" .}}
{{end}}