2020-06-07 21:30:18 +00:00
|
|
|
{{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">
|
2021-02-04 18:09:43 +00:00
|
|
|
<h6 class="m-0 font-weight-bold text-primary">{{.Title}}</h6>
|
2020-06-07 21:30:18 +00:00
|
|
|
</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}}
|
2021-02-04 18:09:43 +00:00
|
|
|
{{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}}
|
2021-04-01 17:42:18 +00:00
|
|
|
<form id="folder_form" enctype="multipart/form-data" action="{{.CurrentURL}}" method="POST" autocomplete="off" {{if eq .Mode 3}}target="_blank"{{end}}>
|
2021-02-04 18:09:43 +00:00
|
|
|
{{if eq .Mode 3}}
|
2021-05-23 20:02:01 +00:00
|
|
|
<div class="card bg-light mb-3">
|
|
|
|
<div class="card-header">
|
|
|
|
Folders
|
|
|
|
</div>
|
|
|
|
<div class="card-body">
|
|
|
|
<div class="form-group row">
|
|
|
|
<div class="col-md-12 form_field_tpl_folders_outer">
|
|
|
|
<div class="row form_field_tpl_folder_outer_row">
|
|
|
|
<div class="form-group col-md-10">
|
|
|
|
<input type="text" class="form-control" id="idTplFolder0" name="tpl_foldername" placeholder="Folder name" maxlength="255">
|
|
|
|
</div>
|
|
|
|
<div class="form-group col-md-2">
|
|
|
|
<button class="btn btn-circle btn-danger remove_tpl_folder_btn_frm_field">
|
|
|
|
<i class="fas fa-trash"></i>
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="row mx-1">
|
|
|
|
<button type="button" class="btn btn-secondary add_new_tpl_folder_field_btn">
|
|
|
|
<i class="fas fa-plus"></i> Add new folder name
|
|
|
|
</button>
|
|
|
|
</div>
|
2021-02-04 18:09:43 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<input type="hidden" name="name" id="idFolderName" value="{{.Folder.Name}}">
|
|
|
|
{{else}}
|
2021-02-01 18:04:15 +00:00
|
|
|
<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>
|
2021-02-04 18:09:43 +00:00
|
|
|
{{end}}
|
2021-02-24 18:40:29 +00:00
|
|
|
<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=""
|
2021-03-21 18:15:47 +00:00
|
|
|
value="{{.Folder.MappedPath}}" maxlength="512" aria-describedby="mappedPathHelpBlock">
|
|
|
|
<small id="descriptionHelpBlock" class="form-text text-muted">
|
|
|
|
Required for local providers. For Cloud providers, if set, it will store temporary files
|
|
|
|
</small>
|
2021-01-22 18:42:18 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
2020-06-07 21:30:18 +00:00
|
|
|
|
2021-03-21 18:15:47 +00:00
|
|
|
{{template "fshtml" .Folder.FsConfig}}
|
|
|
|
|
2021-02-03 07:55:28 +00:00
|
|
|
<input type="hidden" name="_form_token" value="{{.CSRFToken}}">
|
2021-02-04 18:09:43 +00:00
|
|
|
<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>
|
2021-03-21 18:15:47 +00:00
|
|
|
{{end}}
|
|
|
|
|
|
|
|
{{define "extra_js"}}
|
|
|
|
<script type="text/javascript">
|
|
|
|
$(document).ready(function () {
|
|
|
|
onFilesystemChanged('{{.Folder.FsConfig.Provider}}');
|
2021-05-23 20:02:01 +00:00
|
|
|
|
|
|
|
$("body").on("click", ".add_new_tpl_folder_field_btn", function () {
|
|
|
|
var index = $(".form_field_tpl_folders_outer").find(".form_field_tpl_folder_outer_row").length;
|
|
|
|
while (document.getElementById("idTplFolder"+index) != null){
|
|
|
|
index++;
|
|
|
|
}
|
|
|
|
$(".form_field_tpl_folders_outer").append(`
|
|
|
|
<div class="row form_field_tpl_folder_outer_row">
|
|
|
|
<div class="form-group col-md-10">
|
|
|
|
<input type="text" class="form-control" id="idTplFolder${index}" name="tpl_foldername" placeholder="Folder name" maxlength="255">
|
|
|
|
</div>
|
|
|
|
<div class="form-group col-md-2">
|
|
|
|
<button class="btn btn-circle btn-danger remove_tpl_folder_btn_frm_field">
|
|
|
|
<i class="fas fa-trash"></i>
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
`);
|
|
|
|
});
|
|
|
|
|
|
|
|
$("body").on("click", ".remove_tpl_folder_btn_frm_field", function () {
|
|
|
|
$(this).closest(".form_field_tpl_folder_outer_row").remove();
|
|
|
|
});
|
|
|
|
|
2021-03-21 18:15:47 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
{{template "fsjs"}}
|
|
|
|
</script>
|
2020-06-07 21:30:18 +00:00
|
|
|
{{end}}
|