feat: the Kanban on the phone follows the phone mockup
All checks were successful
Build and deploy / Validate source (push) Successful in 6s
Build and deploy / Integration suite on a real stack (push) Successful in 3m40s
Build and deploy / Secret scan and release gate (push) Successful in 5s
Build and deploy / Publish images (push) Successful in 56s
All checks were successful
Build and deploy / Validate source (push) Successful in 6s
Build and deploy / Integration suite on a real stack (push) Successful in 3m40s
Build and deploy / Secret scan and release gate (push) Successful in 5s
Build and deploy / Publish images (push) Successful in 56s
- Top bar with the logo, search and filters; at the bottom Produção, Cotações, Pagamentos, Números and "Mais" (Integrações, Usuários, the machine, the theme, the password, Sair) in a sheet. - Produção: the stages as chips, the stage's metres and the session's machine over the cards, the queue's download as a button, the filters (product included) in a sheet. - The order as a page: back, the order and its stage, the next step with its buttons at the bottom, the facts as rows, WhatsApp, Arquivos and Histórico; its actions in a sheet. A quote opens the same way. - Pagamentos as cards, Números as the mockup's figures, chart and lists, Usuários as a list, Integrações as cards, the search as a page, dialogs as sheets, and the sign-in with the sheet rolling on top. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
340
web/kanban.css
340
web/kanban.css
@@ -80,6 +80,7 @@ input:focus,textarea:focus{border-color:var(--acc)}
|
||||
.ltag{position:absolute;left:40px;bottom:36px;margin:0;max-width:300px;font-size:24px;line-height:1.15;font-weight:600;letter-spacing:-.015em;color:#F2F2F0}
|
||||
.lform{position:relative;display:flex;align-items:center;justify-content:center;padding:40px}
|
||||
.lbrand{position:absolute;top:36px;left:44px;display:flex;align-items:center;gap:12px}
|
||||
.lbrand.phone{display:none}
|
||||
.lbrand b{font-size:18px;font-weight:650;letter-spacing:-.01em}
|
||||
.lbrand .mark{width:34px;height:34px;color:var(--ink)}
|
||||
.lbrand .mark .cut{stroke:var(--bg)}
|
||||
@@ -810,108 +811,285 @@ select.inp{appearance:none;-webkit-appearance:none;padding-right:32px;background
|
||||
#tab-board .col{min-height:0;overflow-y:auto;padding-top:0;overscroll-behavior:contain}
|
||||
#tab-board .colhead{position:sticky;top:0;z-index:3;background:var(--lane);margin:0 -8px;padding:14px 16px 8px}
|
||||
|
||||
/* Phone (redesign, step 8): the sections in a bar at the bottom, the
|
||||
search behind a button, one stage of the board at a time, the order and
|
||||
the dialogs over the whole screen. */
|
||||
.phone,.mtabs{display:none}
|
||||
/* Phone (redesign, step 8), the design canvas' phone screens: a top bar
|
||||
with search and filters, the sections at the bottom with "Mais", one stage
|
||||
at a time, sheets from the bottom, the order and a quote as pages. */
|
||||
.phone,.mtabs,.msum,.mdl,.mbtns,.mhead.phone,.mlist.phone,.mscrim,.msheet{display:none}
|
||||
@media (max-width:700px){
|
||||
.phone{display:flex}
|
||||
.mlist.phone{display:flex}
|
||||
#app:not([hidden]){display:block}
|
||||
.shell{padding-bottom:72px}
|
||||
.rail{position:fixed;left:0;right:0;bottom:0;top:auto;z-index:15;width:auto;height:68px;flex-direction:row;align-items:stretch;gap:0;padding:4px 4px 8px;border-right:0;border-top:1px solid var(--railln);overflow-x:auto;scrollbar-width:none}
|
||||
.rail .mark,.rail .grow,.railmachine,#theme-rail{display:none}
|
||||
.nav{flex:1 0 54px;width:auto;height:auto;gap:4px;font-size:10px;border-radius:10px;min-width:0}
|
||||
/* the bar at the bottom */
|
||||
.rail{position:fixed;left:0;right:0;bottom:0;top:auto;z-index:15;width:auto;height:72px;flex-direction:row;align-items:stretch;gap:0;padding:4px 4px 10px;border-right:0;border-top:1px solid var(--railln);background:var(--top)}
|
||||
.rail .mark,.rail .grow,.railmachine,#theme-rail,.account,.nav[data-tab=integrations],.nav[data-tab=users]{display:none!important}
|
||||
.nav{flex:1 1 0;width:auto;height:auto;min-width:0;gap:5px;font-size:11px;font-weight:600;border-radius:12px;color:var(--tx3)}
|
||||
.nav .i{width:22px;height:22px}
|
||||
.nav:hover{background:transparent}
|
||||
.nav[aria-selected=true],.nav.on{background:transparent;color:var(--tx)}
|
||||
.nav[aria-selected=true]::before,.nav.on::before{content:"";position:absolute;top:-5px;left:30%;right:30%;height:2px;border-radius:2px;background:var(--acc)}
|
||||
.nav .pip{top:4px;right:auto;left:calc(50% + 5px);min-width:17px;height:17px;padding:0 4px;border-radius:9px;background:var(--acc);color:#0A0A0A;font-size:10.5px;line-height:17px;box-shadow:none}
|
||||
.nav span:not(.pip){max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
|
||||
.account{flex:0 0 48px}
|
||||
.nav[aria-selected=true]{background:transparent;color:var(--railon)}
|
||||
.nav[aria-selected=true]::before{content:"";position:absolute;top:-5px;left:30%;right:30%;height:2px;border-radius:2px;background:var(--acc)}
|
||||
.nav .pip{top:2px;right:auto;left:calc(50% + 5px)}
|
||||
.account{flex:0 0 56px;display:flex;align-items:center;justify-content:center}
|
||||
.avatar{margin-top:0;width:34px;height:34px}
|
||||
.menu.acct{position:fixed;left:8px;right:8px;bottom:76px;top:auto;width:auto}
|
||||
.top{height:58px;padding:0 8px 0 16px;gap:4px}
|
||||
.ptitle h1{font-size:20px}
|
||||
.ptitle span{display:none}
|
||||
.phone{display:flex}
|
||||
/* the top bar */
|
||||
.top{height:58px;padding:0 8px 0 16px;gap:4px;position:sticky}
|
||||
.ptitle{flex:1;align-items:center;gap:10px}
|
||||
.ptitle .mark{width:30px;height:30px;flex:none;color:var(--tx)}
|
||||
.ptitle .mark .cut{stroke:var(--top)}
|
||||
.ptitle h1{font-size:20px;letter-spacing:-.015em}
|
||||
.ptitle>span{display:none}
|
||||
.mymachine,.syncwrap,#tiny{display:none!important}
|
||||
.mic{width:44px;height:44px;border-radius:12px;border:0;background:transparent;color:var(--tx);display:flex;align-items:center;justify-content:center;position:relative;flex:none;text-decoration:none}
|
||||
.mic:active{background:var(--sf3)}
|
||||
.mic .dotn{position:absolute;top:8px;right:8px;min-width:16px;height:16px;padding:0 4px;border-radius:8px;background:var(--ink);color:var(--onink);font-size:10px;font-weight:650;line-height:16px;text-align:center}
|
||||
/* the search, a page of its own */
|
||||
.searchbox{display:none}
|
||||
.top.searching .searchbox{display:block;position:absolute;left:8px;right:8px;top:9px;margin:0;flex:none;min-width:0;z-index:2}
|
||||
.top.searching .search{background:var(--sf)}
|
||||
.results{position:fixed;left:8px;right:8px;top:62px;width:auto;max-height:calc(100vh - 150px)}
|
||||
.mymachine{padding:0 8px}
|
||||
.mymachine span,.sync #sync-at{display:none}
|
||||
.syncmenu{right:-4px}
|
||||
.tools{padding:10px 12px 0}
|
||||
.top.searching .searchbox{display:flex;align-items:center;gap:8px;position:fixed;inset:0;z-index:30;margin:0;padding:7px 12px 0 8px;height:58px;background:var(--top);border-bottom:1px solid var(--ln);min-width:0;max-width:none}
|
||||
.top.searching .search{flex:1;height:44px;border-radius:12px;border-color:var(--acc);box-shadow:0 0 0 3px color-mix(in srgb,var(--acc) 18%,transparent)}
|
||||
.top.searching .search input{font-size:16px}
|
||||
.top.searching .search kbd{display:none}
|
||||
.results{position:fixed;left:0;right:0;top:58px;bottom:0;width:auto;max-height:none;border:0;border-radius:0;box-shadow:none;background:var(--bg);animation:none}
|
||||
.rhit{padding:10px 14px}
|
||||
/* Produção: the stages as chips, one at a time */
|
||||
#tab-board:not([hidden]){display:block;height:auto}
|
||||
#tab-board .tools{display:none}
|
||||
.mtabs{display:flex;gap:6px;overflow-x:auto;padding:10px 12px;border-bottom:1px solid var(--ln);background:var(--top);scrollbar-width:none;position:sticky;top:58px;z-index:4}
|
||||
.mtab{flex:none;height:36px;padding:0 13px 0 10px;border-radius:999px;border:1px solid var(--ln2);background:transparent;color:var(--tx2);font-size:13px;font-weight:600;display:flex;align-items:center;gap:7px;white-space:nowrap}
|
||||
.mtab,#quote-filters button,#stats-period button,#stats-range .btn,.pagetools .seg button{flex:none;height:36px;padding:0 13px 0 10px;border-radius:999px;border:1px solid var(--ln2);background:transparent;color:var(--tx2);font-size:13px;font-weight:600;display:flex;align-items:center;gap:7px;white-space:nowrap;box-shadow:none}
|
||||
.mtab .sg{width:16px;height:16px}
|
||||
.mtab .n{font-size:12px;color:var(--tx3)}
|
||||
.mtab.on{background:var(--ink);border-color:var(--ink);color:var(--onink)}
|
||||
.mtab.on .sg,.mtab.on .n{color:var(--onink)}
|
||||
.mtab .n,#quote-filters .n,.pagetools .seg .n{font-size:12px;font-weight:600;color:var(--tx3)}
|
||||
.mtab.on,#quote-filters button.on,#stats-period button.on,.pagetools .seg button.on{background:var(--ink);border-color:var(--ink);color:var(--onink)}
|
||||
.mtab.on .sg,.mtab.on .n,#quote-filters .on .n,.pagetools .seg .on .n{color:var(--onink)}
|
||||
.mtab.on .n{opacity:.65}
|
||||
.board{display:block;padding:12px 12px 24px;overflow:visible}
|
||||
.board .col{display:none;background:transparent;padding:0;min-height:0}
|
||||
.board .col.pick{display:flex}
|
||||
.colhead{padding:2px 2px 4px}
|
||||
.seg{background:transparent;padding:0;gap:6px}
|
||||
#tab-board .board{display:block;padding:12px 12px 24px;overflow:visible}
|
||||
#tab-board .col{display:none;background:transparent;padding:0;min-height:0;overflow:visible;gap:10px;border-radius:0}
|
||||
#tab-board .col.pick{display:flex}
|
||||
#tab-board .colhead{display:none}
|
||||
.msum{display:flex;align-items:center;gap:8px;padding:2px 2px 4px;font-size:13px;color:var(--tx2)}
|
||||
.msum b{color:var(--tx);font-weight:600}
|
||||
.msum .mcell{gap:6px}
|
||||
.mdl{display:flex;height:44px}
|
||||
.card{padding:12px}
|
||||
.card:hover{transform:none}
|
||||
.ctop{grid-template-columns:56px minmax(0,1fr);gap:12px}
|
||||
.thumb{width:56px;height:56px;padding:4px}
|
||||
.cmeta .mach{display:inline}
|
||||
.cname{font-size:15px}
|
||||
.flag{height:26px;padding:0 9px;font-size:12.5px}
|
||||
.moreold{height:44px}
|
||||
.filterpop{position:fixed;left:8px;right:8px;top:auto;bottom:76px;width:auto;max-height:70vh;overflow:auto}
|
||||
.dwrap .drawer{width:100%;border-left:0}
|
||||
.dhead{padding:14px 16px 16px;gap:12px}
|
||||
.dnum{font-size:22px}
|
||||
.dname{font-size:14px}
|
||||
.dtop .stage{display:none}
|
||||
.dbody{padding:16px 16px 28px;gap:18px}
|
||||
.nact .btn{flex:1 1 100%;height:48px}
|
||||
.callout{flex-wrap:wrap}
|
||||
.callout .btn{flex:1}
|
||||
.tabs{gap:20px;overflow-x:auto}
|
||||
.item,.ritem{grid-template-columns:1fr}
|
||||
.item .preview .view{max-height:260px}
|
||||
.facts3{grid-template-columns:1fr}
|
||||
.fact{border-right:0;border-bottom:1px solid var(--ln)}
|
||||
.fact:last-child{border-bottom:0}
|
||||
.stepper li{font-size:0}
|
||||
/* sheets from the bottom: Mais, the filters, the order's actions */
|
||||
.mscrim{display:block;position:fixed;inset:0;background:var(--scrim);z-index:30;animation:fade .25s ease both}
|
||||
.msheet{display:flex;position:fixed;left:0;right:0;bottom:0;z-index:31;background:var(--sf);border-radius:18px 18px 0 0;box-shadow:0 -20px 60px -20px rgba(0,0,0,.5);max-height:86vh;flex-direction:column;animation:sheetUp .4s cubic-bezier(.16,1,.3,1) both}
|
||||
.msheet .grab{width:40px;height:4px;border-radius:2px;background:var(--ln3);margin:10px auto 2px;flex:none}
|
||||
.msheet .shead{display:flex;align-items:center;padding:8px 8px 8px 18px;flex:none}
|
||||
.msheet .shead b{font-size:18px;font-weight:650}
|
||||
.msheet .sbody{overflow-y:auto;padding:0 6px 8px}
|
||||
.msheet .sbody.pad{padding:4px 16px 20px}
|
||||
.msheet .sfoot{display:flex;gap:10px;padding:12px 16px 18px;border-top:1px solid var(--ln);flex:none}
|
||||
.msheet .sfoot .btn{flex:1;height:48px;font-size:15px}
|
||||
.msheet .fgroup{padding:12px}
|
||||
.msheet .fopt{height:38px;padding:0 13px;font-size:14px}
|
||||
.sheetwho{display:flex;align-items:center;gap:12px;padding:12px 18px 14px;border-bottom:1px solid var(--ln)}
|
||||
.sheetwho b{display:block;font-size:15px;font-weight:650}
|
||||
.mrow{display:flex;align-items:center;gap:14px;width:100%;min-height:56px;padding:0 12px;border:0;border-radius:12px;background:transparent;color:var(--tx);font-size:15px;font-weight:550;text-align:left}
|
||||
.mrow:active{background:var(--sf2)}
|
||||
.mrow .i{color:var(--tx2)}
|
||||
.mrow .mtext{flex:1}
|
||||
.mrow .lbl,.mrow .pill{margin-left:auto}
|
||||
.mrow.bad,.mrow.bad .i{color:var(--bad)}
|
||||
/* the order's menu, as a sheet */
|
||||
.menu.dmenu{position:fixed;left:0;right:0;top:auto;bottom:0;width:auto;z-index:31;padding:16px 6px 10px;border-radius:18px 18px 0 0;border:0;box-shadow:0 0 0 100vmax var(--scrim);animation:sheetUp .4s cubic-bezier(.16,1,.3,1) both}
|
||||
.menu.dmenu .menuitem{min-height:56px;height:auto;gap:14px;font-size:15px;padding:0 12px}
|
||||
.menu.dmenu .menuitem .i{width:20px;height:20px}
|
||||
/* the order, a page */
|
||||
.dwrap .drawer{width:100%;border-left:0;animation:pageIn .38s cubic-bezier(.16,1,.3,1) both}
|
||||
.mhead.phone{flex:none;display:flex;align-items:center;gap:4px;height:58px;padding:0 8px;border-bottom:1px solid var(--ln);background:var(--top)}
|
||||
.mhead .t{flex:1;min-width:0;display:flex;flex-direction:column}
|
||||
.mhead .t b{font-size:16px;font-weight:650;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
|
||||
.mhead .t span{font-size:12.5px;color:var(--tx2);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
|
||||
.dhead{padding:12px 12px 0;border:0;gap:0}
|
||||
.dhead .dtop,.dhead .dsub{display:none}
|
||||
.stepper{display:flex;gap:4px}
|
||||
.stepper li{flex:1;font-size:0;gap:0}
|
||||
.stepper li::before{height:4px}
|
||||
.dbody{padding:12px 12px 170px;gap:10px}
|
||||
.callout{flex-wrap:wrap;padding:12px;border-radius:12px;background:var(--sf)}
|
||||
.callout .btn{width:100%;height:42px}
|
||||
.nextbox{gap:12px;padding:16px;border:1px solid var(--ln);background:var(--sf)}
|
||||
.nextbox h3{font-size:17px;margin-top:-6px}
|
||||
.nnote{font-size:14px}
|
||||
.nextbox .nact{position:fixed;left:0;right:0;bottom:0;z-index:5;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;padding:12px 16px 18px;border-top:1px solid var(--ln);background:var(--top)}
|
||||
.nextbox .nact>*{height:50px;font-size:15px;width:100%}
|
||||
.nextbox .nact>:first-child{grid-column:1/-1}
|
||||
.dbody .tabs{display:none}
|
||||
.dbody .tview{display:flex}
|
||||
.dbody .tview+.tview{display:none!important}
|
||||
.mbtns{display:flex;gap:8px}
|
||||
.mbtns .btn{flex:1;height:44px}
|
||||
.item{grid-template-columns:112px minmax(0,1fr);gap:4px 14px;align-items:start}
|
||||
.item .iinfo{display:contents}
|
||||
.item .preview{grid-column:1;grid-row:1/4}
|
||||
.item .preview .view{min-height:0;max-height:200px}
|
||||
.item .iinfo>.lbl{display:none}
|
||||
.item .iinfo>h3{grid-column:2;margin:0;font-size:15px}
|
||||
.item .dl{grid-column:2;display:flex;flex-direction:column;gap:0}
|
||||
.dl div{flex-direction:row;justify-content:space-between;gap:16px;padding:10px 0;border-bottom:1px solid var(--ln)}
|
||||
.dl div:last-child{border-bottom:0}
|
||||
.dl dt{font-size:14px;color:var(--tx2);flex:none}
|
||||
.dl dd{font-size:14px;text-align:right}
|
||||
.item .inotes,.item .links{grid-column:1/-1}
|
||||
.item .links .btn{flex:1}
|
||||
.mblock{display:flex;flex-direction:column;gap:12px;padding:16px;border:1px solid var(--ln);border-radius:12px;background:var(--sf)}
|
||||
.mfacts{gap:0;padding-top:4px;padding-bottom:4px}
|
||||
.mfact{display:flex;justify-content:space-between;gap:16px;padding:12px 0;border-bottom:1px solid var(--ln);font-size:14px}
|
||||
.mfact:last-child{border-bottom:0}
|
||||
.mfact span{color:var(--tx2);flex:none}
|
||||
.mfact b{font-weight:550;text-align:right;min-width:0;overflow-wrap:anywhere}
|
||||
.mfacts select{margin-top:10px;height:44px;padding:0 12px;border-radius:10px;border:1px solid var(--ln2);background:var(--bg);color:var(--tx)}
|
||||
.rework{border-radius:12px;background:var(--sf)}
|
||||
/* dialogs: sheets from the bottom */
|
||||
.modal{left:0;right:0;top:auto;bottom:0;width:auto!important;max-width:none;max-height:92vh;transform:none;border-radius:18px 18px 0 0;padding:22px 18px 18px;animation:sheetUp .4s cubic-bezier(.16,1,.3,1) both}
|
||||
.frow,.inputs{grid-template-columns:1fr}
|
||||
.dfoot{flex-wrap:wrap}
|
||||
.dfoot .btn{flex:1;height:46px}
|
||||
.dfoot .btn{flex:1;height:48px}
|
||||
.dfoot .lbl{max-width:none;flex-basis:100%}
|
||||
.page:not([hidden]){padding:16px 12px 24px;gap:14px}
|
||||
.mchoices{grid-template-columns:1fr}
|
||||
/* the pages */
|
||||
.page:not([hidden]){padding:12px 12px 24px;gap:10px}
|
||||
.pagetools{padding:0;gap:6px;flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none}
|
||||
.pagetools>.lbl{display:none}
|
||||
.panel.clip{overflow-x:auto}
|
||||
.panel .table{min-width:560px}
|
||||
.phead{padding:14px}
|
||||
.pfilters{margin-left:0;width:100%}
|
||||
.irow{grid-template-columns:42px minmax(0,1fr);gap:10px 14px}
|
||||
.irow p{grid-column:1/-1}
|
||||
.iact{grid-column:1/-1;justify-content:flex-start;flex-wrap:wrap}
|
||||
.idetails{margin:0 14px 14px}
|
||||
.hero{grid-template-columns:1fr}
|
||||
.hk{border-right:0;border-bottom:1px solid var(--ln)}
|
||||
.hk b{font-size:30px}
|
||||
.minis{grid-template-columns:repeat(2,minmax(0,1fr))}
|
||||
.mk:nth-child(2n){border-right:0}
|
||||
.mk{border-bottom:1px solid var(--ln);padding:12px 16px}
|
||||
.chart{padding:18px 12px 40px}
|
||||
.calpop{position:fixed;left:8px;right:8px;top:auto;bottom:76px}
|
||||
.empty.pad{padding:16px}
|
||||
/* Cotações: the list; a quote opens as a page */
|
||||
.split{display:block;height:auto}
|
||||
.qlist{border:0}
|
||||
.qtools{padding:0;border:0;position:sticky;top:58px;z-index:4;background:var(--top)}
|
||||
.qtools .seg{display:flex;gap:6px;padding:10px 12px;border-bottom:1px solid var(--ln);overflow-x:auto;align-self:stretch}
|
||||
#quote-chips{display:none}
|
||||
.qrows{max-height:none;overflow:visible;padding:6px 12px 12px;gap:0}
|
||||
.qrow{border-radius:0;border:0;border-bottom:1px solid var(--ln);padding:12px 2px}
|
||||
.qrow.on{background:transparent;border-color:var(--ln)}
|
||||
.review{display:none}
|
||||
#tab-quotes.reviewing .review{display:flex;position:fixed;inset:0;z-index:25;background:var(--bg);animation:pageIn .38s cubic-bezier(.16,1,.3,1) both}
|
||||
.review .rhead{display:none}
|
||||
.rbody{padding:12px 12px 170px;gap:10px;background:var(--bg)}
|
||||
.ritem{grid-template-columns:1fr;gap:12px}
|
||||
.tall{width:100%;height:140px;min-height:0;max-height:none;padding:0;background:repeating-conic-gradient(var(--chka) 0 25%,var(--chkb) 0 50%) 0 0/10px 10px}
|
||||
.tall .preview>svg,.tall .preview .view{width:120px;margin:0 auto}
|
||||
.ritem .iinfo>.lbl{display:none}
|
||||
.ritem .iinfo>h3{margin:0 0 6px;font-size:16px}
|
||||
.ritem .dl{display:flex;flex-direction:column;gap:0;padding:4px 16px;border:1px solid var(--ln);border-radius:12px;background:var(--sf)}
|
||||
.ritem .inputs{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-top:12px}
|
||||
.ritem .inputs input{height:48px;font-size:16px}
|
||||
.qsums{justify-content:stretch;grid-template-columns:1fr auto}
|
||||
.rfoot{position:fixed;left:0;right:0;bottom:0;z-index:26;display:grid;grid-template-columns:auto minmax(0,1fr);gap:10px;padding:12px 16px 18px;background:var(--top)}
|
||||
.rfoot .ckb{grid-column:1/-1;margin:0}
|
||||
.rfoot .btn{height:50px;font-size:15px}
|
||||
.rfoot .btn.right{margin:0}
|
||||
.register .fgroup2{grid-template-columns:1fr}
|
||||
/* Pagamentos: one card per payment */
|
||||
.pcard{gap:10px}
|
||||
.pcard .prow{display:flex;align-items:center;gap:8px}
|
||||
.pcard .prow.base{align-items:baseline;gap:10px}
|
||||
.pcard .prow b{font-size:16px;font-weight:650}
|
||||
.pcard .prow .grow{flex:1;min-width:0}
|
||||
.pcard>.sub{margin-top:-6px}
|
||||
.pcard .btn.wide{height:44px}
|
||||
#payments .pager{border:0;padding:4px 2px}
|
||||
/* Números: the figures, the chart, and the stages and rework as lists */
|
||||
.calpop{position:fixed;left:8px;right:8px;top:auto;bottom:80px}
|
||||
.cal{grid-template-columns:1fr}
|
||||
.presets{flex-direction:row;flex-wrap:wrap;border-right:0;border-bottom:1px solid var(--ln)}
|
||||
.split{grid-template-columns:1fr;height:auto}
|
||||
.qlist{border-right:0;border-bottom:1px solid var(--ln)}
|
||||
.qrows{max-height:56vh}
|
||||
.rhead{padding:16px;flex-wrap:wrap}
|
||||
.rbody{padding:16px}
|
||||
.rfoot{padding:12px 16px;flex-wrap:wrap}
|
||||
.rfoot .ckb{flex-basis:100%}
|
||||
.tall{width:100%;max-height:60vh}
|
||||
.plegend{margin-left:0;flex-basis:100%;order:3}
|
||||
.mchoices{grid-template-columns:1fr}
|
||||
#tab-board:not([hidden]){display:block;height:auto}
|
||||
#tab-board .col{overflow:visible}
|
||||
#tab-board .colhead{position:static;margin:0;padding:2px 2px 4px}
|
||||
.scrollbox.people,.scrollbox.log,.paypanel{height:auto}
|
||||
.fill{min-height:0}
|
||||
.fill>.mtiles,.fill>.scrollin{position:static}
|
||||
#stats-kpis{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}
|
||||
#stats-kpis .hero,#stats-kpis .minis{display:contents}
|
||||
.hk,.mk{padding:14px;gap:4px;border:0;border-right:1px solid var(--ln);border-bottom:1px solid var(--ln)}
|
||||
.hk:first-child{grid-column:1/-1;border-right:0}
|
||||
.hk>span,.mk>span{font-size:12.5px;color:var(--tx2)}
|
||||
.hk b,.mk b{font-size:22px;font-weight:600;letter-spacing:-.02em}
|
||||
.hk:first-child b{font-size:34px}
|
||||
.hk b small,.mk b small{font-size:13px}
|
||||
.hk em{font-size:12px}
|
||||
.mk:nth-child(1),.mk:nth-child(2),.mk:nth-child(4),.mk:nth-child(6){display:none}
|
||||
.hk:nth-child(3){border-right:0}
|
||||
.mk:nth-child(3){border-right:1px solid var(--ln)}
|
||||
.mk:nth-child(5){border-right:0}
|
||||
.hk:nth-child(2),.hk:nth-child(3){border-bottom:1px solid var(--ln)}
|
||||
.mk:nth-child(3),.mk:nth-child(5){border-bottom:0}
|
||||
#tab-stats .g12:has(#stats-machines){display:none}
|
||||
#tab-stats .g12{display:flex;flex-direction:column;gap:10px}
|
||||
#tab-stats .panel:not(#stats-kpis){background:transparent;border:0}
|
||||
#stats-kpis{border-radius:12px;overflow:hidden}
|
||||
#tab-stats .g12>.panel:has(#stats-stages){order:-1}
|
||||
#tab-stats .phead{padding:10px 2px 8px;border:0}
|
||||
#tab-stats .phead .hint,#tab-stats .phead .pill,.legend,.yaxis,.charttable,#stats-rework-film,.psub{display:none}
|
||||
#tab-stats .phead h2{font-size:15px}
|
||||
.chart{grid-template-columns:1fr;padding:14px 12px 30px;border:1px solid var(--ln);border-radius:12px;background:var(--sf);overflow:hidden}
|
||||
.axis{font-size:11px}
|
||||
.rhelp{display:none}
|
||||
.plot{height:150px}
|
||||
.bars,.axis{gap:3px}
|
||||
#tab-stats .table{min-width:0;border:1px solid var(--ln);border-radius:12px;background:var(--sf);border-collapse:separate;border-spacing:0;overflow:hidden}
|
||||
#tab-stats .table thead{display:none}
|
||||
#stats-stages tr,#stats-rework tr{display:grid;grid-template-columns:minmax(0,1fr) auto;column-gap:12px;row-gap:4px;padding:12px 14px;border-bottom:1px solid var(--ln)}
|
||||
#stats-stages tr:last-child,#stats-rework tr:last-child{border-bottom:0}
|
||||
#stats-stages td,#stats-rework td{padding:0;border:0}
|
||||
#stats-stages td:nth-child(1) .sub{display:none}
|
||||
#stats-stages td:nth-child(1){font-size:14.5px;font-weight:600}
|
||||
#stats-stages td:nth-child(2){grid-column:2;grid-row:1/3;align-self:center;font-size:13.5px}
|
||||
#stats-stages td:nth-child(3){grid-column:1;grid-row:2;font-size:12.5px;padding-left:28px}
|
||||
#stats-rework td:nth-child(1){font-size:14px}
|
||||
#stats-rework td:nth-child(1) .sub{display:none}
|
||||
#stats-rework td:nth-child(2){font-weight:600;color:var(--tx)}
|
||||
#stats-rework td:nth-child(3){grid-column:1/-1}
|
||||
#stats-rework .meter .mv{font-size:12.5px;width:50px}
|
||||
/* Usuários: the people as a list, then a button for a new one */
|
||||
#tab-users .cols2,#tab-users .scrollbox.people{display:none}
|
||||
#tab-users>.panel{background:transparent;border:0;display:flex;flex-direction:column;gap:10px}
|
||||
#tab-users>.panel>.phead{display:contents}
|
||||
#tab-users>.panel>.phead h2,#tab-users>.panel>.phead .n{display:none}
|
||||
#tab-users .plegend{order:0;flex-wrap:wrap;gap:8px 14px;padding:2px;margin:0}
|
||||
#new-user{order:2;height:48px;margin:0}
|
||||
.mlist{flex-direction:column;border:1px solid var(--ln);border-radius:12px;background:var(--sf);overflow:hidden;order:1}
|
||||
.mli{display:flex;align-items:center;gap:12px;padding:12px 14px;border:0;border-bottom:1px solid var(--ln);background:transparent;color:inherit;text-align:left;width:100%}
|
||||
.mli:last-child{border-bottom:0}
|
||||
.mli .grow{flex:1;min-width:0}
|
||||
.mli b{display:block;font-size:14.5px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
|
||||
.mli .sub{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:flex;align-items:center;gap:6px}
|
||||
.mli .mdot{margin-left:4px}
|
||||
.mli>.i{color:var(--tx3)}
|
||||
/* Integrações: one card per service */
|
||||
#integrations{background:transparent;border:0;display:flex;flex-direction:column;gap:10px}
|
||||
.integ{border:1px solid var(--ln);border-radius:12px;background:var(--sf)}
|
||||
.integ+.integ{border-top:1px solid var(--ln)}
|
||||
.irow{display:flex;flex-wrap:wrap;align-items:center;gap:10px 12px;padding:16px}
|
||||
.iname{flex:1;flex-direction:row;align-items:center;justify-content:space-between}
|
||||
.iname b{font-size:15px;font-weight:650}
|
||||
.irow p{flex-basis:100%;font-size:14px;-webkit-line-clamp:unset}
|
||||
.iact{flex-basis:100%;flex-direction:column;align-items:stretch}
|
||||
.iact .btn{height:44px}
|
||||
.idetails{margin:0 16px 16px}
|
||||
/* Entrar: the sheet rolling on top, the form under it */
|
||||
.login:not([hidden]){display:flex;flex-direction:column;height:100vh;min-height:0;grid-template-columns:none}
|
||||
.lart{display:flex;height:300px;flex:none;background-size:32px 32px}
|
||||
.lart::after{content:"";position:absolute;left:0;right:0;bottom:0;height:70px;background:linear-gradient(transparent,var(--bg))}
|
||||
.ltable{padding:0;height:auto;margin-top:22px}
|
||||
.lsheet{width:200px;height:212px;padding:0}
|
||||
.lruler,.lw,.ltag{display:none}
|
||||
.lr{width:18px;height:18px}
|
||||
.lr-tl{left:-24px;top:-24px}.lr-tr{right:-24px;top:-24px}.lr-bl{left:-24px;bottom:-24px}.lr-br{right:-24px;bottom:-24px}
|
||||
.lform{flex:1;display:block;padding:6px 24px 28px;overflow-y:auto}
|
||||
.lform>.lbrand{display:none}
|
||||
.lbox{width:auto;gap:16px}
|
||||
.lbrand.phone{position:static;display:flex;align-items:center;gap:10px;margin:0}
|
||||
.lbrand.phone .mark{width:30px;height:30px}
|
||||
.lbrand.phone b{font-size:17px}
|
||||
.lbox h1{font-size:28px;margin:0}
|
||||
.lbox label{font-size:13.5px}
|
||||
.lbox input{height:50px;border-radius:12px;font-size:16px}
|
||||
.lbox .btn{height:52px;font-size:16px;margin-top:0}
|
||||
.lhelp{text-align:center;font-size:13.5px}
|
||||
}
|
||||
@keyframes sheetUp{from{transform:translateY(40px);opacity:.4}}
|
||||
@keyframes pageIn{from{transform:translateX(30px);opacity:.3}}
|
||||
@keyframes sheetUp{from{transform:translateY(40%);opacity:.3}}
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
<div class="lform">
|
||||
<div class="lbrand"><svg class="mark" viewBox="0 0 40 40" aria-hidden="true"><path d="M8 5h24a2 2 0 0 1 2 2v19l-9 9H8a2 2 0 0 1-2-2V7a2 2 0 0 1 2-2z" fill="currentColor"></path><path class="cut" d="M16 9v22 M24 9v14" fill="none" stroke-width="2"></path><path d="M34 26l-9 9v-7a2 2 0 0 1 2-2z" fill="var(--acc)"></path></svg><b>Kanban DTF</b></div>
|
||||
<div class="lbox">
|
||||
<div class="lbrand phone"><svg class="mark" viewBox="0 0 40 40" aria-hidden="true"><path d="M8 5h24a2 2 0 0 1 2 2v19l-9 9H8a2 2 0 0 1-2-2V7a2 2 0 0 1 2-2z" fill="currentColor"></path><path class="cut" d="M16 9v22 M24 9v14" fill="none" stroke-width="2"></path><path d="M34 26l-9 9v-7a2 2 0 0 1 2-2z" fill="var(--acc)"></path></svg><b>Kanban DTF</b></div>
|
||||
<h1>Bom ver você de novo</h1>
|
||||
<label>E-mail <input id="email" type="email" autocomplete="username" required></label>
|
||||
<label>Senha <input id="password" type="password" placeholder="Sua senha" autocomplete="current-password" required></label>
|
||||
@@ -41,6 +42,7 @@
|
||||
<button class="nav" type="button" data-tab="stats" aria-selected="false"><svg class="i" viewBox="0 0 20 20" aria-hidden="true"><path d="M3 16.75h14 M4.75 14V9.5 M8.5 14V4.5 M12.25 14V7.5 M16 14v-3.5"></path></svg><span>Números</span></button>
|
||||
<button class="nav" type="button" data-tab="integrations" aria-selected="false"><svg class="i" viewBox="0 0 20 20" aria-hidden="true"><path d="M8.5 6.5H6a3.25 3.25 0 0 0 0 6.5h2.5 M11.5 6.5H14a3.25 3.25 0 0 1 0 6.5h-2.5 M7 9.75h6"></path></svg><span>Integrações</span><span class="pip" id="badge-integrations" title="A pasta da fila precisa de atenção"></span></button>
|
||||
<button class="nav" type="button" data-tab="users" aria-selected="false" hidden><svg class="i" viewBox="0 0 20 20" aria-hidden="true"><path d="M6.75 6.25a3.25 3.25 0 1 0 6.5 0a3.25 3.25 0 1 0 -6.5 0 M3.75 17c.6-3.2 3.1-5 6.25-5s5.65 1.8 6.25 5"></path></svg><span>Usuários</span></button>
|
||||
<button class="nav phone" id="more-nav" type="button" aria-haspopup="menu"><svg class="i" viewBox="0 0 20 20" aria-hidden="true"><path d="M4.1 10a.9.9 0 1 0 1.8 0a.9.9 0 1 0 -1.8 0 M9.1 10a.9.9 0 1 0 1.8 0a.9.9 0 1 0 -1.8 0 M14.1 10a.9.9 0 1 0 1.8 0a.9.9 0 1 0 -1.8 0"></path></svg><span>Mais</span><span class="pip" id="badge-more"></span></button>
|
||||
<span class="grow"></span>
|
||||
<button class="railmachine" id="rail-machine" type="button" hidden><small>Máquina</small><b></b></button>
|
||||
<button class="rbtn" id="theme-rail" type="button"><svg class="i" viewBox="0 0 20 20" aria-hidden="true"><path></path></svg></button>
|
||||
@@ -59,9 +61,11 @@
|
||||
</nav>
|
||||
<div class="shell">
|
||||
<header class="top">
|
||||
<div class="ptitle"><h1 id="page-title">Produção</h1><span id="board-summary"></span></div>
|
||||
<button class="rbtn phone" id="search-open" type="button" aria-label="Buscar" aria-expanded="false"><svg class="i" viewBox="0 0 20 20" aria-hidden="true"><path d="M3.0 8.75a5.75 5.75 0 1 0 11.5 0a5.75 5.75 0 1 0 -11.5 0 M13 13l4.25 4.25"></path></svg></button>
|
||||
<div class="ptitle"><svg class="mark phone" viewBox="0 0 40 40" aria-hidden="true"><path d="M8 5h24a2 2 0 0 1 2 2v19l-9 9H8a2 2 0 0 1-2-2V7a2 2 0 0 1 2-2z" fill="currentColor"></path><path class="cut" d="M16 9v22 M24 9v14" fill="none" stroke-width="2"></path><path d="M34 26l-9 9v-7a2 2 0 0 1 2-2z" fill="var(--acc)"></path></svg><h1 id="page-title">Produção</h1><span id="board-summary"></span></div>
|
||||
<button class="mic phone" id="search-open" type="button" aria-label="Buscar" aria-expanded="false"><svg class="i" viewBox="0 0 20 20" aria-hidden="true"><path d="M3.0 8.75a5.75 5.75 0 1 0 11.5 0a5.75 5.75 0 1 0 -11.5 0 M13 13l4.25 4.25"></path></svg></button>
|
||||
<button class="mic phone" id="filter-open" type="button" aria-label="Filtros"><svg class="i" viewBox="0 0 20 20" aria-hidden="true"><path d="M3 5h14 M5.5 10h9 M8 15h4"></path></svg><span class="dotn" id="filter-dot" hidden></span></button>
|
||||
<div class="searchbox">
|
||||
<button class="mic phone" id="search-back" type="button" aria-label="Voltar"><svg class="i" viewBox="0 0 20 20" aria-hidden="true"><path d="M12 5.5L7.5 10l4.5 4.5"></path></svg></button>
|
||||
<label class="search">
|
||||
<svg class="i m" viewBox="0 0 20 20" aria-hidden="true"><path d="M3.0 8.75a5.75 5.75 0 1 0 11.5 0a5.75 5.75 0 1 0 -11.5 0 M13 13l4.25 4.25"></path></svg>
|
||||
<input id="search" type="search" placeholder="Buscar cliente, CPF/CNPJ ou pedido" aria-label="Buscar em pedidos e cotações" autocomplete="off" role="combobox" aria-expanded="false" aria-controls="search-results">
|
||||
@@ -144,6 +148,7 @@
|
||||
<div class="phead"><h2>Pessoas</h2><span class="n" id="users-count"></span>
|
||||
<span class="plegend"><span title="Usou o sistema nos últimos 15 minutos"><i class="pres on"></i>Ativo agora</span><span><i class="pres away"></i>Inativo</span><span><i class="pres never"></i>Nunca entrou</span><span><i class="pres off"></i>Desativado</span></span>
|
||||
<button class="btn right" id="new-user" type="button"><svg class="i m" viewBox="0 0 20 20" aria-hidden="true"><path d="M10 4v12 M4 10h12"></path></svg>Novo usuário</button></div>
|
||||
<div class="mlist phone" id="users-phone"></div>
|
||||
<div class="scrollbox people"><table class="table"><thead><tr><th scope="col">Nome</th><th scope="col">Perfil</th><th scope="col">Máquina agora</th><th scope="col">Último acesso</th><th scope="col"><span class="vh">Editar</span></th></tr></thead><tbody id="users-list"></tbody></table></div>
|
||||
</section>
|
||||
<div class="cols2 lean">
|
||||
|
||||
172
web/kanban.js
172
web/kanban.js
@@ -137,6 +137,7 @@ const IC={
|
||||
rework:'M15.5 7.5A6 6 0 0 0 4.25 9 M4.5 12.5A6 6 0 0 0 15.75 11 M15.75 3.75V7.5H12 M4.25 16.25V12.5H8',
|
||||
back:'M8 5L4 9l4 4 M4 9h8a4 4 0 0 1 0 8h-2',
|
||||
ban:C(10,10,7.25)+' M5 15L15 5',
|
||||
logout:'M8 3.25H3.75v13.5H8 M12 6.5l3.5 3.5-3.5 3.5 M15.5 10H7.5',
|
||||
printer:'M5.75 7.5V3h8.5v4.5 M5.75 14H3V7.5h14V14h-2.75 M5.75 11.25h8.5v5.75h-8.5z',
|
||||
eye:'M2.5 10s2.75-5.25 7.5-5.25S17.5 10 17.5 10s-2.75 5.25-7.5 5.25S2.5 10 2.5 10z '+C(10,10,2.25),
|
||||
edit:'M12.5 4l3.5 3.5L7.5 16H4v-3.5z M10.5 6l3.5 3.5',
|
||||
@@ -592,9 +593,10 @@ async function load(quiet=false){
|
||||
// The page's name in the top bar; Produção also says what is open.
|
||||
const PAGE_TITLES={board:'Produção',quotes:'Cotações',payments:'Pagamentos',stats:'Números',integrations:'Integrações',users:'Usuários'};
|
||||
function showTab(name){
|
||||
tab=name;
|
||||
tab=name;$('tab-quotes').classList.remove('reviewing');
|
||||
for(const b of document.querySelectorAll('[data-tab]'))b.setAttribute('aria-selected',String(b.dataset.tab===name));
|
||||
$('page-title').textContent=PAGE_TITLES[name];$('board-summary').hidden=name!=='board';
|
||||
$('page-title').textContent=PAGE_TITLES[name];$('board-summary').hidden=name!=='board';$('filter-open').hidden=name!=='board';
|
||||
$('more-nav').classList.toggle('on',['integrations','users'].includes(name));
|
||||
for(const id of ['board','quotes','payments','stats','integrations','users'])$('tab-'+id).hidden=name!==id;
|
||||
const lists={quotes:loadQuotes,payments:loadIssues,stats:loadStats,integrations:eventsIfAllowed,users:loadUsers};
|
||||
if(board&&lists[name])lists[name]().catch(e=>say(e.message,true));
|
||||
@@ -607,6 +609,7 @@ function render(){
|
||||
$('badge-quotes').textContent=board.pending_total?String(board.pending_total):'';
|
||||
$('badge-payments').textContent=board.payment_issues_total?String(board.payment_issues_total):'';
|
||||
tinyHeader();renderBoard();renderIntegrations();
|
||||
$('badge-more').textContent=$('badge-integrations').textContent;
|
||||
// Lists live on their own pages of the API; refresh the one being looked at.
|
||||
const lists={quotes:loadQuotes,payments:loadIssues,stats:loadStats,integrations:eventsIfAllowed,users:loadUsers};
|
||||
if(lists[tab])lists[tab]().catch(e=>say(e.message,true));
|
||||
@@ -755,6 +758,7 @@ function renderFilters(){
|
||||
if(used.length>1){const all=node('button','Limpar','btn ghost');all.type='button';all.onclick=clearFilters;tags.push(all);}
|
||||
$('filter-tags').replaceChildren(...tags);
|
||||
$('filter-count').hidden=!used.length;$('filter-count').textContent=String(used.length);
|
||||
const all=used.length+(boardFilter.product?1:0);$('filter-dot').hidden=!all;$('filter-dot').textContent=String(all);
|
||||
$('filter-btn').classList.toggle('on',used.length>0);
|
||||
if(!$('filter-pop').hidden)filterCounts();
|
||||
}
|
||||
@@ -795,6 +799,14 @@ function renderBoard(){
|
||||
// Finished orders are a recent window, not the whole history: the count is the whole.
|
||||
head.append(node('span',String(state==='fin'&&!filtered?Math.max(board.finished_total||0,orders.length):orders.length),'coln'));
|
||||
column.append(head);
|
||||
// The phone's line over the cards: this stage's metres and the session's machine.
|
||||
const sum=node('div',undefined,'msum');const total=node('span');
|
||||
total.append(node('b',state==='fin'?plural(orders.length,'pedido','pedidos'):metres(orders.reduce((t,o)=>t+orderMetres(o),0))),state==='fin'?' recentes':' nesta etapa');
|
||||
sum.append(total);
|
||||
if(myMachine()){const m=node('span',undefined,'right mcell');m.append(node('i',undefined,'mdot'),'Máquina ',node('b',myMachine().name));sum.append(m);}
|
||||
column.append(sum);
|
||||
if(state==='tra'&&may('print')&&orders.length){
|
||||
const dl=button('Baixar os arquivos da fila',downloadQueue,'btn mdl');dl.prepend(svgIcon(IC.download,'i m'));column.append(dl);}
|
||||
if(state==='imp')column.append(...printingLanes(orders));
|
||||
else if(state==='fin')column.append(...orders.map(miniCard));
|
||||
else column.append(...orders.map((o,i)=>card(o,state==='tra'?queuePlace(o,orders):null)));
|
||||
@@ -1114,6 +1126,76 @@ function dropField(input,{title='Arraste o arquivo para cá',hint=''}={}){
|
||||
return l;
|
||||
}
|
||||
|
||||
// ---- Phone (the design canvas' phone screens) -------------------------------
|
||||
|
||||
// Under 700 px the Kanban is the phone mockup: sections at the bottom, menus
|
||||
// and filters as sheets from the bottom, the order and the quote as pages.
|
||||
const PHONE=matchMedia('(max-width:700px)');
|
||||
PHONE.addEventListener('change',()=>{if(board)render();});
|
||||
// A sheet from the bottom: the grab, then what it holds. Escape or the scrim closes.
|
||||
function sheet(parts,{label='',role='dialog',onclose}={}){
|
||||
const scrim=node('div',undefined,'mscrim');
|
||||
const box=node('div',undefined,'msheet');box.setAttribute('role',role);if(label)box.setAttribute('aria-label',label);
|
||||
box.append(node('span',undefined,'grab'),...parts);
|
||||
const entry={box,host:document.body,close(){const i=MODALS.indexOf(entry);if(i<0)return;MODALS.splice(i,1);scrim.remove();box.remove();onclose?.();}};
|
||||
scrim.onclick=()=>entry.close();
|
||||
MODALS.push(entry);document.body.append(scrim,box);return entry;
|
||||
}
|
||||
// A row of a phone sheet: an icon, the words, and maybe something on the right.
|
||||
function mrow(d,text,fn,className='mrow',end=null){
|
||||
const b=node('button',undefined,className);b.type='button';b.setAttribute('role','menuitem');
|
||||
b.append(svgIcon(d),node('span',text,'mtext'),...(end?[end]:[]));
|
||||
b.onclick=async()=>{try{await fn();}catch(e){say(e.message,true);}};return b;
|
||||
}
|
||||
// "Mais": who is signed in, the sections that do not fit the bar, the machine,
|
||||
// the theme, the password and Sair.
|
||||
function phoneMenu(){
|
||||
let m=null;
|
||||
const go=fn=>async()=>{m.close();await fn();};
|
||||
const who=node('div',undefined,'who sheetwho'),words=node('span');
|
||||
const ava=node('span',initialsOf(ME.name||ME.email),'ava');ava.append(node('i',undefined,'pres on'));
|
||||
words.append(node('b',ME.name||ME.email),node('span',(ROLE_NAMES[ME.role]||ME.role)+(myMachine()?', na '+myMachine().name:''),'sub'));
|
||||
who.append(ava,words);
|
||||
const rows=[];
|
||||
if(TAB_NEEDS.integrations()){const n=$('badge-integrations').textContent;
|
||||
rows.push(mrow(IC.link,'Integrações',go(()=>showTab('integrations')),'mrow',n?statePill(n,'warn'):null));}
|
||||
if(TAB_NEEDS.users())rows.push(mrow(IC.user,'Usuários',go(()=>showTab('users'))));
|
||||
if(ME.machine_question)rows.push(mrow(IC.printer,'Trocar de máquina',go(()=>askMachine(true)),'mrow',node('span',myMachine()?.name||'','lbl')));
|
||||
const light=kanbanTheme.get()==='light';
|
||||
rows.push(mrow(light?ICON_MOON:ICON_SUN,light?'Mudar para o modo escuro':'Mudar para o modo claro',go(()=>{kanbanTheme.toggle();paintThemeToggle();})));
|
||||
rows.push(mrow(IC.key,'Trocar a senha',go(accountForm)));
|
||||
rows.push(mrow(IC.logout,'Sair',go(()=>$('logout').click()),'mrow bad'));
|
||||
const body=node('div',undefined,'sbody');body.append(...rows);
|
||||
m=sheet([who,body],{label:'Mais',role:'menu'});
|
||||
}
|
||||
// The board's filters on the phone: every kind, the product too, and how many
|
||||
// orders they show.
|
||||
function phoneFilters(){
|
||||
const kinds=[{key:'product',label:'Produto',options:PRODUCTS.filter(([v])=>v)},...filterKinds()];
|
||||
const body=node('div',undefined,'sbody');
|
||||
const show=node('button','','btn pri');show.type='button';
|
||||
const paint=()=>{
|
||||
body.replaceChildren(...kinds.map(kind=>{
|
||||
const group=node('div',undefined,'fgroup'),opts=node('div',undefined,'fopts');
|
||||
for(const [value,text] of kind.options){
|
||||
const on=boardFilter[kind.key]===value;
|
||||
const b=node('button',text,'fopt'+(on?' on':''));b.type='button';b.setAttribute('aria-pressed',String(on));
|
||||
b.append(node('span',String(filterCount({...boardFilter,[kind.key]:value})),'n'));
|
||||
b.onclick=()=>{boardFilter[kind.key]=on?'':value;renderBoard();paint();};opts.append(b);
|
||||
}
|
||||
group.append(node('span',kind.label),opts);return group;}));
|
||||
show.textContent='Ver '+plural(filterCount(boardFilter),'pedido','pedidos');
|
||||
};
|
||||
const close=iconButton(IC.close,'Fechar',()=>m.close(),'mic right');
|
||||
const head=node('div',undefined,'shead');head.append(node('b','Filtros'),close);
|
||||
const clear=node('button','Limpar','btn');clear.type='button';clear.onclick=()=>{for(const k in boardFilter)boardFilter[k]='';renderBoard();paint();};
|
||||
const foot=node('div',undefined,'sfoot');foot.append(clear,show);
|
||||
const m=sheet([head,body,foot],{label:'Filtros'});show.onclick=()=>m.close();
|
||||
paint();
|
||||
}
|
||||
$('more-nav').onclick=()=>phoneMenu();
|
||||
$('filter-open').onclick=()=>phoneFilters();
|
||||
|
||||
// ---- Order panel ---------------------------------------------------------
|
||||
|
||||
// The panel's tab stays while the same order is open.
|
||||
@@ -1169,6 +1251,11 @@ function renderPanel(order){
|
||||
if(at>=0&&i<at)li.classList.add('done');if(i===at)li.classList.add('now');steps.append(li);}
|
||||
if(order.state==='cor')steps.classList.add('paused');
|
||||
const head=node('div',undefined,'dhead');head.append(top,sub,steps);
|
||||
// The phone's head: back, the order and where it is, its menu.
|
||||
const mhead=node('div',undefined,'mhead phone'),mt=node('span',undefined,'t');
|
||||
mt.append(node('b','#'+order.number+' '+who.title),node('span',(order.cancelled_at?'Cancelado':stateName(order.state))+', '+money(s.total_cents)+(isTest(order)?' de teste':' pago')));
|
||||
const phoneMore=moreMenu(order,'mic');
|
||||
mhead.append(iconButton(IC.left,'Voltar',closePanel,'mic'),mt,...(phoneMore?[phoneMore]:[]));
|
||||
|
||||
const body=node('div',undefined,'dbody');
|
||||
if(order.cancelled_at)body.append(cancelledNotice(order));
|
||||
@@ -1187,16 +1274,28 @@ function renderPanel(order){
|
||||
for(const [key,view] of Object.entries(views))view.hidden=key!==panelTab;};
|
||||
paintTabs();
|
||||
body.append(tabs,...Object.values(views));
|
||||
// On the phone the order is one page; its files and history open as sheets.
|
||||
let fileRows=null,historyRows=null;
|
||||
const mbtns=node('div',undefined,'mbtns phone');
|
||||
const zap=whatsappLink(s.customer.zap);
|
||||
if(zap){const a=node('a','WhatsApp','btn');a.href=zap;a.target='_blank';a.rel='noopener noreferrer';a.prepend(svgIcon(IC.chat,'i m'));mbtns.append(a);}
|
||||
const sheetOf=(title,fill)=>()=>{const box=node('div',undefined,'sbody pad');fill(box);
|
||||
const m=sheet([sheetHead(title,()=>m.close()),box],{label:title});};
|
||||
const files=node('button','Arquivos','btn');files.type='button';files.onclick=sheetOf('Arquivos',box=>fileRows?filesView(order,fileRows,box):box.append(node('p','Carregando…','lbl')));
|
||||
const hist=node('button','Histórico','btn');hist.type='button';hist.onclick=sheetOf('Histórico',box=>historyRows?historyView(order,historyRows,box):box.append(node('p','Carregando…','lbl')));
|
||||
mbtns.append(files,hist);body.append(mbtns);
|
||||
// A re-render keeps where the body was scrolled.
|
||||
const scrolled=panel.querySelector('.dbody')?.scrollTop||0;
|
||||
panel.replaceChildren(head,body);body.scrollTop=scrolled;
|
||||
panel.replaceChildren(mhead,head,body);body.scrollTop=scrolled;
|
||||
|
||||
api('/orders/'+order.id+'/files').then(rows=>{if(token!==openToken)return;filesView(order,rows,views.files);
|
||||
api('/orders/'+order.id+'/files').then(rows=>{if(token!==openToken)return;fileRows=rows;filesView(order,rows,views.files);
|
||||
tabs.querySelector('[data-ptab=files] .n').textContent=rows.length?String(rows.length):'';}).catch(e=>say(e.message,true));
|
||||
api('/orders/'+order.id+'/history').then(rows=>{if(token===openToken)historyView(order,rows,views.history);}).catch(e=>say(e.message,true));
|
||||
api('/orders/'+order.id+'/history').then(rows=>{if(token===openToken){historyRows=rows;historyView(order,rows,views.history);}}).catch(e=>say(e.message,true));
|
||||
}
|
||||
// A phone sheet's title line with its close button.
|
||||
function sheetHead(title,close){const h=node('div',undefined,'shead');h.append(node('b',title),iconButton(IC.close,'Fechar',close,'mic right'));return h;}
|
||||
// The order's own menu: the rare things, some of them destructive.
|
||||
function moreMenu(order){
|
||||
function moreMenu(order,buttonClass='btn sq ghost'){
|
||||
const items=[];
|
||||
const item=(d,text,fn,className='menuitem')=>{const b=node('button',undefined,className);b.type='button';b.setAttribute('role','menuitem');
|
||||
b.append(svgIcon(d,'i m'),text);b.onclick=async e=>{e.stopPropagation();menu.hidden=true;try{await fn();}catch(err){say(err.message,true);}};items.push(b);return b;};
|
||||
@@ -1218,7 +1317,7 @@ function moreMenu(order){
|
||||
const last=items.at(-1);if(last.classList.contains('bad')&&items.length>1)items.splice(-1,0,node('div',undefined,'menusep'));
|
||||
menu.append(...items);
|
||||
const b=iconButton(IC.more,'Mais ações',()=>{menu.hidden=!menu.hidden;b.setAttribute('aria-expanded',String(!menu.hidden));
|
||||
if(!menu.hidden)document.addEventListener('click',()=>{menu.hidden=true;b.setAttribute('aria-expanded','false');},{once:true});});
|
||||
if(!menu.hidden)document.addEventListener('click',()=>{menu.hidden=true;b.setAttribute('aria-expanded','false');},{once:true});},buttonClass);
|
||||
b.setAttribute('aria-haspopup','menu');b.setAttribute('aria-expanded','false');
|
||||
const wrap=node('span',undefined,'morewrap');wrap.append(b,menu);return wrap;
|
||||
}
|
||||
@@ -1567,7 +1666,20 @@ function orderView(order){
|
||||
if(order.reworks?.length)view.append(reworkSection(order));
|
||||
return view;
|
||||
}
|
||||
// On the phone: one row per fact, the label on the left.
|
||||
function phoneFacts(order){
|
||||
const s=order.snapshot, dest=s.destination, who=buyer(s);
|
||||
const box=node('div',undefined,'mblock mfacts');
|
||||
const row=(k,v)=>{if(!v)return;const r=node('div',undefined,'mfact');r.append(node('span',k),node('b',v));box.append(r);};
|
||||
row('Cliente',who.title);row('E-mail',s.customer.mail);row(docKind(s.customer.cnpj),cnpj(s.customer.cnpj));
|
||||
row('Entrega',dest?dest.city+'/'+dest.state:'Retirada em Franca');
|
||||
row('Máquina',order.machine?.name||'Nenhuma');row('Código','DTF-'+order.number+', cliente '+orderCode(order.id));
|
||||
// Choosing the machine stays where it is allowed.
|
||||
if(may('print')&&ME?.role!=='operador'&&board.machines?.length){const m=machineCard(order).querySelector('select');if(m)box.append(m);}
|
||||
return box;
|
||||
}
|
||||
function orderFacts(order){
|
||||
if(PHONE.matches)return phoneFacts(order);
|
||||
const s=order.snapshot, dest=s.destination, who=buyer(s);
|
||||
const grid=node('div',undefined,'facts3');
|
||||
const client=node('div',undefined,'fact');
|
||||
@@ -1898,6 +2010,15 @@ function renderUsers(){
|
||||
node('td',u.last_login_at?ago(u.last_login_at):'nunca entrou','muted'),open);
|
||||
return tr;
|
||||
}));
|
||||
// On the phone, a list of people, each a row that opens them.
|
||||
const list=$('users-phone');list.replaceChildren(...users.map(u=>{
|
||||
const editable=u.role!=='superadmin'||ME.role==='superadmin';
|
||||
const row=node('button',undefined,'mli');row.type='button';row.disabled=!editable;if(editable)row.onclick=()=>userForm(u);
|
||||
const words=node('span',undefined,'grow'),sub=node('span',undefined,'sub mcell');
|
||||
sub.append(ROLE_NAMES[u.role]+(u.active?'':', desativado'));
|
||||
if(u.machines.length){sub.append(node('i',undefined,'mdot'),u.machines.map(machineName).join(', '));}
|
||||
words.append(node('b',u.name||u.email),sub);
|
||||
row.append(avatar(u),words,svgIcon(IC.right,'i m'));return row;}));
|
||||
const head=node('tr');head.append(node('th',''));for(const r of ROLE_COLUMNS)head.append(node('th',ROLE_NAMES[r]));
|
||||
for(const th of head.children)th.scope='col';head.firstChild.append(node('span','Ação','vh'));
|
||||
const thead=node('thead');thead.append(head);const tbody=node('tbody');
|
||||
@@ -2198,7 +2319,8 @@ function statsChart(box,daily){
|
||||
if(avg>0){const a=node('span',undefined,'avg');a.style.bottom=100*avg/ceiling+'%';plot.append(a);}
|
||||
const bars=node('div',undefined,'bars'),axis=node('div',undefined,'axis');axis.setAttribute('aria-hidden','true');
|
||||
bars.style.gridTemplateColumns=axis.style.gridTemplateColumns='repeat('+daily.length+',minmax(0,1fr))';
|
||||
const every=Math.ceil(daily.length/10);
|
||||
// A phone has room for fewer dates under the bars.
|
||||
const every=Math.ceil(daily.length/(PHONE.matches?5:10));
|
||||
daily.forEach((d,i)=>{
|
||||
const b=node('span',undefined,'bar'+(d.day===today?' now':''));b.style.height=(d.metres>0?Math.max(1,100*d.metres/ceiling):0)+'%';
|
||||
b.style.animationDelay=Math.min(i*12,400)+'ms';
|
||||
@@ -2303,7 +2425,8 @@ function renderQuotes(){
|
||||
// Approved by the Site is the rule; only a person's review is worth a word.
|
||||
if(pay||q.approved&&!q.auto_approved){const line=node('span',undefined,'qpay');
|
||||
if(pay)line.append(pay);if(q.approved&&!q.auto_approved)line.append(badge('Revisada pela equipe',''));main.append(line);}
|
||||
b.append(artBox(items,'qthumb'),main);b.onclick=()=>{currentQuote=q;renderQuotes();};return b;
|
||||
b.append(artBox(items,'qthumb'),main);
|
||||
b.onclick=()=>{currentQuote=q;$('tab-quotes').classList.toggle('reviewing',PHONE.matches);renderQuotes();};return b;
|
||||
});
|
||||
const filtered=quoteQuery||quoteProduct||quoteLayout||quoteFlag;
|
||||
if(!list.length)list.push(node('p',filtered?'Nenhuma cotação com esses filtros.':
|
||||
@@ -2312,13 +2435,23 @@ function renderQuotes(){
|
||||
$('quote-pager').replaceChildren(...(quoteTotal?[pager({page:quotePage,size:quoteSize,total:quoteTotal,noun:'cotações',compact:true,fixedSize:true,
|
||||
onPage:n=>{quotePage=n;quoteFitting=0;loadQuotes().catch(e=>say(e.message,true));}})]:[]));
|
||||
requestAnimationFrame(fitQuotes);
|
||||
$('reviews').replaceChildren(...(currentQuote?review(currentQuote):[emptyState(IC.file,'Selecione uma cotação','A revisão dela abre aqui.')]));
|
||||
if(!currentQuote)$('tab-quotes').classList.remove('reviewing');
|
||||
$('reviews').replaceChildren(...(currentQuote?[quoteHead(currentQuote),...review(currentQuote)]:[emptyState(IC.file,'Selecione uma cotação','A revisão dela abre aqui.')]));
|
||||
}
|
||||
// A page or a pane with nothing to show: a mark, a line, and what to do.
|
||||
function emptyState(d,title,text){
|
||||
const box=node('div',undefined,'emptystate'),ico=node('span',undefined,'dropico');ico.append(svgIcon(d));
|
||||
box.append(ico,node('b',title),...(text?[node('span',text)]:[]));return box;
|
||||
}
|
||||
// The phone's head of a quote's page: back to the list, who, and WhatsApp.
|
||||
function quoteHead(quote){
|
||||
const h=node('div',undefined,'mhead phone'),t=node('span',undefined,'t'),who=buyer(quote.draft);
|
||||
t.append(node('b',who.title),node('span',productLine(quote.draft.items)+', recebida '+ago(quote.created_at)));
|
||||
h.append(iconButton(IC.left,'Voltar',()=>$('tab-quotes').classList.remove('reviewing'),'mic'),t);
|
||||
const zap=whatsappLink(quote.draft.customer.zap);
|
||||
if(zap){const a=node('a',undefined,'mic');a.href=zap;a.target='_blank';a.rel='noopener noreferrer';a.setAttribute('aria-label','WhatsApp');a.append(svgIcon(IC.chat));h.append(a);}
|
||||
return h;
|
||||
}
|
||||
const QUOTE_STATUS={pending_review:['A revisar','warn'],approved:['Aprovada, aguardando pagamento','ok'],expired:['Expirada','bad'],paid:['Paga','ok']};
|
||||
function review(quote){
|
||||
const head=node('div',undefined,'rhead');head.dataset.quote=quote.id;
|
||||
@@ -2573,6 +2706,20 @@ function renderIssues(){
|
||||
issueState==='open'?'Quando um pagamento precisar de alguém, ele aparece aqui.':''));
|
||||
return;
|
||||
}
|
||||
// On the phone each payment is a card.
|
||||
if(PHONE.matches){
|
||||
$('payments').replaceChildren(tools,...issueRows.map(issue=>{
|
||||
const card=node('div',undefined,'mblock pcard'),refused=issue.outcome.startsWith('refused');
|
||||
const top=node('div',undefined,'prow');top.append(issue.resolved_at?statePill('Resolvido','ok'):statePill(refused?'Recusado':'Atenção',refused?'bad':'warn'),node('span',when(issue.received_at),'lbl right'));
|
||||
const mid=node('div',undefined,'prow base');
|
||||
mid.append(node('b',issue.reference?'Cotação '+String(issue.reference).slice(0,8):'Sem cotação','grow'),node('b',issue.amount_cents==null?'Sem valor':money(issue.amount_cents)));
|
||||
card.append(top,mid,node('span',issue.provider+', evento '+issue.event_id,'sub'),node('p',outcomeText(issue.outcome),'nnote'));
|
||||
if(issue.resolved_at)card.append(node('span','Por '+issue.resolved_by+' em '+when(issue.resolved_at)+': '+issue.resolution,'sub'));
|
||||
else if(may('manage'))card.append(button('Registrar resolução',async()=>resolveDialog(issue),'btn wide'));
|
||||
return card;}),pager({page:issuePage,size:issueSize,total:issueTotal,noun:'pagamentos',compact:true,fixedSize:true,
|
||||
onPage:n=>{issuePage=n;loadIssues().catch(e=>say(e.message,true));}}));
|
||||
return;
|
||||
}
|
||||
const table=node('table',undefined,'table');
|
||||
const head=node('tr');for(const [t,c] of [['Quando'],['O que aconteceu'],['Referência'],['Valor pago','r'],['']]){const th=node('th',t,c);th.scope='col';head.append(th);}
|
||||
const thead=node('thead');thead.append(head);const tbody=node('tbody');
|
||||
@@ -2760,6 +2907,7 @@ for(const b of document.querySelectorAll('[data-tab]'))b.onclick=()=>showTab(b.d
|
||||
// ---- Search: orders (any stage) and unpaid quotes ---------------------------
|
||||
|
||||
// On a phone the search is behind a button, and opens over the top bar.
|
||||
$('search-back').onclick=()=>{$('search').value='';closeSearch();document.querySelector('.top').classList.remove('searching');$('search-open').setAttribute('aria-expanded','false');};
|
||||
$('search-open').onclick=()=>{const on=document.querySelector('.top').classList.toggle('searching');
|
||||
$('search-open').setAttribute('aria-expanded',String(on));if(on)$('search').focus();};
|
||||
|
||||
@@ -2785,7 +2933,7 @@ function hitRow(items,title,sub,meta,state,tone,open){
|
||||
const text=node('span',undefined,'rtext');text.append(node('b',title),node('span',sub,'sub'),node('span',meta,'rmeta'));
|
||||
el.append(artBox(items,'qthumb rart'),text,badge(state,tone));
|
||||
el.onmousedown=e=>e.preventDefault();
|
||||
el.onclick=()=>{closeSearch();open();};
|
||||
el.onclick=()=>{closeSearch();document.querySelector('.top').classList.remove('searching');open();};
|
||||
return {el,open};
|
||||
}
|
||||
function orderHit(order){
|
||||
@@ -2820,7 +2968,7 @@ $('search').onkeydown=e=>{
|
||||
}
|
||||
if(e.key==='Enter'){e.preventDefault();const hit=searchHits[Math.max(0,searchAt)];closeSearch();hit.open();}
|
||||
};
|
||||
$('search').onblur=()=>setTimeout(()=>{closeSearch();if(!$('search').value.trim())document.querySelector('.top').classList.remove('searching');},150);
|
||||
$('search').onblur=()=>setTimeout(()=>{closeSearch();if(!$('search').value.trim()&&!PHONE.matches)document.querySelector('.top').classList.remove('searching');},150);
|
||||
$('search').onfocus=()=>{if($('search').value.trim().length>=2&&searchHits.length){$('search-results').hidden=false;$('search').setAttribute('aria-expanded','true');}};
|
||||
// "/" jumps to the search, as the field shows, unless typing somewhere else.
|
||||
document.addEventListener('keydown',e=>{
|
||||
|
||||
Reference in New Issue
Block a user