{{define "admin_storage_new.html"}}{{template "base" .}}{{end}}

{{define "content"}}
<section class="app-shell admin-shell" aria-labelledby="admin-storage-new-title">
  <aside class="app-sidebar">
    <nav class="sidebar-nav">
      <a class="sidebar-link" href="/admin">{{template "icon-dashboard" .}}<span>Overview</span></a>
      <a class="sidebar-link" href="/admin/files">{{template "icon-folder" .}}<span>Files</span></a>
      <a class="sidebar-link" href="/admin/users">{{template "icon-user-circle" .}}<span>Users</span></a>
      <a class="sidebar-link" href="/admin/settings">{{template "icon-settings" .}}<span>Settings</span></a>
      <a class="sidebar-link is-active" href="/admin/storage">{{template "icon-database" .}}<span>Storage</span></a>
      <a class="sidebar-link" href="/admin/logs">{{template "icon-database" .}}<span>Logs</span></a>
      <a class="sidebar-link" href="/admin/bans">{{template "icon-settings" .}}<span>Bans</span></a>
    </nav>
    <hr class="sidebar-sep">
    <nav class="sidebar-nav">
      <a class="sidebar-link" href="/app">{{template "icon-home-simple" .}}<span>My Files</span></a>
    </nav>
    <hr class="sidebar-sep">
    <form class="sidebar-logout" action="/admin/logout" method="post">
      <input type="hidden" name="csrf_token" value="{{.CSRFToken}}">
      <button class="button button-outline" type="submit">{{template "icon-log-out" .}}<span>Sign out</span></button>
    </form>
  </aside>

  <div class="app-main">
    <div class="admin-header">
      <div>
        <p class="kicker">Storage provider</p>
        <h1 id="admin-storage-new-title">{{.Data.PageTitle}}</h1>
        <p class="muted-copy">Choose the provider first. A backend keeps its provider forever after creation.</p>
      </div>
      <a class="button button-outline" href="/admin/storage">Back</a>
    </div>

    {{if .Data.Error}}<p class="form-error">{{.Data.Error}}</p>{{end}}

    <div class="storage-type-grid">
      {{range .Data.StorageTypes}}
      <a class="storage-type-option" href="/admin/storage/new/{{.Provider}}">
        {{if eq .Icon "database"}}{{template "icon-database" $}}
        {{else if eq .Icon "folder"}}{{template "icon-folder" $}}
        {{else if eq .Icon "sync"}}{{template "icon-cloud-sync" $}}
        {{else}}{{template "icon-cloud-upload" $}}{{end}}
        <strong>{{.Label}}</strong>
        <span>{{.Description}}</span>
      </a>
      {{end}}
    </div>
  </div>
</section>
{{end}}
