diff --git a/static/js/base.js b/static/js/base.js index 9e458ee69eb81dfe06c1e6e63b6bfd04afa242c9..52fce901c17516c04086ba4a1d81b2c56178945b 100644 --- a/static/js/base.js +++ b/static/js/base.js @@ -131,13 +131,9 @@ function displayNote(note, alias, user_note_field = null, profile_pic_field = nu $("#" + user_note_field).text(alias + (note.balance == null ? "" : (" :\n" + pretty_money(note.balance)))); if (profile_pic_field != null) { $("#" + profile_pic_field).attr('src', img); - $("#" + profile_pic_field).click(function () { - if (note.resourcetype === "NoteUser") { - document.location.href = "/accounts/user/" + note.user; - } else if (note.resourcetype === "NoteClub") { - document.location.href = "/accounts/club/" + note.club; - } - }); + $("#" + profile_pic_field + "_link").attr('href', note.resourcetype === "NoteUser" ? + "/accounts/user/" + note.user : note.resourcetype === "NoteClub" ? + "/accounts/club/" + note.club : "#"); } } } diff --git a/static/js/consos.js b/static/js/consos.js index b75a7b59e5150348c7fe82a0feaeab716f80def1..cb6b730f12bbce6fea2cea2255ad37e6d908abb7 100644 --- a/static/js/consos.js +++ b/static/js/consos.js @@ -145,6 +145,7 @@ function reset() { $("#consos_list").html(""); $("#user_note").text(""); $("#profile_pic").attr("src", "/media/pic/default.png"); + $("#profile_pic_link").attr("href", "#"); refreshHistory(); refreshBalance(); } diff --git a/static/js/transfer.js b/static/js/transfer.js index bff6b493c3c9eced00e0d41d0cb6b34115fbc75c..88368a27dcf12b97fb74d22295b4f40e59fe6c84 100644 --- a/static/js/transfer.js +++ b/static/js/transfer.js @@ -37,6 +37,7 @@ function reset(refresh=true) { $("#bank").val(""); $("#user_note").val(""); $("#profile_pic").attr("src", "/media/pic/default.png"); + $("#profile_pic_link").attr("href", "#"); if (refresh) { refreshBalance(); refreshHistory(); diff --git a/templates/note/conso_form.html b/templates/note/conso_form.html index a63f7ffe95293476a660283f8bd5a0e8acf1433a..52c6b94f9adffb89735a17798fa28322c1a82dbc 100644 --- a/templates/note/conso_form.html +++ b/templates/note/conso_form.html @@ -12,8 +12,10 @@ {# User details column #} <div class="col"> <div class="card border-success shadow mb-4 text-center"> - <img src="/media/pic/default.png" - id="profile_pic" alt="" class="card-img-top"> + <a id="profile_pic_link" href="#"> + <img src="/media/pic/default.png" + id="profile_pic" alt="" class="card-img-top"> + </a> <div class="card-body text-center"> <span id="user_note"></span> </div> diff --git a/templates/note/transaction_form.html b/templates/note/transaction_form.html index 3549871f8ec91c405f12953a78b48853c01c84db..8494c22b75b09519856908b1389c7c735d940920 100644 --- a/templates/note/transaction_form.html +++ b/templates/note/transaction_form.html @@ -36,8 +36,8 @@ SPDX-License-Identifier: GPL-2.0-or-later <div class="row"> <div class="col-md-3" id="note_infos_div"> <div class="card border-success shadow mb-4"> - <img src="/media/pic/default.png" - id="profile_pic" alt="" class="img-fluid rounded mx-auto d-block"> + <a id="profile_pic_link" href="#"><img src="/media/pic/default.png" + id="profile_pic" alt="" class="img-fluid rounded mx-auto d-block"></a> <div class="card-body text-center"> <span id="user_note"></span> </div>