82 lines
2.5 KiB
HTML
82 lines
2.5 KiB
HTML
{% extends "base.html" %}
|
|
|
|
{% block content %}
|
|
<div class="step-container">
|
|
<div class="progress-bar">
|
|
<div class="progress-step active">1</div>
|
|
<div class="progress-line"></div>
|
|
<div class="progress-step">2</div>
|
|
<div class="progress-line"></div>
|
|
<div class="progress-step">3</div>
|
|
<div class="progress-line"></div>
|
|
<div class="progress-step">4</div>
|
|
<div class="progress-line"></div>
|
|
<div class="progress-step">5</div>
|
|
</div>
|
|
|
|
<h2>1단계: 기본 정보 입력</h2>
|
|
|
|
<form id="step1Form" class="form-container">
|
|
<div class="form-group">
|
|
<label for="name">이름 *</label>
|
|
<input type="text" id="name" name="name" required>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label for="district">교구 *</label>
|
|
<select id="district" name="district" required>
|
|
<option value="">선택하세요</option>
|
|
{% for district in districts %}
|
|
<option value="{{ district }}">{{ district }}</option>
|
|
{% endfor %}
|
|
</select>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label for="cult">이단교단 *</label>
|
|
<select id="cult" name="cult" required>
|
|
<option value="">선택하세요</option>
|
|
{% for cult in cults %}
|
|
<option value="{{ cult }}">{{ cult }}</option>
|
|
{% endfor %}
|
|
</select>
|
|
</div>
|
|
|
|
<div class="form-actions">
|
|
<button type="submit" class="btn btn-primary">다음 단계</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
{% endblock %}
|
|
|
|
{% block scripts %}
|
|
<script>
|
|
document.getElementById('step1Form').addEventListener('submit', async function(e) {
|
|
e.preventDefault();
|
|
|
|
const formData = new FormData(this);
|
|
const data = Object.fromEntries(formData);
|
|
|
|
try {
|
|
const response = await fetch('/step1', {
|
|
method: 'POST',
|
|
headers: {
|
|
'Content-Type': 'application/json',
|
|
},
|
|
body: JSON.stringify(data)
|
|
});
|
|
|
|
const result = await response.json();
|
|
if (result.success) {
|
|
window.location.href = result.next_step;
|
|
} else {
|
|
alert('오류가 발생했습니다: ' + (result.message || '알 수 없는 오류'));
|
|
}
|
|
} catch (error) {
|
|
alert('오류가 발생했습니다: ' + error.message);
|
|
}
|
|
});
|
|
</script>
|
|
{% endblock %}
|
|
|