Commit f9391ee7 authored by Pascal Engélibert's avatar Pascal Engélibert

Add number of certs & community in menu

parent e979b00f
......@@ -69,6 +69,9 @@ body {
#mapmenu li {
list-style-type: none;
}
.idcard-community {
padding-left: 0.5em;
}
.searchresult {
border-bottom: 1px solid #e2dfd9;
cursor: pointer;
......@@ -108,6 +111,7 @@ a, a:visited {
<li><span style="color:#0c0;">Vert</span>&nbsp;: référent</li>
</ul>
<span id="mapmenu-naccounts"></span><br />
<span id="mapmenu-ncommunities"></span><br />
<input type="text" id="mapmenu-searchinput" value="" aria-label="Chercher un compte" placeholder="Chercher un compte" onkeyup="search(this.value, event.keyCode==13);" />
<div id="mapmenu-searchresults"></div>
<div id="mapmenu-idcard" class="idcard" style="display: none;">
......@@ -115,7 +119,9 @@ a, a:visited {
<input type="button" id="mapmenu-idcard-goto" value="Centrer" onclick="map.setView(accounts[active_account].pos);showURL();" /><br />
<img class="idcard-avatar" src="" alt="Avatar" style="display: none;" /><br />
<strong class="idcard-title"></strong><br />
<details><summary class="idcard-pubkey-short"></summary><span class="idcard-pubkey"></span></details><br />
<details><summary class="idcard-pubkey-short" title="Afficher le clé publique entière"></summary><span class="idcard-pubkey"></span></details>
<span class="idcard-community" style=""></span><br />
<span class="idcard-ncerts" title="Certifications &#10515; reçues / &#8613; émises"><span aria-label="Certifications reçues">&#10515;</span>&nbsp;<span class="idcard-ncerts-received"></span> &#8211 <span aria-label="Certifications émises">&#8613;</span>&nbsp;<span class="idcard-ncerts-issued"></span></span><br />
<input type="checkbox" id="mapmenu-idcard-onlycertsofsel" onchange="onlyShowCertsOfSelected();" autocomplete="off" />
<label for="mapmenu-idcard-onlycertsofsel">Afficher uniquement ses certifications</label><br />
<label for="mapmenu-idcard-onlycertsofsel-n">Niveaux&nbsp;:</label>
......
......@@ -53,7 +53,19 @@ class Account {
if(account.avatar) {
$("#mapmenu-idcard .idcard-avatar").attr("src", cesium_data_url+"user/profile/"+active_account+"/_image/avatar.png");
$("#mapmenu-idcard .idcard-avatar").attr("style", "display: initial;");
} else {
$("#mapmenu-idcard .idcard-avatar").attr("src", "");
$("#mapmenu-idcard .idcard-avatar").attr("style", "display: none;");
}
if(account.community != null) {
$("#mapmenu-idcard .idcard-community").html("Communauté <strong>"+account.community+"</strong>");
$("#mapmenu-idcard .idcard-community").attr("style", "border-left:1em solid "+communities[account.community].color+";");
} else {
$("#mapmenu-idcard .idcard-community").html("");
$("#mapmenu-idcard .idcard-community").attr("style", "");
}
$("#mapmenu-idcard .idcard-ncerts-received").html(account.certsReceived.length);
$("#mapmenu-idcard .idcard-ncerts-issued").html(account.certsIssued.length);
$("#mapmenu-idcard-cesiumlink").attr("href", cesium_url+"#/app/wot/"+active_account+"/");
for(var cert in account.certsIssued) {
certs[account.certsIssued[cert]].line.setStyle({color:"#4f4", weight:3, opacity:0.6});
......@@ -85,6 +97,8 @@ function mapInactiveAccount(pubkey) {
$("#mapmenu-idcard .idcard-pubkey").html("");
$("#mapmenu-idcard .idcard-pubkey-short").html();
$("#mapmenu-idcard .idcard-avatar").attr("style", "display: none;");
$("#mapmenu-idcard .idcard-community").html("");
$("#mapmenu-idcard .idcard-community").attr("style", "");
$("#mapmenu-idcard-cesiumlink").attr("href", "#");
for(var cert in account.certsIssued) {
certs[account.certsIssued[cert]].line.setStyle({color:"black", weight:1, opacity:0.3});
......@@ -414,6 +428,8 @@ function computeCommunities(circles=false) {
l_communities.addTo(map);
l_communities.remove(map);
$("#mapmenu-ncommunities").html(i + " communautés");
var voronoi = d3.voronoi()
.x(function(a) { return accounts[a].pos[0]; })
.y(function(a) { return accounts[a].pos[1]; });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment