From 04d24aaba3732a98ffba847bd83ff87953e1bda2 Mon Sep 17 00:00:00 2001 From: koke228666 <146654074+koke228666@users.noreply.github.com> Date: Fri, 7 Mar 2025 22:51:31 +0300 Subject: [PATCH] =?UTF-8?q?make=20creating=20avatar=20=E2=9C=A8better?= =?UTF-8?q?=E2=9C=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Web/Presenters/templates/Group/View.xml | 16 +++++++++------- Web/Presenters/templates/User/View.xml | 10 ++++++---- Web/static/js/al_wall.js | 11 +++++++---- 3 files changed, 22 insertions(+), 15 deletions(-) diff --git a/Web/Presenters/templates/Group/View.xml b/Web/Presenters/templates/Group/View.xml index 2fd929152..8ad540f7f 100644 --- a/Web/Presenters/templates/Group/View.xml +++ b/Web/Presenters/templates/Group/View.xml @@ -129,13 +129,15 @@ {var $avatarLink = ((is_null($avatarPhoto) ? FALSE : $avatarPhoto->isAnonymous()) ? "/photo" . ("s/" . base_convert((string) $avatarPhoto->getId(), 10, 32)) : $club->getAvatarLink())}
{if $thisUser && $club->canBeModifiedBy($thisUser)} - {_add_image} -
-
- -
+
+
+ +
{/if} diff --git a/Web/Presenters/templates/User/View.xml b/Web/Presenters/templates/User/View.xml index 9c013dd18..5aa90fa07 100644 --- a/Web/Presenters/templates/User/View.xml +++ b/Web/Presenters/templates/User/View.xml @@ -73,11 +73,13 @@ {var $hasAvatar = !str_contains($user->getAvatarUrl('miniscule'), "/assets/packages/static/openvk/img/camera_200.png")} {if $thisUser && $user->getId() == $thisUser->getId()} - {_add_image} -
-
+ {/if} diff --git a/Web/static/js/al_wall.js b/Web/static/js/al_wall.js index 7423c656a..fd385b674 100644 --- a/Web/static/js/al_wall.js +++ b/Web/static/js/al_wall.js @@ -2179,9 +2179,11 @@ $(document).on("click", "#add_image", (e) => { document.querySelector("#bigAvatar").src = response.url document.querySelector("#bigAvatar").parentNode.href = "/photo" + response.new_photo - - document.querySelector(".add_image_text").style.display = "none" + document.querySelector(".avatar_controls").style.display = "block" + document.querySelector(".avatar_controls .set_image").style.display = "block" + document.querySelector(".avatar_controls .avatarDelete").style.display = "block" + document.querySelector(".avatar_controls .upload_image").style.display = "none" } }) }) @@ -2314,8 +2316,9 @@ $(document).on("click", ".avatarDelete", (e) => { document.querySelector("#bigAvatar").parentNode.href = response.new_photo ? ("/photo" + response.new_photo) : "javascript:void(0)" if(!response.has_new_photo) { - document.querySelector(".avatar_controls").style.display = "none" - document.querySelector(".add_image_text").style.display = "block" + document.querySelector(".avatar_controls .set_image").style.display = "none" + document.querySelector(".avatar_controls .avatarDelete").style.display = "none" + document.querySelector(".avatar_controls .upload_image").style.display = "block" } } })