Initial commit
This commit is contained in:
@@ -0,0 +1,393 @@
|
||||
{{define "admin_head"}}
|
||||
<!doctype html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>{{.PageTitle}} - 管理后台</title>
|
||||
<style>
|
||||
:root {
|
||||
--bg: #f6f7f4;
|
||||
--panel: #ffffff;
|
||||
--line: #dfe5dd;
|
||||
--text: #1d2b27;
|
||||
--muted: #687873;
|
||||
--accent: #0f6f63;
|
||||
--accent-dark: #0a5148;
|
||||
--warn: #a63f2d;
|
||||
--ok: #2f7d51;
|
||||
}
|
||||
* { box-sizing: border-box; }
|
||||
body {
|
||||
margin: 0;
|
||||
background: var(--bg);
|
||||
color: var(--text);
|
||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
|
||||
font-size: 14px;
|
||||
line-height: 1.5;
|
||||
}
|
||||
a { color: inherit; text-decoration: none; }
|
||||
.topbar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 18px;
|
||||
min-height: 64px;
|
||||
padding: 0 28px;
|
||||
border-bottom: 1px solid var(--line);
|
||||
background: rgba(255, 255, 255, 0.92);
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 2;
|
||||
}
|
||||
.brand {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
min-height: 40px;
|
||||
font-size: 18px;
|
||||
font-weight: 700;
|
||||
}
|
||||
.ghost-button {
|
||||
border: 1px solid transparent;
|
||||
border-radius: 6px;
|
||||
padding: 8px 12px;
|
||||
background: transparent;
|
||||
color: var(--muted);
|
||||
font: inherit;
|
||||
cursor: pointer;
|
||||
}
|
||||
.ghost-button:hover { color: var(--accent-dark); }
|
||||
.logout-form {
|
||||
margin: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
}
|
||||
.session-name {
|
||||
color: var(--muted);
|
||||
font-size: 13px;
|
||||
}
|
||||
.shell {
|
||||
width: auto;
|
||||
max-width: none;
|
||||
margin: 28px 28px 56px;
|
||||
}
|
||||
.page-title {
|
||||
display: flex;
|
||||
align-items: end;
|
||||
justify-content: space-between;
|
||||
gap: 20px;
|
||||
margin-bottom: 18px;
|
||||
}
|
||||
h1, h2, h3 { margin: 0; line-height: 1.2; }
|
||||
h1 { font-size: 26px; }
|
||||
h2 { font-size: 18px; }
|
||||
h3 { font-size: 15px; }
|
||||
.muted { color: var(--muted); }
|
||||
.panel {
|
||||
background: var(--panel);
|
||||
border: 1px solid var(--line);
|
||||
border-radius: 8px;
|
||||
padding: 20px;
|
||||
margin-bottom: 18px;
|
||||
box-shadow: 0 10px 26px rgba(29, 43, 39, 0.05);
|
||||
}
|
||||
.notice,
|
||||
.error {
|
||||
border-radius: 6px;
|
||||
padding: 10px 12px;
|
||||
margin-bottom: 14px;
|
||||
border: 1px solid;
|
||||
}
|
||||
.error-text {
|
||||
max-width: 300px;
|
||||
overflow: hidden;
|
||||
color: var(--warn);
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.notice {
|
||||
color: var(--ok);
|
||||
border-color: #bcdcc8;
|
||||
background: #eff8f2;
|
||||
}
|
||||
.error {
|
||||
color: var(--warn);
|
||||
border-color: #edc1b7;
|
||||
background: #fff3f0;
|
||||
}
|
||||
.grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(12, minmax(0, 1fr));
|
||||
gap: 12px;
|
||||
}
|
||||
.field { display: flex; flex-direction: column; gap: 6px; }
|
||||
.field label {
|
||||
color: var(--muted);
|
||||
font-size: 12px;
|
||||
font-weight: 650;
|
||||
}
|
||||
input,
|
||||
select,
|
||||
textarea {
|
||||
width: 100%;
|
||||
border: 1px solid #ccd6d1;
|
||||
border-radius: 6px;
|
||||
background: #fff;
|
||||
color: var(--text);
|
||||
font: inherit;
|
||||
padding: 9px 10px;
|
||||
min-height: 38px;
|
||||
}
|
||||
textarea { min-height: 70px; resize: vertical; }
|
||||
input:focus,
|
||||
select:focus,
|
||||
textarea:focus {
|
||||
outline: 2px solid rgba(15, 111, 99, 0.18);
|
||||
border-color: var(--accent);
|
||||
}
|
||||
.span-2 { grid-column: span 2; }
|
||||
.span-3 { grid-column: span 3; }
|
||||
.span-4 { grid-column: span 4; }
|
||||
.span-5 { grid-column: span 5; }
|
||||
.span-6 { grid-column: span 6; }
|
||||
.span-7 { grid-column: span 7; }
|
||||
.span-8 { grid-column: span 8; }
|
||||
.span-9 { grid-column: span 9; }
|
||||
.span-12 { grid-column: span 12; }
|
||||
.actions {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
gap: 10px;
|
||||
margin-top: 14px;
|
||||
}
|
||||
.button {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border: 1px solid var(--accent);
|
||||
border-radius: 6px;
|
||||
min-height: 38px;
|
||||
padding: 8px 14px;
|
||||
background: var(--accent);
|
||||
color: #fff;
|
||||
font: inherit;
|
||||
font-weight: 650;
|
||||
cursor: pointer;
|
||||
}
|
||||
.button.secondary {
|
||||
background: #fff;
|
||||
color: var(--accent-dark);
|
||||
}
|
||||
.button.small {
|
||||
min-height: 28px;
|
||||
padding: 3px 9px;
|
||||
font-size: 12px;
|
||||
line-height: 1.2;
|
||||
}
|
||||
.button.danger {
|
||||
border-color: #c86b5b;
|
||||
background: #fff;
|
||||
color: var(--warn);
|
||||
}
|
||||
.button.disabled {
|
||||
border-color: #ccd6d1;
|
||||
color: #9aa6a1;
|
||||
cursor: default;
|
||||
opacity: 0.72;
|
||||
}
|
||||
.inline-form {
|
||||
margin: 0;
|
||||
}
|
||||
.toolbar {
|
||||
display: flex;
|
||||
align-items: end;
|
||||
justify-content: space-between;
|
||||
gap: 14px;
|
||||
margin-bottom: 14px;
|
||||
}
|
||||
.filter-form {
|
||||
display: flex;
|
||||
align-items: end;
|
||||
flex-wrap: wrap;
|
||||
gap: 10px;
|
||||
}
|
||||
.filter-form input,
|
||||
.filter-form select { min-width: 220px; }
|
||||
.result-summary { margin: -2px 0 12px; }
|
||||
.status-pill {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
border: 1px solid #cdd9d3;
|
||||
border-radius: 999px;
|
||||
padding: 2px 8px;
|
||||
background: #f7faf8;
|
||||
color: var(--accent-dark);
|
||||
font-size: 12px;
|
||||
font-weight: 650;
|
||||
}
|
||||
.status-pill.status-pending {
|
||||
border-color: #f2c94c;
|
||||
background: #fff8db;
|
||||
color: #7a4f00;
|
||||
}
|
||||
.status-pill.status-assigned {
|
||||
border-color: #87b7ff;
|
||||
background: #edf5ff;
|
||||
color: #154b8b;
|
||||
}
|
||||
.status-pill.status-completed {
|
||||
border-color: #7fc99a;
|
||||
background: #edf9f0;
|
||||
color: #17613a;
|
||||
}
|
||||
.status-pill.status-unknown {
|
||||
border-color: #c9c9c9;
|
||||
background: #f5f5f5;
|
||||
color: #555;
|
||||
}
|
||||
.remark-cell {
|
||||
min-width: 180px;
|
||||
max-width: 320px;
|
||||
white-space: normal;
|
||||
}
|
||||
.settings { display: inline-block; }
|
||||
.settings summary { list-style: none; }
|
||||
.settings summary::-webkit-details-marker { display: none; }
|
||||
.settings-form {
|
||||
display: grid;
|
||||
gap: 10px;
|
||||
min-width: 240px;
|
||||
margin-top: 10px;
|
||||
}
|
||||
table {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
background: var(--panel);
|
||||
border: 1px solid var(--line);
|
||||
border-radius: 8px;
|
||||
overflow: hidden;
|
||||
}
|
||||
th,
|
||||
td {
|
||||
border-bottom: 1px solid var(--line);
|
||||
padding: 11px 12px;
|
||||
text-align: left;
|
||||
vertical-align: top;
|
||||
white-space: nowrap;
|
||||
}
|
||||
th {
|
||||
color: var(--muted);
|
||||
background: #eef2ed;
|
||||
font-size: 12px;
|
||||
font-weight: 700;
|
||||
}
|
||||
tr:last-child td { border-bottom: 0; }
|
||||
.table-wrap { overflow-x: auto; }
|
||||
.pagination {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 12px;
|
||||
margin-top: 14px;
|
||||
}
|
||||
.pagination-actions {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
}
|
||||
.category-head {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 16px;
|
||||
margin-bottom: 14px;
|
||||
}
|
||||
.category-actions {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
flex: none;
|
||||
}
|
||||
.project-list {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr;
|
||||
gap: 12px;
|
||||
}
|
||||
.project-form {
|
||||
border: 1px solid var(--line);
|
||||
border-radius: 8px;
|
||||
padding: 14px;
|
||||
background: #fbfcfa;
|
||||
}
|
||||
.image-preview {
|
||||
display: block;
|
||||
width: 96px;
|
||||
height: 72px;
|
||||
object-fit: cover;
|
||||
border: 1px solid var(--line);
|
||||
border-radius: 6px;
|
||||
background: #eef2ed;
|
||||
}
|
||||
.hero-preview {
|
||||
width: 140px;
|
||||
height: 84px;
|
||||
flex: none;
|
||||
}
|
||||
.login-shell {
|
||||
min-height: 100vh;
|
||||
display: grid;
|
||||
place-items: center;
|
||||
padding: 24px;
|
||||
}
|
||||
.login-panel {
|
||||
width: min(420px, 100%);
|
||||
background: var(--panel);
|
||||
border: 1px solid var(--line);
|
||||
border-radius: 8px;
|
||||
padding: 28px;
|
||||
box-shadow: 0 20px 60px rgba(29, 43, 39, 0.12);
|
||||
}
|
||||
.login-panel h1 { margin-bottom: 6px; }
|
||||
.login-panel form { margin-top: 22px; }
|
||||
@media (max-width: 860px) {
|
||||
.brand { padding: 0; white-space: nowrap; }
|
||||
.topbar {
|
||||
min-height: 56px;
|
||||
padding: 0 16px;
|
||||
}
|
||||
.shell { margin: 20px 12px 40px; }
|
||||
.page-title { align-items: flex-start; flex-direction: column; }
|
||||
.toolbar,
|
||||
.filter-form { align-items: stretch; flex-direction: column; }
|
||||
.pagination { align-items: stretch; flex-direction: column; }
|
||||
.pagination-actions { justify-content: flex-start; }
|
||||
.filter-form input,
|
||||
.filter-form select { min-width: 0; }
|
||||
.project-list { grid-template-columns: 1fr; }
|
||||
.span-2,
|
||||
.span-3,
|
||||
.span-4,
|
||||
.span-5,
|
||||
.span-6,
|
||||
.span-7,
|
||||
.span-8,
|
||||
.span-9 { grid-column: span 12; }
|
||||
th,
|
||||
td { padding: 10px; }
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
{{end}}
|
||||
|
||||
{{define "admin_nav"}}
|
||||
<header class="topbar">
|
||||
<a class="brand" href="/admin/price-inquiries">价格咨询派单</a>
|
||||
<form class="logout-form" method="post" action="/admin/logout">
|
||||
<span class="session-name">{{.Username}}</span>
|
||||
{{if .PasswordChangeURL}}<a class="ghost-button" href="{{.PasswordChangeURL}}">修改密码</a>{{end}}
|
||||
<button class="ghost-button" type="submit">退出登录</button>
|
||||
</form>
|
||||
</header>
|
||||
{{end}}
|
||||
Reference in New Issue
Block a user