fix
This commit is contained in:
parent
da15dc7fb1
commit
c1d05b5984
@ -7,24 +7,22 @@
|
|||||||
{% block title %}Анкета{% endblock %}
|
{% block title %}Анкета{% endblock %}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
{{ header.section(user) }}
|
{{ header.section(user) }}
|
||||||
<section class="c_dg3k4">
|
<section class="c_dg3k4">
|
||||||
<div class="c_gtoe9">
|
<div class="c_gtoe9">
|
||||||
{{ profile_card.profile_card(user) }}
|
{{ profile_card.profile_card(user) }}
|
||||||
<div class="c_ru432">
|
<div class="c_ru432">
|
||||||
{{ profile_nav.profile_nav(user, 'form') }}
|
{{ profile_nav.profile_nav(user, 'form') }}
|
||||||
<div class="c_tihtk" id="main">
|
<div class="c_tihtk" id="main">
|
||||||
|
|
||||||
<div class="c_aihm6 floating-group">
|
<div class="c_aihm6 floating-group">
|
||||||
<label for="female_name_lastname" class="c_z3ybu floating-label">ФИО<span style="color:red">*</span></label>
|
<label for="female_name_lastname" class="c_z3ybu floating-label">ФИО<span style="color:red">*</span></label>
|
||||||
<input name="female_name_lastname" id="female_name_lastname" class="c_xhd5k" required />
|
<input name="female_name_lastname" id="female_name_lastname" class="c_xhd5k" required />
|
||||||
<span></span>
|
<span></span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<label for="birthday" class="c_z3ybu floating-label">Дата рождения<span style="color:red">*</span></label>
|
||||||
<label for="birthday" class="c_z3ybu floating-label">Дата рождения<span style="color:red">*</span></label>
|
|
||||||
|
|
||||||
<div class="c_aihm6 floating-group birthday">
|
<div class="c_aihm6 floating-group birthday">
|
||||||
<select id="day">
|
<select id="day">
|
||||||
<option>1</option>
|
<option>1</option>
|
||||||
@ -39,7 +37,7 @@
|
|||||||
<option>2001</option>
|
<option>2001</option>
|
||||||
</select>
|
</select>
|
||||||
<input type="date" id="birthday" name="birthday" class="c_xhd5k" required data-toast="Поле Дата рождения должно быть заполнено">
|
<input type="date" id="birthday" name="birthday" class="c_xhd5k" required data-toast="Поле Дата рождения должно быть заполнено">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="c_aihm6 floating-group">
|
<div class="c_aihm6 floating-group">
|
||||||
<label for="living_place" class="c_z3ybu floating-label">Место проживания<span style="color:red">*</span></label>
|
<label for="living_place" class="c_z3ybu floating-label">Место проживания<span style="color:red">*</span></label>
|
||||||
@ -258,46 +256,45 @@ document.addEventListener("DOMContentLoaded",()=>{let e=document.getElementById(
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
// @license magnet:?xt=urn:btih:c80d50af7d3db9be66a4d0a86db0286e4fd33292&dn=bsd-3-clause.txt BSD-3-Clause
|
// @license magnet:?xt=urn:btih:c80d50af7d3db9be66a4d0a86db0286e4fd33292&dn=bsd-3-clause.txt BSD-3-Clause
|
||||||
document.addEventListener('DOMContentLoaded', () => {
|
document.addEventListener('DOMContentLoaded', () => {
|
||||||
const createBtn = document.getElementById('createBtn');
|
const createBtn = document.getElementById('createBtn');
|
||||||
|
|
||||||
createBtn.addEventListener('click', async (e) => {
|
createBtn.addEventListener('click', async (e) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
payload = {
|
payload = {
|
||||||
'female_name_lastname': document.getElementById('female_name_lastname').value,
|
'female_name_lastname': document.getElementById('female_name_lastname').value,
|
||||||
'birthday': document.getElementById('birthday').value,
|
'birthday': document.getElementById('birthday').value,
|
||||||
'living_place': document.getElementById('living_place').value,
|
'living_place': document.getElementById('living_place').value,
|
||||||
'social_media': document.getElementById('social_media').value,
|
'social_media': document.getElementById('social_media').value,
|
||||||
'marketplaces': document.getElementById('marketplaces').value,
|
'marketplaces': document.getElementById('marketplaces').value,
|
||||||
'email': document.getElementById('email').value,
|
'email': document.getElementById('email').value,
|
||||||
'phone': document.getElementById('phone').value,
|
'phone': document.getElementById('phone').value,
|
||||||
'messengers': document.getElementById('messengers').value,
|
'messengers': document.getElementById('messengers').value,
|
||||||
'specialization': document.getElementById('specialization').value,
|
'specialization': document.getElementById('specialization').value,
|
||||||
'grade': document.getElementById('grade').value,
|
'grade': document.getElementById('grade').value,
|
||||||
'style': document.getElementById('style').value,
|
'style': document.getElementById('style').value,
|
||||||
'art_types': document.getElementById('art_types').value,
|
'art_types': document.getElementById('art_types').value,
|
||||||
'genres': document.getElementById('genres').value,
|
'genres': document.getElementById('genres').value,
|
||||||
'education': document.getElementById('education').value,
|
'education': document.getElementById('education').value,
|
||||||
'unions': document.getElementById('unions').value,
|
'unions': document.getElementById('unions').value,
|
||||||
'rewards': document.getElementById('rewards').value,
|
'rewards': document.getElementById('rewards').value,
|
||||||
'projects': document.getElementById('projects').value,
|
'projects': document.getElementById('projects').value,
|
||||||
'publications': document.getElementById('publications').value,
|
'publications': document.getElementById('publications').value,
|
||||||
'site': document.getElementById('site').value,
|
'site': document.getElementById('site').value,
|
||||||
'material_manufacturer': document.getElementById('material_manufacturer').value,
|
'material_manufacturer': document.getElementById('material_manufacturer').value,
|
||||||
'material_use': document.getElementById('material_use').value,
|
'material_use': document.getElementById('material_use').value,
|
||||||
'buying_materials': document.getElementById('buying_materials').value,
|
'buying_materials': document.getElementById('buying_materials').value,
|
||||||
'collaborate': document.getElementById('collaborate').value,
|
'collaborate': document.getElementById('collaborate').value,
|
||||||
'meta_data.wishes': document.getElementById('meta_data.wishes').value,
|
'meta_data.wishes': document.getElementById('meta_data.wishes').value,
|
||||||
'master_classes': document.getElementById('master_classes').value,
|
'master_classes': document.getElementById('master_classes').value,
|
||||||
'materials_use_in_master_classes': document.getElementById('materials_use_in_master_classes').value,
|
'materials_use_in_master_classes': document.getElementById('materials_use_in_master_classes').value,
|
||||||
'print_merch': document.getElementById('print_merch').value,
|
'print_merch': document.getElementById('print_merch').value,
|
||||||
'own_workshop': document.getElementById('own_workshop').value,
|
'own_workshop': document.getElementById('own_workshop').value,
|
||||||
'workshop_tour': document.getElementById('workshop_tour').value,
|
'workshop_tour': document.getElementById('workshop_tour').value,
|
||||||
'biography': document.getElementById('biography').value}
|
'biography': document.getElementById('biography').value
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const res = await fetch(`/api/user/form`, {
|
const res = await fetch(`/api/user/form`, {
|
||||||
@ -309,31 +306,27 @@ payload = {
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (res.ok) {
|
if (res.ok) {
|
||||||
showToast({message: 'Анкета сохранена!', duration:2500});
|
showToast({ message: 'Анкета сохранена!', duration: 2500 });
|
||||||
{% if notify %}
|
{% if notify %}
|
||||||
const targetHash = window.location.hash;
|
const targetHash = window.location.hash;
|
||||||
if (targetHash) {
|
if (targetHash) {
|
||||||
const el = document.querySelector(targetHash);
|
const el = document.querySelector(targetHash);
|
||||||
if (el) {
|
if (el) {
|
||||||
el.scrollIntoView({ behavior: 'smooth' });
|
el.scrollIntoView({ behavior: 'smooth' });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
window.location.reload();
|
window.location.reload();
|
||||||
{% endif %}
|
{% endif %}
|
||||||
} else {
|
} else {
|
||||||
showToast({message: 'Ошибка при сохранение!', status: 'error', duration:2500});
|
showToast({ message: 'Ошибка при сохранение!', status: 'error', duration: 2500 });
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error(err);
|
console.error(err);
|
||||||
showToast({message: 'Ошибка соединения с сервером!', status: 'error', duration:2500});
|
showToast({ message: 'Ошибка соединения с сервером!', status: 'error', duration: 2500 });
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
// @license-end
|
||||||
|
|
||||||
// @license-end
|
|
||||||
</script>
|
</script>
|
||||||
{{ footer.section(user) }}
|
{{ footer.section(user) }}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user