mirror of https://gitlab.crans.org/bde/nk20
Profile pictures are clickable
This commit is contained in:
parent
c205219d47
commit
2851d7764c
|
@ -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))));
|
$("#" + user_note_field).text(alias + (note.balance == null ? "" : (" :\n" + pretty_money(note.balance))));
|
||||||
if (profile_pic_field != null) {
|
if (profile_pic_field != null) {
|
||||||
$("#" + profile_pic_field).attr('src', img);
|
$("#" + profile_pic_field).attr('src', img);
|
||||||
$("#" + profile_pic_field).click(function () {
|
$("#" + profile_pic_field + "_link").attr('href', note.resourcetype === "NoteUser" ?
|
||||||
if (note.resourcetype === "NoteUser") {
|
"/accounts/user/" + note.user : note.resourcetype === "NoteClub" ?
|
||||||
document.location.href = "/accounts/user/" + note.user;
|
"/accounts/club/" + note.club : "#");
|
||||||
} else if (note.resourcetype === "NoteClub") {
|
|
||||||
document.location.href = "/accounts/club/" + note.club;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -145,6 +145,7 @@ function reset() {
|
||||||
$("#consos_list").html("");
|
$("#consos_list").html("");
|
||||||
$("#user_note").text("");
|
$("#user_note").text("");
|
||||||
$("#profile_pic").attr("src", "/media/pic/default.png");
|
$("#profile_pic").attr("src", "/media/pic/default.png");
|
||||||
|
$("#profile_pic_link").attr("href", "#");
|
||||||
refreshHistory();
|
refreshHistory();
|
||||||
refreshBalance();
|
refreshBalance();
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,6 +37,7 @@ function reset(refresh=true) {
|
||||||
$("#bank").val("");
|
$("#bank").val("");
|
||||||
$("#user_note").val("");
|
$("#user_note").val("");
|
||||||
$("#profile_pic").attr("src", "/media/pic/default.png");
|
$("#profile_pic").attr("src", "/media/pic/default.png");
|
||||||
|
$("#profile_pic_link").attr("href", "#");
|
||||||
if (refresh) {
|
if (refresh) {
|
||||||
refreshBalance();
|
refreshBalance();
|
||||||
refreshHistory();
|
refreshHistory();
|
||||||
|
|
|
@ -12,8 +12,10 @@
|
||||||
{# User details column #}
|
{# User details column #}
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<div class="card border-success shadow mb-4 text-center">
|
<div class="card border-success shadow mb-4 text-center">
|
||||||
<img src="/media/pic/default.png"
|
<a id="profile_pic_link" href="#">
|
||||||
id="profile_pic" alt="" class="card-img-top">
|
<img src="/media/pic/default.png"
|
||||||
|
id="profile_pic" alt="" class="card-img-top">
|
||||||
|
</a>
|
||||||
<div class="card-body text-center">
|
<div class="card-body text-center">
|
||||||
<span id="user_note"></span>
|
<span id="user_note"></span>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -36,8 +36,8 @@ SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-3" id="note_infos_div">
|
<div class="col-md-3" id="note_infos_div">
|
||||||
<div class="card border-success shadow mb-4">
|
<div class="card border-success shadow mb-4">
|
||||||
<img src="/media/pic/default.png"
|
<a id="profile_pic_link" href="#"><img src="/media/pic/default.png"
|
||||||
id="profile_pic" alt="" class="img-fluid rounded mx-auto d-block">
|
id="profile_pic" alt="" class="img-fluid rounded mx-auto d-block"></a>
|
||||||
<div class="card-body text-center">
|
<div class="card-body text-center">
|
||||||
<span id="user_note"></span>
|
<span id="user_note"></span>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue