git.alexw.nyc home about git garden
    1
    2
    3
    4
    5
    6
    7
    8
    9
   10
   11
   12
   13
   14
   15
   16
   17
   18
   19
   20
   21
   22
   23
   24
   25
   26
   27
   28
   29
   30
   31
   32
   33
   34
   35
   36
   37
   38
   39
   40
   41
   42
   43
   44
   45
   46
   47
   48
   49
   50
   51
   52
   53
   54
   55
   56
   57
   58
   59
   60
   61
   62
   63
   64
   65
   66
   67
   68
   69
   70
   71
   72
   73
   74
   75
   76
   77
   78
{{$authUser := .AuthUser.Username}}
{{template "header" .}}
<h1>Managing
  <a href="//{{.AuthUser.Username}}.{{.Config.Host}}">
    {{.AuthUser.Username}}.{{.Config.Host}}
  </a>
</h1>
{{template "nav.html" .}}
<br>
For some help building your site, check out the <a href="https://admin.flounder.online/tips_and_tricks.gmi">Tips and Tricks</a> page.
<br>
<br>
<h3>Your files:</h3>
{{ define "file" }}
<tr>{{ if gt (len .Children) 0 }}
  <td colspan="3">
  <details>
    <summary>
      <a href="//{{.Creator}}.{{.Host}}/{{.Name}}">{{.Name}}/</a>
    </summary>
    <table>
    {{ range .Children }}
    {{ template "file" . }}
    {{ end }}
    </table>
  </details>
  </td>
  {{ else }}
  <td>
    <a href="//{{.Creator}}.{{.Host}}/{{.Name}}">
      {{ if hasSuffix .Name  "index.gmi" }}
      <b>{{ .Name }}</b>
      {{ else }}
      {{ .Name }}
      {{ end }} </a>
  </td>
  <td>
  <a href="/edit/{{.Name}}">edit</a>
  </td>
  <td>
  <form action="/delete/{{.Name}}" method="POST" class="inline">
    <input
      class="button delete"
      type="submit"
      onclick="return confirm('Are you sure you want to delete this file?');"
      value="delete"
    />
    </form>
  {{ end }}
  </td></tr>
{{ end }}
<table>
{{ range .Files }}
{{ template "file" . }}
{{ end }}
</table>
<h3>Create file by name:</h3>
<noscript>Create a new page by going to /edit/[filename]</noscript>
<input type="text" id="edit_new" size=32 placeholder="e.g. newfile.gmi or folder/newfile.gmi">
<a href="#" id="create_new">Edit new file</a><br>
<script>
  var input = document.getElementById('edit_new')
  var create = document.getElementById('create_new')
  create.href = '/edit/' + input.value
  input.onchange = input.onkeyup = function () {
    create.href = '/edit/' + input.value
  }
</script>
<br />
<a href="/edit/gemlog/{{.CurrentDate}}.gmi">New Gemlog Post</a>
<br />
<br />
<form action="/upload" enctype="multipart/form-data" method="POST">
  <input type="file" id="myFile" name="file" multiple />
  <input type="submit" value="Upload file" class="button" />
</form>
<br>
{{template "footer" .}}