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

Ajustements sur page détail campagne

parent de5e6891
......@@ -2,19 +2,6 @@
/* 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;
}*/
#social-header{
display:none;
}
......@@ -23,32 +10,25 @@
min-height:unset;
}
.campaign .fin-progress {
.campaign-detail .campaign-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 {
.campaign-detail .progress {
margin: 0.5em 0;
border: solid 2px #2c3e50;
}
.campaign .fin-progress .donations {
background-color: #f2e732;
.campaign-detail .donation-bar,
.campaign-detail .donation-label {
background-color: #ffc600;
color: #333333;
}
.campaign .fin-progress .pledges {
background-color: #2c3e50;
/* Counters a minimum width for low/empty progress bar defined in Bootstrap. */
.campaign-detail .progress-bar[aria-valuenow="0"],
.campaign-detail .progress-bar[aria-valuenow="1"],
.campaign-detail .progress-bar[aria-valuenow="2"] {
min-width: 0
}
......@@ -7,6 +7,8 @@ $rest_txt = (string)$rest . $currency_symbol;
$donations_txt = (string)$camp["donationNumber"] . $currency_symbol;
$pledges_txt = (string)$camp["pledgeNumber"] . $currency_symbol;
$requested_text = (string)$camp["goal"] . $currency_symbol;
// Compute progress percentages
$donations_perc = round($camp["donationNumber"] / $camp["goal"] * 100);
$pledges_perc = "";
if ($rest <= 0) {
......@@ -14,24 +16,39 @@ if ($rest <= 0) {
} else {
$pledges_perc = round($camp["pledgeNumber"] / $camp["goal"] * 100);
}
// Clamp progress percentages
$min_perc = 2;
if ($donations_perc <= $min_perc) {
$donations_perc = $min_perc;
$pledges_perc = min($pledges_perc, 100 - $min_perc);
}
if ($pledges_perc <= $min_perc) {
$pledges_perc = $min_perc;
$donations_perc = min($donations_perc, 100 - $min_perc);
}
$donations_perc_txt = (string)$donations_perc;
$pledges_perc_txt = (string)$pledges_perc;
$eltId=key($element['parent']);
$eltType= $element['parent'][$eltId]['type'];
$eltName= $element['parent'][$eltId]['name'];
?>
<div class="campaign">
<h1><?php echo $element["name"]?><br>
<small><?php echo $camp["nameCamp"]?></small>
<span style="font-size:50%;text-transform: none;">Porté par
<a href="#page.type.<?php echo $eltType ?>.id.<?php echo $eltId ?>"
class="lbh" target="_blank"><?php echo $eltName ?></a>
</span>
</h1>
<div>
<div class="campaign-detail container">
<div class="row">
<div class="col-xs-12">
<h1><?php echo $element["name"]?><br>
<small><?php echo $camp["nameCamp"]?></small>
<span style="font-size:50%;text-transform: none;">Porté par
<a href="#page.type.<?php echo $eltType ?>.id.<?php echo $eltId ?>"
class="lbh" target="_blank"><?php echo $eltName ?></a>
</span>
</h1>
</div>
</div>
<div class="row">
<img class="img-responsive col-xs-12 col-sm-6 col-md-4" src="<?php echo $element["profilMediumImageUrl"]?>">
<div class="description col-xs-12 col-sm-6 col-md-8">
<h2>Description de l'action</h2>
......@@ -39,23 +56,23 @@ $eltName= $element['parent'][$eltId]['name'];
#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 : <?php echo $donations_txt ?></strong>
<div class="campaign-progress">
<div class="text-right">
<strong>Reste à financer : <?php echo $rest_txt ?> / <?php echo $requested_text ?></strong>
</div>
<div class="progress">
<div class="progress-bar donations" role="progressbar"
<div class="progress-bar donation-bar" role="progressbar"
style="width: <?php echo $donations_perc_txt ?>%"
aria-valuenow="<?php echo $donations_perc_txt ?>"
aria-valuemin="0" aria-valuemax="100"></div>
<div class="progress-bar pledges" role="progressbar"
<div class="progress-bar pledge-bar" role="progressbar"
style="width: <?php echo $pledges_perc_txt?>%"
aria-valuenow="<?php echo$pledges_perc_txt ?>"
aria-valuemin="0" aria-valuemax="100"></div>
</div>
<div>
<strong>Promesses : <?php echo $pledges_txt ?></strong>
<div><span class="label donation-label">Dons : <?php echo $donations_txt ?></span></div>
<div><span class="label pledge-label">Promesses : <?php echo $pledges_txt ?></span></div>
</div>
</div>
<div class="text-center">
......
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