<!DOCTYPE html>
<!-- Nextcloud Upload Modal -->
<div class="modal-dialog modal-sm">
    <div class="modal-content">
        <form class="js-modal-submit" action="{{ url_for('data.modal_nextcloud', projectname=projectname) }}"
            method="POST" id="nextcloudUploadForm">
            <div class="modal-header">
                <h5 class="modal-title">Login to Nextcloud</h5>
                <button type="button" class="btn-close" data-bs-dismiss="modal"></button>
            </div>
            <div class="modal-body">
                <div class="mb-3">
                    <label for="nextcloudUrl" class="form-label">Endpoint/URL *</label>
                    <input type="url" class="form-control" id="nextcloudUrl" name="nextcloud_url"
                        placeholder="https://cloud.example.com" required>
                </div>
                <div class="mb-3">
                    <label for="nextcloudUser" class="form-label">Username *</label>
                    <input type="text" class="form-control" id="nextcloudUser" name="nextcloud_user" required>
                </div>
                <div class="mb-3">
                    <label for="nextcloudPassword" class="form-label">Password *</label>
                    <input type="password" class="form-control" id="nextcloudPassword" name="nextcloud_password"
                        required>
                </div>
                <div class="mb-3">
                    <label for="nextcloudFolder" class="form-label">Folder</label>
                    <input type="text" class="form-control" id="nextcloudFolder" name="nextcloud_folder"
                        placeholder="/path/to/folder">
                </div>
                <div class="alert alert-info" role="alert">
                    <small>* Required fields</small>
                </div>
                {% if message %}
                <div class="alert text-center alert-warning" role="alert">
                    {{ message }}
                </div>
                {% endif %}
            </div>
            <div class="modal-footer d-flex justify-content-center">
                <button type="submit" class="btn btn-primary">
                    <span class="spinner-border spinner-border-sm me-2 d-none" role="status" aria-hidden="true"></span>
                    <span>Login</span>
                </button>
            </div>
        </form>
    </div>
</div>