Skip to content

Commit

Permalink
Empty state fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
microstudi committed Jan 4, 2017
1 parent a72cbf3 commit e0f8a1e
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 18 deletions.
26 changes: 12 additions & 14 deletions Resources/templates/responsive/project/participate.php
@@ -1,28 +1,26 @@
<?php $this->layout('project/layout') ?>
<?php $this->section('main-content') ?>

<?php $project=$this->project;

?>
<?php $project=$this->project ?>

<div class="panel-group" id="accordion">

<!-- Backers start -->
<div class="panel panel-default widget">
<div class="panel-heading">
<h2 class="panel-title green-title" >
<?= $project->num_investors.' '.$this->text('project-menu-supporters') ?>
<?= $project->num_investors.' '.$this->text('project-menu-supporters') ?>
</h2>
<h2 class="panel-title grey-title spacer-10" >
<?= $project->num_messengers.' '.$this->text('project-collaborations-number') ?>
<?= $project->num_messengers.' '.$this->text('project-collaborations-number') ?>
</h2>
<div class="row">
<div class="chart-amount text-center">
</div>
</div>

<a class="accordion-toggle" data-toggle="collapse" data-target="#collapseTwo">
<h2 class="panel-title green-title text-center accordion-title" >
<h2 class="panel-title green-title text-center accordion-title" >
<?= $this->text('project-show-donors') ?>
<span class="icon glyphicon glyphicon glyphicon-menu-down" aria-hidden="true"></span>
</h2>
Expand All @@ -31,11 +29,11 @@
<div id="collapseTwo" class="panel-collapse collapse in">
<div class="panel-body">
<span class="anchor-mark" id="supporters" >
</span>
</span>
<?php foreach($this->investors_list as $invest): ?>
<div class="invest">
<div class="row info">
<div class="pull-left">
<div class="pull-left">
<?php if($invest->user!= 'anonymous'): ?>
<a href="/user/<?= $invest->user ?>"><img class="avatar" src="<?= $invest->avatar->getLink(45, 45, true); ?>">
</a>
Expand Down Expand Up @@ -103,7 +101,7 @@
<div class="panel-heading">
<h2 class="panel-title green-title normalize-padding">
<?= $this->text('project-menu-messages') ?>
<span class="icon glyphicon glyphicon-menu-down pull-right" aria-hidden="true"></span>
<span class="icon glyphicon glyphicon-menu-down pull-right" aria-hidden="true"></span>
</h2>
</div>
</a>
Expand Down Expand Up @@ -141,7 +139,7 @@
</div>
<div class="text-area">
<form method="post" action="/message/<?= $project->id ?>">
<input type="hidden" id="thread" name="thread" value="<?= $message->id ?>" />
<input type="hidden" id="thread" name="thread" value="<?= $message->id ?>" />
<textarea id="message-text" name="message" class="message" required></textarea>
<div class="col-sm-2 pull-right no-padding">
<button class="btn btn-block green" type="submit"><?= $this->text('blog-send_comment-button') ?></button>
Expand All @@ -150,14 +148,14 @@
</div>
</div>
</div>
<?php endif; ?>
<?php endif; ?>


<?php if (!empty($message->responses)) :
foreach ($message->responses as $child) : ?>
<div id="child-msg-<?= $child->id ?>" class="row no-margin normalize-padding message child<?= ($child->user->id == $project->owner) ? ' owner' : ' no-owner' ?> no-margin normalize-padding">
<?php if($child->user->id != $project->owner): ?>
<div class="pull-left">
<div class="pull-left">
<a href="/user/<?= $child->user->id ?>"><img class="avatar" src="<?= $child->user->avatar->getLink(45, 45, true); ?>"></a>
</div>
<?php endif; ?>
Expand Down
6 changes: 4 additions & 2 deletions Resources/templates/responsive/project/updates.php
Expand Up @@ -3,8 +3,10 @@

<?php
$num=0;
$total=count($this->milestones);
foreach($this->milestones as $update):
$milestones = $this->milestones;
if(!is_array($milestones)) $milestones = array();
$total=count($milestones);
foreach($milestones as $update):
$num++;
$identical_date=0;

Expand Down
4 changes: 2 additions & 2 deletions src/Goteo/Controller/Api/ChartsApiController.php
Expand Up @@ -131,8 +131,8 @@ public function projectInvestsAction($id) {
$cumulative_invests ++;
$ob[$invest->invested]['cumulative'] = round($cumulative);
$ob[$invest->invested]['cumulative-invests'] = round($cumulative_invests);
$ob[$invest->invested]['cumulative-amount-percent'] = round(100 * $cumulative / $mincost, 2);
$ob[$invest->invested]['cumulative-invests-percent'] = round(100 * $cumulative_invests / $total, 2);
$ob[$invest->invested]['cumulative-amount-percent'] = $mincost ? round(100 * $cumulative / $mincost, 2) : 0;
$ob[$invest->invested]['cumulative-invests-percent'] = $total ? round(100 * $cumulative_invests / $total, 2) : 0;
}
ksort($ob);
$ret = [];
Expand Down

0 comments on commit e0f8a1e

Please sign in to comment.