add i18n for system/home nav editor, improve link manager
This commit is contained in:
1 parent
e8e9b505af
commit
2b4e1dbc57
9 files changed
+517
-52
No files matched your search
@@ -50,11 +50,11 @@
|
||||
</a>
|
||||
|
||||
<a href="#" data-panel="nav-home" onclick="showConfigPanel('nav-home'); return false;">
|
||||
Home Navigation
|
||||
{{ T "config.nav_home" }}
|
||||
</a>
|
||||
|
||||
<a href="#" data-panel="nav-system" onclick="showConfigPanel('nav-system'); return false;">
|
||||
System Navigation
|
||||
{{ T "config.nav_system" }}
|
||||
</a>
|
||||
|
||||
</nav>
|
||||
@@ -196,7 +196,7 @@ Save
|
||||
class="config-section config-panel"
|
||||
>
|
||||
|
||||
<h2>Home Navigation</h2>
|
||||
<h2>{{ T "config.nav_home" }}</h2>
|
||||
|
||||
<form
|
||||
method="post"
|
||||
@@ -288,7 +288,7 @@ Save
|
||||
class="config-section config-panel"
|
||||
>
|
||||
|
||||
<h2>System Navigation</h2>
|
||||
<h2>{{ T "config.nav_system" }}</h2>
|
||||
|
||||
<form
|
||||
method="post"
|
||||
|
||||
@@ -42,7 +42,7 @@ View
|
||||
History
|
||||
</a>
|
||||
|
||||
<a href="/l?object_uuid={{ .ObjectUUID }}">
|
||||
<a href="/l/uuid:{{ .ObjectUUID }}">
|
||||
Links
|
||||
</a>
|
||||
|
||||
|
||||
@@ -0,0 +1,184 @@
|
||||
{{ define "link_manager.gohtml" }}
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>{{ T "link.title" }}</title>
|
||||
<link rel="stylesheet" href="/o/path:/system/static/css/main.css">
|
||||
<link rel="stylesheet" href="/o/path:/system/static/css/modes.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<header class="topbar">
|
||||
|
||||
<div class="brand">
|
||||
<a href="/">{{ .WikiName }}</a>
|
||||
</div>
|
||||
|
||||
<nav>
|
||||
{{ range .NavItems }}
|
||||
<a href="{{ .ResolvedHref }}">{{ .Label }}</a>
|
||||
{{ end }}
|
||||
</nav>
|
||||
|
||||
</header>
|
||||
|
||||
<main class="container">
|
||||
|
||||
<section>
|
||||
|
||||
<h1>{{ T "link.title" }}</h1>
|
||||
|
||||
<p class="muted">
|
||||
{{ T "link.object" }}:
|
||||
<code>{{ .ObjectURI }}</code>
|
||||
</p>
|
||||
|
||||
<table class="link-table">
|
||||
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{{ T "link.primary" }}</th>
|
||||
<th>{{ T "link.path" }}</th>
|
||||
<th>{{ T "link.linked_at" }}</th>
|
||||
<th>{{ T "link.action" }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
|
||||
{{ range .Links }}
|
||||
|
||||
<tr>
|
||||
|
||||
<td>
|
||||
<form method="post" action="/l/uuid:{{ $.ObjectUUID }}">
|
||||
<input type="hidden" name="action" value="primary">
|
||||
<input type="hidden" name="path" value="{{ .Path }}">
|
||||
<input
|
||||
type="radio"
|
||||
name="primary_display"
|
||||
{{ if .IsPrimary }}checked{{ end }}
|
||||
onchange="this.form.submit()"
|
||||
>
|
||||
</form>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<a href="{{ .Path }}">
|
||||
{{ .Path }}
|
||||
</a>
|
||||
</td>
|
||||
|
||||
<td class="mono">
|
||||
{{ formatUnix .CreatedAt }}
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<form
|
||||
method="post"
|
||||
action="/l/uuid:{{ $.ObjectUUID }}"
|
||||
onsubmit="return confirm('Delete link?\n\n{{ .Path }}')"
|
||||
>
|
||||
<input type="hidden" name="action" value="delete">
|
||||
<input type="hidden" name="path" value="{{ .Path }}">
|
||||
<button type="submit">
|
||||
Delete
|
||||
</button>
|
||||
</form>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
|
||||
{{ end }}
|
||||
|
||||
</tbody>
|
||||
|
||||
</table>
|
||||
|
||||
<h2>{{ T "link.add_path" }}</h2>
|
||||
|
||||
<form
|
||||
method="post"
|
||||
action="/l/uuid:{{ .ObjectUUID }}"
|
||||
class="add-link-form"
|
||||
>
|
||||
|
||||
<input type="hidden" name="action" value="add">
|
||||
|
||||
<input
|
||||
name="path"
|
||||
type="text"
|
||||
placeholder="{{ T "link.placeholder" }}"
|
||||
>
|
||||
|
||||
<button type="submit">
|
||||
Add
|
||||
</button>
|
||||
|
||||
</form>
|
||||
|
||||
</section>
|
||||
|
||||
</main>
|
||||
|
||||
<style>
|
||||
|
||||
.link-table {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
margin-top: 1rem;
|
||||
}
|
||||
|
||||
.link-table th {
|
||||
text-align: left;
|
||||
font-weight: normal;
|
||||
color: #888;
|
||||
border-bottom: 1px solid rgba(255,255,255,0.08);
|
||||
padding: 0.45rem 0.35rem;
|
||||
}
|
||||
|
||||
.link-table td {
|
||||
border-bottom: 1px solid rgba(255,255,255,0.035);
|
||||
padding: 0.38rem 0.35rem;
|
||||
}
|
||||
|
||||
.link-table tr:hover {
|
||||
background: rgba(255,255,255,0.025);
|
||||
}
|
||||
|
||||
.add-link-form {
|
||||
display: flex;
|
||||
gap: 0.5rem;
|
||||
margin-top: 0.75rem;
|
||||
}
|
||||
|
||||
.add-link-form input[type="text"] {
|
||||
flex: 1;
|
||||
background: #0b0b0b;
|
||||
color: #eee;
|
||||
border: 1px solid #222;
|
||||
padding: 0.6rem;
|
||||
font-family: monospace;
|
||||
}
|
||||
|
||||
.mono {
|
||||
font-family:
|
||||
"JetBrains Mono",
|
||||
monospace;
|
||||
}
|
||||
|
||||
.muted {
|
||||
color: #777;
|
||||
}
|
||||
|
||||
button {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
{{ end }}
|
||||
Reference in new issue
Block a user