Add password config option #5

Merged
blek merged 5 commits from filed-pass-config into master 2023-10-27 12:11:06 +02:00
1 changed files with 27 additions and 2 deletions
Showing only changes of commit 9089461c8d - Show all commits

View File

@ -9,6 +9,31 @@
{% endblock %} {% endblock %}
{% block scripts %}
{%- if conf.files.upload_pass.is_some() -%}
{#- Script to disable button when password is not entered -#}
{#- -#}<script>
{#- -#} (
{#- -#} ()=>{
{#- -#} const pass_inp=document.getElementById("instancepass");
{#- -#} const submit=document.getElementById("bfile-upload-submit");
{#- -#} submit.setAttribute('disabled',true);
{#- -#}
{#- -#} pass_inp.onchange=()=>{
{#- -#} if(pass_inp.value.length==0)
{#- -#} submit.setAttribute('disabled',true);
{#- -#} else submit.removeAttribute('disabled')
{#- -#} }
{#- -#} }
{#- -#} )()
{#- -#}</script>
{%- endif -%}
{% endblock %}
{% block body %} {% block body %}
<div style="max-width:95vw;width:fit-content;margin:0 auto"> <div style="max-width:95vw;width:fit-content;margin:0 auto">
@ -125,7 +150,7 @@
<p> <p>
<label> <label>
Password: Password:
<input type="password" name="instancepass"> <input type="password" name="instancepass" id="instancepass">
</label> </label>
</p> </p>
</div> </div>
@ -160,7 +185,7 @@
</label> </label>
</p> </p>
<p> <p>
<button class='btn btn-fill'> <button class='btn btn-fill' id="bfile-upload-submit">
Upload! Upload!
</button> </button>
</p> </p>