<div id="nothingSelected" class="modal">
    <h3>$text{'nothing_selected'}</h3>
</div>

<div id="createFolderDialog" class="modal">
  <form id="createFolderForm" action="create_folder.cgi" method="post">
      <div class="form-group">
          <label>$text{'new_folder_name'}</label>
          <input id="name" name="name" type="text" title="$text{'provide_folder_name'}">
          <input type='hidden' name='path' value='$quote_escaped_path'>
      </div>
  </form>
</div>

<div id="createFileDialog" class="modal">
  <form id="createFileForm" action="create_file.cgi" method="post">
      <div class="form-group">
          <label>$text{'new_file_name'}</label>
          <input name="name" type="text">
          <input type='hidden' name='path' value='$quote_escaped_path'>
      </div>
  </form>
</div>

<div id="renameDialog" class="modal">
  <form id="renameForm" action="rename.cgi" method="post">
      <div class="form-group">
          <label>$text{'new_name'}</label>
          <input name="name" type="text">
          <input type='hidden' name='file' value='' required>
          <input type='hidden' name='path' value='$quote_escaped_path'>
      </div>
  </form>
</div>

<div id="compressDialog" class="modal">
  <form id="compressSelectedForm" action="compress.cgi" method="post">
      <div class="form-group">
          <label>$text{'archive_name'}</label>
          <input name="filename" type="text">
          <select name="method">
              <option value="plain-tar">.tar</option>
              <option value="xz-tar">.tar.xz</option>
              <option selected value="tar">.tar.gz</option>
              <option value="zstd-tar">.zstd</option>
              <option value="zip">.zip</option>
          </select>
      </div>
  </form>
</div>

<div id="removeDialog" class="modal">
  <p>$text{'about_to_delete'}</p>
  <pre id="items-to-remove">
  </pre>
  $text{'are_you_sure'}
</div>

<div id="chownDialog" class="modal">
  <form id="chownForm">
      <div class="form-group">
          <label>$text{'user_name'}</label><br>
          <input name="owner" type="text"><br>
          <label>$text{'group_name'}</label><br>
          <input name="group" type="text"><br><br>
          <label>$text{'dialog_recursive'}</label>
          <input id="chown-recursive" type="checkbox" name="recursive">
      </div>
  </form>
</div>

<div id="chattrDialog" class="modal">
  <form id="chattrForm">
      <div class="form-group">
          <label>$text{'attr_label'}</label><br>
          <input name="label" type="text"><br><br>
          <label>$text{'dialog_recursive'}</label>
          <input id="chattr-recursive" type="checkbox" name="recursive">
      </div>
  </form>
</div>

<div id="chconDialog" class="modal">
  <form id="chconForm">
      <div class="form-group">
          <label>$text{'context_label'}</label><br>
          <input name="label" type="text"><br><br>
          <label>$text{'dialog_recursive'}</label>
          <input id="chcon-recursive" type="checkbox" name="recursive">
      </div>
  </form>
</div>

<div id="aclsDialog" class="modal">
  <form id="aclsForm">
      <div class="form-group">
          <label>$text{'acls_action'}</label><br>
          <select name="action">
              <option value=""></option>
              <option selected value="-m">Modify (-m)</option>
              <option value="-x">Remove (-x)</option>
              <option value="-b">Remove all extended (-b)</option>
              <option value="-k">Remove default (-k)</option>
          </select><br><br>
          
          <label>$text{'acls_applyto'}</label><br>
          <select multiple size=4 name="apply_to">
              <option value="u">$text{'acls_user'}</option>
              <option value="g">$text{'acls_group'}</option>
              <option value="m">$text{'acls_mask'}</option>
              <option value="o">$text{'acls_other'}</option>
          </select><br><br>
          
          <label>$text{'acls_perms'}</label><br>
          <select name="perms">
              <option value=""></option>
              <option value="---">---</option>
              <option value="r--">r--</option>
              <option value="-w-">-w-</option>
              <option value="--x">--x</option>
              <option value="r-x">r-x</option>
              <option value="rw-">rw-</option>
              <option value="-wx">-wx</option>
              <option value="rwx">rwx</option>
          </select><br><br>
          
          <label>$text{'acls_user'}</label><br>
          $acl_user_select<br><br>
          
          <label>$text{'acls_group'}</label><br>
          $acl_group_select<br><br>
          
          <label>$text{'dialog_recursive'}</label>
          <input id="acls-recursive" type="checkbox" name="recursive">
          
          <br><br>
          $acl_manual
      </div>
  </form>
</div>

<div id="downFromUrlDialog" class="modal">
  <form id="downFromUrlForm" action="http_download.cgi" method="post">
    <div class="form-group">
      <label>$text{'dialog_file_url'}</label>
      <input name="link" type="url"><br>
      <label>$text{'dialog_user_name'}</label>
      <input name="username" type="text"><br>
      <label>$text{'dialog_user_pass'}</label>
      <input name="password" type="password">
      <input type='hidden' name='path' value='$quote_escaped_path'>
    </div>
  </form>
</div>

