Commit 19216d03 authored by Marc-Antoine Dupré's avatar Marc-Antoine Dupré
Browse files

Merge branch 'cofinancement-marc-antoine' into development

parents c926266e 2c634dc9
/* coFinancement costum colors */
/* main color = #f2e732 */
/* secondary color = #2c3e50 */
.campaign img {
display: inline-block;
width: 40%;
vertical-align: center;
}
.campaign .description {
width: 55%;
display: inline-block;
padding: 0;
}
.campaign .fin-progress {
display: inline-block;
width: 100%;
padding: 1em;
}
.campaign .fin-progress > div {
margin-bottom: 0.8em;
}
.campaign .fin-progress > div:nth-of-type(1) {
display: flex;
}
.campaign .fin-progress > div:nth-of-type(1) > * {
flex: 1;
}
.campaign .fin-progress .progress {
border: solid 2px #2c3e50;
}
.campaign .fin-progress .donations {
background-color: #f2e732;
}
.campaign .fin-progress .pledges {
background-color: #2c3e50;
}
<div class="row">
<div class="col-lg-12">
<a class="no-underline" href="http://www.elections-legislatives.fr/circonscriptions/059.asp" target="blank">
<h1>59 -Nord<br><small>1<sup>ère</sup> circonscription</small></h1>
</a>
</div>
</div>
<div class="row">
<div class="col-xs-12 col-sm-5 col-md-5 col-lg-5">
<div style="margin-top:35px; background-image:url('/data/2021/04/12/1618245058cbd13bfa9a14aba437830839652d954b/photo-fit.jpg');" class="square-pic-group"></div>
</div>
<div class="col-xs-12 col-sm-7 col-md-7 col-lg-7">
<h3>Contacter le groupe local</h3>
<ul> <li><a href="mailto:hello@te.st">hello@te.st</a></li> <li><a href="https://www.facebook.com/doesntexist">Page Facebook</a></li> <li><a href="https://www.facebook.com/groups/doesntexist">Groupe Facebook</a></li> <li><a href="https://www.twitter.com/doesntexist">Compte Twitter</a></li> </ul>
<img src="http://dons-mavoix.my-idea-box.net/smallpic/dons/3/tirelire.png" alt="Progression des dons" style="width:100%">
<div class="text-center m-t-x2 m-b-x2">
<a href="javascript:;" class="btn btn-lg btn-primary editPledge">Je cofinance cette campagne !</a>
</div>
</div>
</div>
<div class="row">
<div class="col-xs-12">
<h3 id="budget">Budget de campagne</h3>
<div class="table-responsive">
<table class="table">
<tbody><tr><td>Impression et livraison des affiches électorales </td><td>&nbsp;euros</td></tr><tr> </tr><tr><td>Impression et livraison des bulletins de vote </td><td>&nbsp;euros</td></tr><tr>
</tr><tr><td>Impression et livraison des professions de foi </td><td>&nbsp;euros</td></tr><tr>
</tr><tr><td>Frais bancaires </td><td>400&nbsp;euros</td></tr><tr> </tr><tr><td>Frais postaux pour l'envoi des reçus fiscaux </td><td>978&nbsp;euros</td></tr><tr>
</tr><tr><td>Expertise comptable du compte de campagne </td><td>&nbsp;euros</td></tr><tr>
</tr><tr><td>Autres dépenses </td><td>3&nbsp;euros</td></tr><tr>
</tr></tbody></table>
</div>
<p>Total : <strong><span style="font-size:1.2em">6381 euros</span></strong></p>
</div>
</div>
<script type="text/javascript">
jQuery(document).ready(function() {
pageProfil.bindViewActionEvent();
descHtml="<i>Pas de description pour ce tiers-lieux</i>"
$(".editPledge").click(function(){
dyFObj.editMode=true;
//uploadObj.set(type, id);
uploadObj.update = true;
dyFObj.currentElement={type : contextData.type, id : contextData.id};
dataEdit=jQuery.extend(true, {},contextData);
if(typeof contextData.typeOrga != "undefined")
dataEdit.type=contextData.typeOrga;
dyFObj.openForm('pledge', null, dataEdit);
});
});
</script>
\ No newline at end of file
<div class="campaign">
</div>
<div class="row">
<div class="col-lg-12">
<a class="no-underline" href="http://www.elections-legislatives.fr/circonscriptions/059.asp" target="blank">
<h1>59 -Nord<br><small>1<sup>ère</sup> circonscription</small></h1>
</a>
</div>
</div>
<div class="row">
<div class="col-xs-12 col-sm-5 col-md-5 col-lg-5">
<div style="margin-top:35px; background-image:url('/data/2021/04/12/1618245058cbd13bfa9a14aba437830839652d954b/photo-fit.jpg');" class="square-pic-group"></div>
</div>
<div class="col-xs-12 col-sm-7 col-md-7 col-lg-7">
<script type="text/javascript">
function renderCampaignDetail(campaign) {
let currency_symbol = "";
<h3>Contacter le groupe local</h3>
<ul> <li><a href="mailto:hello@te.st">hello@te.st</a></li> <li><a href="https://www.facebook.com/doesntexist">Page Facebook</a></li> <li><a href="https://www.facebook.com/groups/doesntexist">Groupe Facebook</a></li> <li><a href="https://www.twitter.com/doesntexist">Compte Twitter</a></li> </ul>
let rest = campaign.campaign_amount - campaign.donation_amount - campaign.pledge_amount;
<img src="http://dons-mavoix.my-idea-box.net/smallpic/dons/3/tirelire.png" alt="Progression des dons" style="width:100%">
let rest_txt = rest.toString() + currency_symbol;
let donations_txt = campaign.donation_amount.toString() + currency_symbol;
let pledges_txt = campaign.pledge_amount.toString() + currency_symbol;
let requested_text = campaign.campaign_amount.toString() + currency_symbol;
<div class="text-center m-t-x2 m-b-x2">
<a href="javascript:;" class="btn btn-lg btn-primary editPledge">Je cofinance cette campagne !</a>
</div>
</div>
let donations_perc = Math.round(campaign.donation_amount / campaign.campaign_amount * 100);
let pledges_perc = "";
if (rest <= 0) {
pledges_perc = 100 - donations_perc;
} else {
pledges_perc = Math.round(campaign.pledge_amount / campaign.campaign_amount * 100);
}
let donations_perc_txt = donations_perc.toString();
let pledges_perc_txt = pledges_perc.toString();
let str = `
<h1>#nom-de-l'organisation#<br>
<small>#nom-de-la-campagne#</small>
</h1>
<div>
<img src="${campaign.image_url}">
<section class="description">
<h2>Description de l'action</h2>
<p>#description-de-la-campagne#//#description-de-la-campagne#//#description-de-la-campagne#//
#description-de-la-campagne#//#description-de-la-campagne#//#description-de-la-campagne#//
#description-de-la-campagne#//#description-de-la-campagne#//#description-de-la-campagne#//
#description-de-la-campagne#//#description-de-la-campagne#//#description-de-la-campagne#</p>
<div class="fin-progress">
<div>
<strong>Dons : ${donations_txt}</strong>
<strong>Reste à financer : ${rest_txt} / ${requested_text}</strong>
</div>
<div class="row">
<div class="col-xs-12">
<h3 id="budget">Budget de campagne</h3>
<div class="table-responsive">
<table class="table">
<tbody><tr><td>Impression et livraison des affiches électorales </td><td>&nbsp;euros</td></tr><tr> </tr><tr><td>Impression et livraison des bulletins de vote </td><td>&nbsp;euros</td></tr><tr>
</tr><tr><td>Impression et livraison des professions de foi </td><td>&nbsp;euros</td></tr><tr>
</tr><tr><td>Frais bancaires </td><td>400&nbsp;euros</td></tr><tr> </tr><tr><td>Frais postaux pour l'envoi des reçus fiscaux </td><td>978&nbsp;euros</td></tr><tr>
</tr><tr><td>Expertise comptable du compte de campagne </td><td>&nbsp;euros</td></tr><tr>
</tr><tr><td>Autres dépenses </td><td>3&nbsp;euros</td></tr><tr>
</tr></tbody></table>
</div>
<p>Total : <strong><span style="font-size:1.2em">6381 euros</span></strong></p>
</div>
<div class="progress">
<div class="progress-bar donations" role="progressbar" style="width: ${donations_perc_txt}%" aria-valuenow="${donations_perc_txt}" aria-valuemin="0" aria-valuemax="100"></div>
<div class="progress-bar pledges" role="progressbar" style="width: ${pledges_perc_txt}%" aria-valuenow="${pledges_perc_txt}" aria-valuemin="0" aria-valuemax="100"></div>
</div>
<div>
<strong>Promesses : ${pledges_txt}</strong>
</div>
</div>
<div class="text-center">
<a href="javascript:;" class="btn btn-lg btn-primary editPledge">Je cofinance cette campagne !</a>
</div>
<script type="text/javascript">
jQuery(document).ready(function() {
pageProfil.bindViewActionEvent();
$(".editPledge").click(function(){
dyFObj.editMode=true;
//uploadObj.set(type, id);
uploadObj.update = true;
dyFObj.currentElement={type : contextData.type, id : contextData.id};
dataEdit=jQuery.extend(true, {},contextData);
if(typeof contextData.typeOrga != "undefined")
dataEdit.type=contextData.typeOrga;
dyFObj.openForm('pledge', null, dataEdit);
});
</section>
</div>
`;
return str;
}
function displayCampaign(element) {
let img_url = notEmpty(contextData.profilMediumImageUrl) ? contextData.profilMediumImageUrl : contextData.defaultImg;
// TODO: fetch real values from the campaign's associated pledges.
let sum = parseInt(contextData.campaignSum);
let campaign = {
donation_amount: Math.round(sum/4.7),
pledge_amount: Math.round(sum/2.9),
campaign_amount: sum,
image_url: img_url
};
element.innerHTML = renderCampaignDetail(campaign);
}
});
</script>
\ No newline at end of file
jQuery(document).ready(function() {
pageProfil.bindViewActionEvent();
$(".editPledge").click(function(){
dyFObj.editMode=true;
//uploadObj.set(type, id);
uploadObj.update = true;
dyFObj.currentElement={type : contextData.type, id : contextData.id};
dataEdit=jQuery.extend(true, {},contextData);
if(typeof contextData.typeOrga != "undefined")
dataEdit.type=contextData.typeOrga;
dyFObj.openForm('pledge', null, dataEdit);
});
displayCampaign($(".campaign")[0]);
});
</script>
......@@ -34,7 +34,7 @@
renderView : "directory.specific"
},
defaults:{
types : ["poi"],
types : ["organizations"],
indexStep : 0,
sortBy : [
"name"
......
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