Make progress on nested folder template
alex wennerberg alex@alexwennerberg.com
Fri, 13 Nov 2020 01:07:26 -0800
1 files changed,
13 insertions(+),
8 deletions(-)
jump to
M
templates/my_site.html
→
templates/my_site.html
@@ -8,24 +8,25 @@ </a>
</h1> {{template "nav.html" .}} <h3>Your files:</h3> -<table> -{{ range .Files }} +{{ define "file" }} <tr> <div> - {{ if .Children }} - <td> + {{ if gt (len .Children) 0 }} + <td colspan="3"> <details> <summary> {{.Name}}/ </summary> + <table> {{ range .Children }} - {{.Name}} + {{ template "file" . }} {{ end }} + </table> </details> </td> {{ else }} <td> - <a href="//{{$authUser}}.{{$domain}}/{{.Name}}"> + <a href="//authUser.domain/{{.Name}}"> {{ .Name }}</a> </td> <td>@@ -41,11 +42,15 @@ type="submit"
onclick="return confirm('Are you sure you want to delete this file?');" value="delete" /> - </td> + </form> {{ end }} - </form> + </td> </div> </tr> +{{ end }} +<table> +{{ range .Files }} +{{ template "file" . }} {{ end }} </table> <h3>Create file by name:</h3>