| commit |
ffcb95eac06beca13ad1530f4a961de0f43d43dc52c06310fb00437190467a57
|
|---|---|
| change |
wnzrfrmc
|
| author | dewn <dewn5228@proton.me> |
| committer | dewn <dewn5228@proton.me> |
| date | 2026-03-11 01:35:59 |
| phase | public |
| parents |
c3c5e8ac
|
| signature | Unsigned |
remove emojis from the tree and format changes
--- a/internal/archesrv/templates/srv_repo_tree.html +++ b/internal/archesrv/templates/srv_repo_tree.html @@ -1,34 +1,59 @@ {{ define "title" }}{{.Repo}} — tree{{ end }} {{ define "navextra" }}<a href="/{{.Repo}}">{{.Repo}}</a> <a href="/{{.Repo}}/log">log</a> <a href="/{{.Repo}}/tree">tree</a> <a href="/{{.Repo}}/issues">issues</a> <a href="/{{.Repo}}/stacks">stacks</a> <a href="/{{.Repo}}/wiki">wiki</a>{{ end }} {{ define "srv_repo_tree.html" }}{{ template "head" . }} +<style> +.entry-dir a .folder-icon-open { display: none; } +.entry-dir a:hover .folder-icon { display: none; } +.entry-dir a:hover .folder-icon-open { display: inline; } +</style> <div class="container"> <h1 class="repo-name">{{.Repo}} / tree</h1> <div class="repo-meta"> commit <a href="/{{.Repo}}/commit?id={{.CommitHex}}"><code>{{.ShortHex}}</code></a> </div> <div class="tree-path"> <a href="/{{.Repo}}/tree?id={{.CommitHex}}">/</a> {{ range .PathParts }} / <a href="{{.Link}}">{{.Name}}</a>{{ end }} </div> <table> <thead> <tr> <th>Name</th> <th>Type</th> </tr> </thead> <tbody> {{ range .Entries }} <tr class="{{ if .IsDir }}entry-dir{{ else }}entry-file{{ end }}"> <td> <a href="{{.Link}}">{{ if .IsDir }} -📁 + + <svg class="folder-icon" + xmlns="http://www.w3.org/2000/svg" + width="14" + height="14" + viewBox="0 0 24 24" + style="vertical-align:-2px; + margin-right:4px"> + <path fill="currentColor" d="M4 20q-.825 0-1.412-.587T2 18V6q0-.825.588-1.412T4 4h6l2 2h8q.825 0 1.413.588T22 8v10q0 .825-.587 1.413T20 20zm0-2h16V8h-8.825l-2-2H4zm0 0V6z" /> + </svg> + <svg class="folder-icon-open" + xmlns="http://www.w3.org/2000/svg" + width="14" + height="14" + viewBox="0 0 24 24" + style="vertical-align:-2px; + margin-right:4px; + display:none"> + <path fill="currentColor" d="M4 20q-.825 0-1.412-.587T2 18V6q0-.825.588-1.412T4 4h6l2 2h8q.825 0 1.413.588T22 8H11.175l-2-2H4v12l2.4-8h17.1l-2.575 8.575q-.2.65-.737 1.038T19 20zm2.1-2H19l1.8-6H7.9zm0 0l1.8-6zM4 8V6z" /> + </svg> + {{ end }}{{.Name}}</a> </td> <td style="color: #888; font-size: 12px">{{ if .IsDir }}dir{{ else }}{{.Mode}}{{ end }}</td> </tr> {{ end }} </tbody> </table> </div> {{ template "foot" . }} {{ end }}
--- a/internal/cli/cmd_bookmark.go +++ b/internal/cli/cmd_bookmark.go @@ -1,147 +1,157 @@ package cli import ( "encoding/json" "fmt" "time" "arche/internal/repo" "arche/internal/store" "github.com/spf13/cobra" ) var bookmarkCmd = &cobra.Command{ Use: "bookmark", Short: "Bookmark subcommands", } var bookmarkSetCmd = &cobra.Command{ Use: "set <name> + [commit] ", Short: "Create or update a bookmark pointing to -the +HEAD - + -cu +o -r +r -r + a giv en -t commit", Args: cobra. -Ex +R a -ct +nge Args(1 +, 2 ), RunE: func(cmd *cobra.Command, args []string) error { r := openRepo() defer r.Close() -_ +var commitID [32]byte + if len(args) == 2 { + resolved , +err := resolveRef(r, args[1]) + if err != nil { + return fmt.Errorf("resolve %q: %w", args[1], err) + } + commitID + = resolved + } else { + _, id , err := r.HeadCommit() + if err != nil { + return err
--- a/internal/ui/templates/base.html +++ b/internal/ui/templates/base.html @@ -1,233 +1,236 @@ <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> <title>{{ block "title" . }}Arche{{ end }}</title> <style> * { box-sizing: border-box; margin: 0; padding: 0; } body { font-family: ui-monospace, monospace; font-size: 14px; background: #0d0d0d; color: #d4d4d4; min-height: 100vh; } a { color: #7cb8ff; text-decoration: none; } a:hover { text-decoration: underline; } nav { background: #1a1a1a; border-bottom: 1px solid #333; padding: 8px 16px; display: flex; gap: 16px; align-items: center; } nav .brand { color: #e8c56d; font-weight: bold; font-size: 15px; margin-right: 8px; } nav a { color: #aaa; font-size: 13px; } nav a:hover { color: #d4d4d4; } main { padding: 20px 24px; max-width: 1100px; } h2 { font-size: 15px; color: #e8c56d; margin-bottom: 12px; font-weight: normal; border-bottom: 1px solid #2a2a2a; padding-bottom: 6px; } table { border-collapse: collapse; width: 100%; } th { text-align: left; padding: 6px 10px; border-bottom: 1px solid #2a2a2a; color: #888; font-weight: normal; font-size: 12px; } td { padding: 5px 10px; border-bottom: 1px solid #1e1e1e; vertical-align: top; } tr:hover td { background: #141414; } .hash { color: #888; font-size: 12px; } .phase-draft { color: #7cb8ff; } .phase-public { color: #7ae07a; } .phase-secret { color: #e07a7a; } .added { color: #7ae07a; } .deleted { color: #e07a7a; } .modified { color: #e8c56d; } pre { background: #111; border: 1px solid #252525; padding: 12px; overflow-x: auto; line-height: 1.5; font-size: 13px; } .diff-add { color: #7ae07a; } .diff-del { color: #e07a7a; } .diff-hdr { color: #888; } .badge { display: inline-block; padding: 1px 6px; border-radius: 3px; font-size: 11px; background: #222; color: #aaa; } .info-row { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 14px; font-size: 13px; color: #888; } .info-row span { color: #d4d4d4; } .tree-entry { padding: 4px 10px; border-bottom: 1px solid #1a1a1a; display: flex; gap: 10px; } .tree-entry:hover { background: #141414; } .tree-dir { color: #7cb8ff; } + .tree-dir .folder-icon-open { display: none; } + .tree-dir:hover .folder-icon { display: none; } + .tree-dir:hover .folder-icon-open { display: inline; } .tree-file { color: #d4d4d4; } .status-A { color: #7ae07a; } .status-M { color: #e8c56d; } .status-D { color: #e07a7a; } .empty { color: #555; padding: 20px 0; font-style: italic; } .status-open { color: #7ae07a; } .status-closed { color: #888; } .status-wontfix { color: #e07a7a; } .issue-body { white-space: pre-wrap; background: #111; border: 1px solid #252525; padding: 12px; margin-bottom: 16px; font-size: 13px; line-height: 1.6; } .comment-block { border-left: 3px solid #333; padding: 8px 12px; margin-bottom: 10px; } .comment-meta { font-size: 11px; color: #666; margin-bottom: 4px; } .conflict-box { background: #1a0000; border: 1px solid #e07a7a; padding: 12px; margin-bottom: 16px; } .wiki-content { white-space: pre-wrap; line-height: 1.7; font-size: 13px; } </style> </head> <body> <nav> <span class="brand"> <svg width="16" height="16" viewBox="0 0 128 128" xmlns="http://www.w3.org/2000/svg" style="vertical-align: middle; margin-right: 5px"> <circle cx="64" cy="64" r="48" stroke="#e8c56d" stroke-width="8" fill="none" /> <circle cx="64" cy="64" r="10" fill="#e8c56d" /> </svg> arche </span> <a href="/log">log</a> <a href="/tree">tree</a> <a href="/status">status</a> <a href="/bookmarks">bookmarks</a> <a href="/issues">issues</a> <a href="/wiki">wiki</a> </nav> <main> {{ block "content" . }}{{ end }} </main> </body> </html>
--- a/internal/ui/templates/tree.html +++ b/internal/ui/templates/tree.html @@ -1,25 +1,44 @@ {{ template "base.html" . }} {{ define "title" }}tree {{.ShortHex}}{{ if .TreePath }}/{{.TreePath}}{{ end }} — arche{{ end }} {{define "content"}} <h2> tree / {{ range .PathParts }}<a href="{{.Link}}">{{.Name}}</a> / {{ end }} <span class="hash">{{.ShortHex}}</span> </h2> {{ if .Entries }} <div style="border: 1px solid #252525; border-radius: 3px; overflow: hidden; margin-top: 10px"> {{ range .Entries }} <div class="tree-entry"> {{ if .IsDir }} <span style="color: #555">dir</span> <a href="{{.Link}}" class="tree-dir"> + + <svg class="folder-icon" + xmlns="http://www.w3.org/2000/svg" + width="14" + height="14" + viewBox="0 0 24 24" + style="vertical-align:-2px; + margin-right:4px"> + <path fill="currentColor" d="M4 20q-.825 0-1.412-.587T2 18V6q0-.825.588-1.412T4 4h6l2 2h8q.825 0 1.413.588T22 8v10q0 .825-.587 1.413T20 20zm0-2h16V8h-8.825l-2-2H4zm0 0V6z" /> + </svg> + <svg class="folder-icon-open" + xmlns="http://www.w3.org/2000/svg" + width="14" + height="14" + viewBox="0 0 24 24" + style="vertical-align:-2px; + margin-right:4px"> + <path fill="currentColor" d="M4 20q-.825 0-1.412-.587T2 18V6q0-.825.588-1.412T4 4h6l2 2h8q.825 0 1.413.588T22 8H11.175l-2-2H4v12l2.4-8h17.1l-2.575 8.575q-.2.65-.737 1.038T19 20zm2.1-2H19l1.8-6H7.9zm0 0l1.8-6zM4 8V6z" /> + </svg> + {{.Name}}/</a> {{ else }} <span style="color: #555">{{.Mode}}</span> <a href="{{.Link}}" class="tree-file">{{.Name}}</a> {{ end }} </div> {{ end }} </div> {{ else }} <p class="empty">empty tree</p> {{ end }} {{ end }}