<div id="readyForUploadDialog" class="modal">
    <form id='upload-form' method='post' onsubmit="this.extract_upload.checked=false" action='upload.cgi?path=$urlized_path&id=$upid' enctype='multipart/form-data' onsubmit='window.open("@{[&get_webprefix()]}/uptracker.cgi?id=$upid&uid=$uid", "uptracker", "toolbar=no, menubar=no, scrollbars=no, location=no, resizable=no, width=screen.width, height=screen.height")'>
        <input type='file' id='upfiles' name='upfiles' multiple onchange='countUploads(this)'>
        <input type='hidden' name='path' value='$quote_escaped_path'>
        <br>
        <br>
        <input type="checkbox" id="filetype" onchange="this.parentElement.querySelector('#upfiles').toggleAttribute('webkitdirectory')"><label for="filetype"> $text{'upload_dirs'}</label>
        <br>
        <input type="checkbox" id="extract_upload" onchange="t=document.querySelector('#upload-form'),v=t.getAttribute('action'),x='&extract_uploaded=1',this.checked?t.setAttribute('action', t.getAttribute('action') + x):t.setAttribute('action',t.getAttribute('action').replace(x,''))"><label for="extract_upload"> $text{'extract_uploaded'}</label>
        <br>
        <input type="checkbox" id="overwrite_existing" onchange="t=document.querySelector('#upload-form'),v=t.getAttribute('action'),x='&overwrite_existing=1',this.checked?t.setAttribute('action', t.getAttribute('action') + x):t.setAttribute('action',t.getAttribute('action').replace(x,''))"><label for="overwrite_existing"> $text{'overwrite_existing'}</label>
    </form>
    <div id="readyForUploadList" class="well" style="max-height: 180px;">
    </div>
</div>

<div id="chmodDialog" class="modal fade">
  <form name="chmod" id="chmodForm">
      <div class="form-group">
          <label for="t_total">$text{'permissions'}:&nbsp; </label><br>
          <input id="perms" type="text" oninput="if(this.value.length>4)this.value=this.value.slice(0,4)" name="t_total" value="0644" size="4" onKeyUp="octalchange()" class="form-group-item">
          <input type="text" name="sym_total" value="" size="12" readonly="true" class="form-group-item">
      </div>
      <table class="table">
          <tr>
              <th></th>
              <th><b>$text{'chmod_owner'}</b></th>
              <th><b>$text{'chmod_group'}</b></th>
              <th><b>$text{'chmod_others'}<b></th>
          </tr>
          <tr>
              <td>$text{'chmod_read'}</td>
              <td><input type="checkbox" name="owner4" value="4" onchange="calc_chmod()"></td>
              <td><input type="checkbox" name="group4" value="4" onchange="calc_chmod()"></td>
              <td><input type="checkbox" name="other4" value="4" onchange="calc_chmod()"></td>
          </tr>
          <tr>
              <td>$text{'chmod_write'}</td>
              <td><input type="checkbox" name="owner2" value="2" onchange="calc_chmod()"></td>
              <td><input type="checkbox" name="group2" value="2" onchange="calc_chmod()"></td>
              <td><input type="checkbox" name="other2" value="2" onchange="calc_chmod()"></td>
          </tr>
          <tr>
              <td>$text{'chmod_execute'}</td>
              <td><input type="checkbox" name="owner1" value="1" onchange="calc_chmod()"></td>
              <td><input type="checkbox" name="group1" value="1" onchange="calc_chmod()"></td>
              <td><input type="checkbox" name="other1" value="1" onchange="calc_chmod()"></td>
          </tr>
          <tr>
              <td>----------</td>
              <td></td>
              <td></td>
              <td></td>
          </tr>
          <tr>
              <td>$text{'chmod_sticky'}</td>
              <td><input type="checkbox" name="sticky" value="1" onchange="calc_chmod()"></td>
              <td></td>
              <td></td>
          </tr>
          <tr>
              <td>$text{'chmod_setgid'}</td>
              <td><input type="checkbox" name="setgid" value="2" onchange="calc_chmod()"></td>
              <td></td>
              <td></td>
          </tr>
      </table>
      <label>$text{'chmod_apply_to'}:&nbsp; </label>
      <select name="applyto">
          <option value="1">$text{'chmod_dir_only'}</option>
          <option value="2">$text{'chmod_dir_and_its_files'}</option>
          <option value="3">$text{'chmod_all'}</option>
          <option value="4">$text{'chmod_dir_files_and_subs_files'}</option>
          <option value="5">$text{'chmod_dir_and_subs'}</option>
      </select>
  </form>
</div>

<div id="searchDialog" class="modal">
  <form id="searchForm" action="search.cgi" method="post">
      <div class="form-group">
          <label>$text{'search_label'}</label>
          <input id="query" name="query" type="text" title="$text{'provide_search_query'}"><br><br>
          <input id="caseins" name="caseins" type="checkbox" checked="checked"> $text{'search_insensitive'}
          <input type='hidden' name='path' value='$quote_escaped_path'>
      </div>
  </form>
</div>
