Кабинет: логотип ведёт на табло; сотрудник без открытого клиента с табло попадает в список клиентов
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q4YVo4UMopqT5DzicqpPjL
This commit is contained in:
@@ -615,6 +615,13 @@ func (s *Server) buildHandler() http.Handler {
|
|||||||
http.Redirect(w, r, "/login", http.StatusSeeOther)
|
http.Redirect(w, r, "/login", http.StatusSeeOther)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
// Сотрудник, не открывший кабинет клиента: его «табло» — список клиентов.
|
||||||
|
if c, err := r.Cookie("bj_lk_admin"); err == nil && c.Value == "1" {
|
||||||
|
if as, err := r.Cookie("bj_lk_as"); err != nil || as.Value == "" {
|
||||||
|
http.Redirect(w, r, "/clients", http.StatusSeeOther)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
pf, err := s.portfolio(r, sess)
|
pf, err := s.portfolio(r, sess)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
s.render(w, r, "board", map[string]any{"Nav": "b", "Error": err.Error()})
|
s.render(w, r, "board", map[string]any{"Nav": "b", "Error": err.Error()})
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ input[type=checkbox]{width:20px;min-height:20px;height:20px}
|
|||||||
{{define "mark"}}<svg viewBox="0 0 28 28" width="21" height="21" fill="none" stroke="#e8a33d" stroke-width="1.8" stroke-linecap="round" aria-hidden="true"><circle cx="6" cy="14" r="3"/><circle cx="22" cy="14" r="3"/><path d="M9 14h10"/><path d="M11 10.5h6M11 17.5h6"/></svg>{{end}}
|
{{define "mark"}}<svg viewBox="0 0 28 28" width="21" height="21" fill="none" stroke="#e8a33d" stroke-width="1.8" stroke-linecap="round" aria-hidden="true"><circle cx="6" cy="14" r="3"/><circle cx="22" cy="14" r="3"/><path d="M9 14h10"/><path d="M11 10.5h6M11 17.5h6"/></svg>{{end}}
|
||||||
|
|
||||||
{{define "nav"}}<header class="top">
|
{{define "nav"}}<header class="top">
|
||||||
<span class="brand">{{template "mark" .}}<span class="lbl" style="font-size:12px;letter-spacing:.14em">{{.Title}}</span></span>
|
<a class="brand" href="/" title="На табло" style="text-decoration:none;color:inherit">{{template "mark" .}}<span class="lbl" style="font-size:12px;letter-spacing:.14em">{{.Title}}</span></a>
|
||||||
<nav>
|
<nav>
|
||||||
{{if .IsAdmin}}<a href="/clients" class="lbl {{if eq .Nav "a"}}on{{end}}">Клиенты</a>{{end}}
|
{{if .IsAdmin}}<a href="/clients" class="lbl {{if eq .Nav "a"}}on{{end}}">Клиенты</a>{{end}}
|
||||||
<a href="/" class="lbl {{if eq .Nav "b"}}on{{end}}">Табло</a>
|
<a href="/" class="lbl {{if eq .Nav "b"}}on{{end}}">Табло</a>
|
||||||
|
|||||||
Reference in New Issue
Block a user