sftpgo/templates/folder.html

75 lines
3.6 KiB
HTML
Raw Normal View History

{{template "base" .}}
{{define "title"}}{{.Title}}{{end}}
{{define "page_body"}}
2021-01-22 18:42:18 +00:00
<div class="card shadow mb-4">
<div class="card-header py-3">
<h6 class="m-0 font-weight-bold text-primary">{{.Title}}</h6>
</div>
2021-01-22 18:42:18 +00:00
<div class="card-body">
{{if .Error}}
<div class="card mb-4 border-left-warning">
<div class="card-body text-form-error">{{.Error}}</div>
</div>
{{end}}
{{if eq .Mode 3}}
<div class="card mb-4 border-left-info">
<div class="card-body">
Generate a data provider independent JSON file to create new folders or update existing ones.
<br>
The following placeholder is supported:
<br><br>
<ul>
<li><span class="text-success">%name%</span> will be replaced with the specified folder name</li>
</ul>
The generated folders file can be imported from the "Maintenance" section.
</div>
</div>
{{end}}
<form id="folder_form" action="{{.CurrentURL}}" method="POST" autocomplete="off" {{if eq .Mode 3}}target="_blank"{{end}}>
{{if eq .Mode 3}}
<div class="form-group row">
<label for="idFolders" class="col-sm-2 col-form-label">Folders</label>
<div class="col-sm-10">
<textarea class="form-control" id="idFolders" name="folders" rows="5" required
aria-describedby="foldersHelpBlock"></textarea>
<small id="foldersHelpBlock" class="form-text text-muted">
Specify the folder names, one for line.
</small>
</div>
</div>
<input type="hidden" name="name" id="idFolderName" value="{{.Folder.Name}}">
{{else}}
<div class="form-group row">
<label for="idFolderName" class="col-sm-2 col-form-label">Name</label>
<div class="col-sm-10">
<input type="text" class="form-control" id="idFolderName" name="name" placeholder=""
value="{{.Folder.Name}}" maxlength="255" autocomplete="nope" required {{if ge .Mode 2}}readonly{{end}}>
</div>
</div>
{{end}}
<div class="form-group row">
<label for="idDescription" class="col-sm-2 col-form-label">Description</label>
<div class="col-sm-10">
<input type="text" class="form-control" id="idDescription" name="description" placeholder=""
value="{{.Folder.Description}}" maxlength="255" aria-describedby="descriptionHelpBlock">
<small id="descriptionHelpBlock" class="form-text text-muted">
Optional description
</small>
</div>
</div>
2021-01-22 18:42:18 +00:00
<div class="form-group row">
<label for="idMappedPath" class="col-sm-2 col-form-label">Absolute Path</label>
<div class="col-sm-10">
<input type="text" class="form-control" id="idMappedPath" name="mapped_path" placeholder=""
value="{{.Folder.MappedPath}}" maxlength="512" autocomplete="nope" required>
</div>
</div>
2021-02-03 07:55:28 +00:00
<input type="hidden" name="_form_token" value="{{.CSRFToken}}">
<button type="submit" class="btn btn-primary float-right mt-3 px-5 px-3">{{if eq .Mode 3}}Generate and export folders{{else}}Submit{{end}}</button>
2021-01-22 18:42:18 +00:00
</form>
</div>
</div>
{{end}}