gr filetree hard
This commit is contained in:
@@ -153,11 +153,11 @@
|
||||
</span>
|
||||
<span id="titlePath">
|
||||
/
|
||||
{{ if ne .PID "" }}
|
||||
<a href="/ui/files/{{ .PID }}">{{ .PTitle }}</a> /
|
||||
{{ if ne .This.PID "" }}
|
||||
<a href="/ui/files/{{ .This.PID }}">{{ .This.PTitle }}</a> /
|
||||
{{ end }}
|
||||
</span>
|
||||
<span id="title" class="thic_flex" contenteditable>{{ .Title }}</span>
|
||||
<span id="title" class="thic_flex" contenteditable>{{ .This.Title }}</span>
|
||||
<span class="l_buffer">
|
||||
<form action="#" onsubmit="return confirm('are you sure?') && deleteFile();"> <!-- TODO -->
|
||||
<input class="button-error lil_btn" type="submit" value="DELETE"/>
|
||||
|
||||
@@ -1,9 +1,45 @@
|
||||
{{ define "_filetree" }}
|
||||
<div>
|
||||
My file tree
|
||||
<!-- TODO {{ .Branches }} -->
|
||||
{{ range $key, $value := .Branches }}
|
||||
<!-- TODO {{ $key }}{{ $value }} -->
|
||||
{{ $filetreeLevel := 0 }}
|
||||
|
||||
{{ define "_filetreeLevelUpOpen" }}
|
||||
{{ if gt .Level $filetreeLevel }}
|
||||
<details>
|
||||
{{ $filetreeLevel = $filetreeLevel + 1 }}
|
||||
{{ template "_filetreeLevelUpOpen" . }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ define "_filetreeCloseAll" }}
|
||||
{{ if lt 0 $filetreeLevel }}
|
||||
</details>
|
||||
{{ $filetreeLevel = $filetreeLevel - 1 }}
|
||||
{{ template "_filetreeCloseAll" . }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ define "_filetreeLevelDownOpen" }}
|
||||
{{ if lt .Level $filetreeLevel }}
|
||||
</details>
|
||||
{{ $filetreeLevel = $filetreeLevel - 1 }}
|
||||
{{ template "_filetreeLevelDownOpen" . }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ define "_filetreeRecurse" }}
|
||||
<plaintext>
|
||||
{{ range . }}
|
||||
{{ template "_filetreeLevelUpOpen" . }}
|
||||
{{ template "_filetreeLevelDownOpen" . }}
|
||||
<details>
|
||||
<summary>
|
||||
<a href="/files/{{ .ID }}">{{ .Title }}</a>
|
||||
</summary>
|
||||
{{ end }}
|
||||
{{ template "_filetreeLevelDownOpen" . }}
|
||||
{{ end }}
|
||||
|
||||
{{ define "_filetree" }}
|
||||
input = {{ . }}
|
||||
<div>
|
||||
{{ template "_filetreeRecurse" .Tree }}
|
||||
</div>
|
||||
{{ end }}
|
||||
|
||||
@@ -14,4 +14,57 @@
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/water.css@2/out/light.css">
|
||||
<link rel="stylesheet" href="https://cdn.simplecss.org/simple.min.css">
|
||||
-->
|
||||
<style>
|
||||
html, body {
|
||||
background-color: #f8f8f8;
|
||||
}
|
||||
.lr_fullscreen {
|
||||
width: 90%;
|
||||
max-width: 1024px;
|
||||
margin-right: auto;
|
||||
margin-left: auto;
|
||||
}
|
||||
.tb_fullscreen {
|
||||
margin-top: 1em;
|
||||
}
|
||||
.columns {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
}
|
||||
.rows {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
.thic_flex {
|
||||
text-align: left;
|
||||
flex-grow: 1;
|
||||
}
|
||||
.mia {
|
||||
display: none;
|
||||
}
|
||||
.align_left {
|
||||
text-align: left;
|
||||
}
|
||||
.tb_buffer {
|
||||
margin-top: 1em;
|
||||
margin-bottom: 1em;
|
||||
}
|
||||
.r_buffer {
|
||||
margin-right: 1em;
|
||||
}
|
||||
.l_buffer {
|
||||
margin-left: 1em;
|
||||
}
|
||||
.monospace {
|
||||
font-family: Consolas,Monaco,Lucida Console,Liberation Mono,DejaVu Sans Mono,Bitstream Vera Sans Mono,Courier New, monospace;
|
||||
}
|
||||
.lil_btn {
|
||||
width: initial;
|
||||
display: inline-block;
|
||||
}
|
||||
input, label, textarea {
|
||||
margin: initial;
|
||||
}
|
||||
</style>
|
||||
{{ end }}
|
||||
|
||||
Reference in New Issue
Block a user