0.0.289
This commit is contained in:
@@ -1975,7 +1975,7 @@
|
||||
border-bottom:1px solid #E6E6E6;
|
||||
}
|
||||
|
||||
.img_user{
|
||||
.avatar_user_profile{
|
||||
object-fit: cover;
|
||||
height: 110px;
|
||||
width: 110px;
|
||||
|
||||
@@ -18,7 +18,7 @@ function load_routes (el,news=null) {
|
||||
'to_el':parseInt(number_last_route) + incrase
|
||||
}
|
||||
let get_url = ""
|
||||
let url_ajax = "get_articles_block/"
|
||||
let url_ajax = "ru/get_articles_block/"
|
||||
if (!news){
|
||||
let list = forloop_func_form(data_d,"get",get_url)
|
||||
data_d = list[0]
|
||||
@@ -46,7 +46,7 @@ function load_routes (el,news=null) {
|
||||
cache: false,
|
||||
processData: false,
|
||||
contentType: false,
|
||||
// enctype: 'json',
|
||||
enctype: 'json',
|
||||
data: JSON.stringify(data_d),
|
||||
success: function(data){
|
||||
|
||||
|
||||
@@ -180,13 +180,21 @@ async function fileListToBase64(fileList) {
|
||||
return await Promise.all(promises)
|
||||
}
|
||||
|
||||
async function attachFilemeassge (el,id_ticket=null,sender,receiver){
|
||||
async function attachFilemeassge (el,id_ticket=null,sender=null,receiver=null,change_avatar=null){
|
||||
// let file = el.files[0];
|
||||
let fileList = el.files;
|
||||
if (el.files.length > 0){
|
||||
const files_for_data = await fileListToBase64(fileList)
|
||||
let data = files_for_data
|
||||
sendMessage(id_ticket,sender,receiver,data)
|
||||
if (!change_avatar) {
|
||||
if (el.files.length > 0) {
|
||||
const files_for_data = await fileListToBase64(fileList)
|
||||
let data = files_for_data
|
||||
sendMessage(id_ticket, sender, receiver, data)
|
||||
}
|
||||
} else {
|
||||
if (el.files.length > 0) {
|
||||
const files_for_data = await fileListToBase64(fileList)
|
||||
let data = files_for_data
|
||||
return data
|
||||
}
|
||||
}
|
||||
// let reader = new FileReader();
|
||||
// let mas_for_for_each = []
|
||||
@@ -223,17 +231,34 @@ async function attachFilemeassge (el,id_ticket=null,sender,receiver){
|
||||
}
|
||||
|
||||
|
||||
function upload_photo_f_profile (el) {
|
||||
let file = el.files[0]
|
||||
let Blob = new Blob(file)
|
||||
Blob.onload(function (){
|
||||
let url = URL.createObjectURL(Blob)
|
||||
let insert_place = document.querySelector(".img_user")
|
||||
if (insert_place){
|
||||
insert_place.src = url
|
||||
}
|
||||
})
|
||||
async function upload_photo_f_profile (el,files) {
|
||||
// if (!files){
|
||||
const data = await attachFilemeassge(el, null, null, null, 'avatar')
|
||||
// }
|
||||
// if (files){
|
||||
$.ajax({
|
||||
headers: { "X-CSRFToken": $('input[name=csrfmiddlewaretoken]').val() },
|
||||
url: '/change_avatar_confirm/',
|
||||
type: "POST",
|
||||
// async: true,
|
||||
cache: false,
|
||||
processData: false,
|
||||
contentType: false,
|
||||
// enctype: 'json',
|
||||
data: JSON.stringify(data),
|
||||
success: function(data){
|
||||
middleWareJS()
|
||||
|
||||
document.querySelector(".avatar_user_profile").src = data.url;
|
||||
|
||||
},
|
||||
error: function (data){
|
||||
|
||||
document.querySelector(".avatar_user_profile").innerHTML = data.responseJSON.html;
|
||||
|
||||
}
|
||||
});
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -2,23 +2,17 @@
|
||||
|
||||
<div class="block_inf_profile">
|
||||
<div class="f-l width-50">
|
||||
<div class="upload_photo_container f-l">
|
||||
<img class="img_user" src="{% static "img/svg/User.svg" %}">
|
||||
<div class="upload_photo_container">
|
||||
<img class="avatar_user_profile" src="{% static "img/svg/User.svg" %}">
|
||||
<input type="file" onchange="upload_photo_f_profile(this)" class="btn_f_upload_photo" id="id_btn_f_upload_photo">
|
||||
<label class="upload_photo_label" for="id_btn_f_upload_photo">Загрузить фото</label>
|
||||
</div>
|
||||
<div class="status_f_profile f-r">
|
||||
<div class="status_label">Статус:</div>
|
||||
<select class="select_f_profile_status">
|
||||
<option>asd</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="clear_both"></div>
|
||||
</div>
|
||||
<div class="f-r width-50">
|
||||
<div class="f-r">
|
||||
<div class="cur_subscribe_label">Текущая подписка:</div>
|
||||
<div class="cur_subscribe_f_profile">Стандарт</div>
|
||||
<div class="cur_subscribe_f_profile">{{ user_subscribe.subscribe.name }}</div>
|
||||
<div class="btn_go_to_subscribes pointer" onclick="mySubscription(this)">Перейти к подпискам</div>
|
||||
</div>
|
||||
<div class="clear_both"></div>
|
||||
@@ -28,38 +22,38 @@
|
||||
<div class="container_form_profile">
|
||||
<div class="container_el_form_profile">
|
||||
<label class="label_f_profile" for="name"><span class="orange-text">*</span> Ваше имя</label>
|
||||
<input class="input_f_profile" type="text" id="name" name="name">
|
||||
<input class="input_f_profile" type="text" id="id_firstname" name="firstname" {% if profileForm.initial.firstname %}value="{{ profileForm.initial.firstname }}" {% endif %} >
|
||||
</div>
|
||||
<div class="container_el_form_profile">
|
||||
<label class="label_f_profile" for="id_surname"><span class="orange-text">*</span> Ваша фамилия</label>
|
||||
<input class="input_f_profile" type="text" id="id_surname" name="surname">
|
||||
<label class="label_f_profile" for="id_lastname"><span class="orange-text">*</span> Ваша фамилия</label>
|
||||
<input class="input_f_profile" type="text" id="id_lastname" name="lastname" {% if profileForm.initial.lastname %}value="{{ profileForm.initial.lastname }}" {% endif %}>
|
||||
</div>
|
||||
<div class="container_el_form_profile">
|
||||
<label class="label_f_profile" for="id_phone_profile"><span class="orange-text">*</span> Номер телефона</label>
|
||||
<input class="input_f_profile" type="text" id="id_phone_profile" name="phone">
|
||||
<label class="label_f_profile" for="id_tel"><span class="orange-text">*</span> Номер телефона</label>
|
||||
<input class="input_f_profile" type="text" id="id_tel" name="tel" {% if profileForm.initial.tel %}value="{{ profileForm.initial.tel }}" {% endif %}>
|
||||
</div>
|
||||
<div class="container_el_form_profile">
|
||||
<label class="label_f_profile" for="id_email"><span class="orange-text">*</span> Е-mail</label>
|
||||
<input class="input_f_profile" type="text" id="id_email" name="email">
|
||||
<input class="input_f_profile" type="text" id="id_email" name="email" {% if profileForm.initial.email %}value="{{ profileForm.initial.email }}" {% endif %}>
|
||||
</div>
|
||||
<div class="container_el_form_profile">
|
||||
<label class="label_f_profile" for="id_country"><span class="orange-text">*</span> Страна проживания</label>
|
||||
<input class="input_f_profile" type="text" id="id_country" name="country">
|
||||
<input class="input_f_profile" type="text" id="id_country" name="country" {% if profileForm.initial.country %}value="{{ profileForm.initial.country }}" {% endif %}>
|
||||
</div>
|
||||
<div class="container_el_form_profile">
|
||||
<label class="label_f_profile" for="id_city"><span class="orange-text">*</span> Город проживаня</label>
|
||||
<input class="input_f_profile" type="text" id="id_city" name="city">
|
||||
<input class="input_f_profile" type="text" id="id_city" name="city" {% if profileForm.initial.city %}value="{{ profileForm.initial.city }}" {% endif %}>
|
||||
</div>
|
||||
|
||||
<div class="line_f_form_profile"></div>
|
||||
|
||||
<div class="container_el_form_profile">
|
||||
<label class="label_f_profile" for="id_password"><span class="orange-text">*</span> Новый пароль</label>
|
||||
<input class="input_f_profile" type="text" id="id_password" name="password">
|
||||
<input class="input_f_profile" type="text" id="id_password" name="password" {% if profileForm.initial.password %}value="{{ profileForm.initial.password }}" {% endif %}>
|
||||
</div>
|
||||
<div class="container_el_form_profile">
|
||||
<label class="label_f_profile" for="id_confirm_password"><span class="orange-text">*</span> Подвердить пароль</label>
|
||||
<input class="input_f_profile" type="text" id="id_confirm_password" name="confirm_password">
|
||||
<input class="input_f_profile" type="text" id="id_confirm_password" name="confirm_password" {% if profileForm.initial.confirm_password %}value="{{ profileForm.initial.confirm_password }}" {% endif %}>
|
||||
</div>
|
||||
<button class="confirm_profile_btn">Сохарнить</button>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user