Commit 18de7fe8 authored by Clément Damiens's avatar Clément Damiens
Browse files

Merged branch master into master

parents 9214208f df5a6793
......@@ -2703,15 +2703,28 @@ var directory = {
//SHOW HIDE VOTE BTNs
if(typeof userId != "undefined" && userId != null && userId != ""){
var btnSize = (params.status == "amendementAndVote") ? "6" : "12";
voteCount = "";
if(params.votes){
var vc = 0;
if(params.votes.up)
vc += Object.keys(params.votes.up).length;
if(params.votes.down)
vc += Object.keys(params.votes.down).length;
if(params.votes.uncomplet)
vc += Object.keys(params.votes.uncomplet).length;
if(params.votes.white)
vc += Object.keys(params.votes.white).length;
voteCount = " ("+vc+")";
}
if( (params.status == "tovote" || params.status == "amendementAndVote") && params.hasVote ===false )
str += '<a href="javascript:;" '+ linkParams + ' data-coop-section="vote" class="bg-green openCoopPanelHtml btn col-sm-'+btnSize+' "><i class="fa fa-gavel"></i> '+trad.Vote+'</a>';
str += '<a href="javascript:;" '+ linkParams + ' data-coop-section="vote" class="bg-green openCoopPanelHtml btn col-sm-'+btnSize+' "><i class="fa fa-gavel"></i> '+trad.Vote+voteCount+'</a>';
//str += '<a href="javascript:" '+ linkParams + ' class="btn-openVoteDetail bg-green btn col-sm-'+btnSize+' "><i class="fa fa-gavel"></i> '+trad.Vote+'</a>';
else if( (params.status == "tovote" || params.status == "amendementAndVote") && params.hasVote !==false )
str += '<a href="javascript:;" '+ linkParams + ' data-coop-section="vote" class="openCoopPanelHtml btn btn-default col-sm-'+btnSize+' "><i class="fa fa-eye"></i> '+trad["See votes"]+'</a>';
str += '<a href="javascript:;" '+ linkParams + ' data-coop-section="vote" class="openCoopPanelHtml btn btn-default col-sm-'+btnSize+' "><i class="fa fa-eye"></i> '+trad["See votes"]+voteCount+'</a>';
} else {
var btnSize = (params.status == "amendementAndVote") ? "6" : "12";
if( (params.status == "tovote" || params.status == "amendementAndVote") && params.hasVote ===false )
str += '<a href="javascript:" data-toggle="modal" data-target="#modalLogin" class="btn-menu-connect bg-green btn col-sm-'+btnSize+' "><i class="fa fa-gavel"></i> '+trad.Vote+'</a>';
str += '<a href="javascript:" data-toggle="modal" data-target="#modalLogin" class="btn-menu-connect bg-green btn col-sm-'+btnSize+' "><i class="fa fa-gavel"></i> '+trad.Vote+voteCount+'</a>';
}
if( (params.status == "amendementAndVote" || params.status =="amendable") ){
......@@ -2719,6 +2732,19 @@ var directory = {
str += '<a href="javascript:;" '+ linkParams + ' data-coop-section="amendments" class="openCoopPanelHtml btn btn-default text-purple col-sm-6 "><i class="fa fa-list"></i> '+trad.Amendements+amendCount+'</a>';
}
if(params.votes ){
str += "<div class='col-sm-12 padding-10'>";
if(params.votes.up)
str += "<div class='col-sm-3 text-green'><i class='fa fa-thumbs-up'></i> "+Object.keys(params.votes.up).length+"</div>";
if(params.votes.down)
str += "<div class='col-sm-3 text-red'><i class='fa fa-thumbs-down'></i> "+Object.keys(params.votes.down).length+"</div>";
if(params.votes.uncomplet)
str += "<div class='col-sm-3 text-dark'><i class='fa fa-hand-grab-o'></i> "+Object.keys(params.votes.uncomplet).length+"</div>";
if(params.votes.white)
str += "<div class='col-sm-3 text-orange'><i class='fa fa-circle-o'></i> "+Object.keys(params.votes.white).length+"</div>";
str += "</div>";
}
......
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