+++ /dev/null
-<?php
-
-/**
- * Contains rewiew about a software
- */
-?>
-
-<?php if (isset($project) && $project!=null && !empty( $project->reviews ) ): ?>
-<section class="">
- <div class="align">
- <h2>
- <?= __d("ElementProject","Reviews for")?> <?= __d("ElementProject","{0}",$project->softwarename)?>
- </h2>
- <span>
- <?php if ( sizeof($project->reviews) > Cake\Core\Configure::read("MAX_DISPLAY") ) : ?>
- <?= $this->Html->link( __d("Layout","See all"),
- ['controller' => 'Project', 'action' => 'reviews','?' => ['id' => $project->id]],
- ['title' => __d("Layout","All reviews of {0}",$project->softwarename)],
- ['escape' => false] ) ?>
- <?php endif; ?>
- </span>
- </div>
- <?php for ($nbReview = 0; $nbReview < Cake\Core\Configure::read("MAX_DISPLAY"); $nbReview ++): ?>
- <?php if (isset($project->reviews[$nbReview] ) ) : ?>
-
- <div class="col-xs-11 col-sm-5 col-md-5 col-lg-5">
- <ol class=" list-unstyled list-inline">
- <li class="col-xs-11 col-sm-11 col-md-11 col-lg-11">
- <h3> <?= $this->Text->truncate($project->reviews[$nbReview]->title,100,['ellipsis' => '...','exact' => false] ); ?> </h3>
- </li>
- <li>
- <?php
- echo $this->Time->format(
- strtotime($project->reviews[$nbReview]->created),
- "d-M-Y",//\IntlDateFormatter::SHORT,
- null
- );
- ?>
- </li>
- <li>
- <?php echo $this->cell('UserSummary',[$project->reviews[$nbReview]->user_id])->render('../../Element/Entity/entityName')?>
- </li>
- <li>
- <div class="ratingStar">
- <?= $this->element("ProjectPage/reviewStars",["evaluation" => $project->reviews[$nbReview]->evaluation]) ?>
- </div>
- </li>
- </ol>
- <p class="col-xs-11 col-sm-11 col-md-11 col-lg-11">
- <?= $this->Text->truncate($project->reviews[$nbReview]->comment,350,['ellipsis' => '...','exact' => false] ); ?>
- </p>
- </div>
- <?php endif; ?>
- <?php endfor;?>
-</section>
-<?php endif; ?>
-
-<?php
-
-/**
- * All reviews display
- */
-?>
-
-<?php if (!isset($project) && !empty( $reviews->reviews ) ): ?>
-<section class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
- <h2>
- <?= __d("ElementProject","Reviews for")?> <?php echo $this->cell('SoftwareSummary',[$reviews->reviews[0]->software_id])->render('../../Element/ProjectPage/softwareName')?>
- </h2>
-
- <?php foreach ($reviews->reviews as $review) : ?>
- <div class="col-xs-11 col-sm-6 col-md-6 col-lg-6">
- <ol class=" list-unstyled list-inline">
- <li class="col-xs-11 col-sm-11 col-md-11 col-lg-11">
- <h3> <?php echo $review->title ;?> </h3>
- </li>
- <li>
- <?php echo $review->created ;?>
- </li>
- <li>
- <?php echo $this->cell('UserSummary',[$review->user_id])->render('../../Element/Entity/entityName')?>
- </li>
- <li>
- <div class="ratingStar">
- <?= $this->element("ProjectPage/reviewStars",["evaluation" => $review->evaluation]) ?>
- </div>
- </li>
- </ol>
- <p class="col-xs-11 col-sm-11 col-md-11 col-lg-11">
- <?= $review->comment ; ?>
- </p>
- </div>
- <?php endforeach; ?>
-</section>
-<?php endif; ?>
-
-<?php if (empty( $project->reviews ) && !isset( $reviews ) ): ?>
-<section class="">
- <h2>
- <?= __d("ElementProject","Reviews for ")?> <?= __("{0}",$project->softwarename)?>
- </h2>
-
- <p>
- <?php echo __d("ElementProject","Be the first to post a review for {0}.",$project->softwarename)?>
- </p>
-</section>
-<?php endif; ?>
-<?php if (!isset( $project->reviews ) && empty( $reviews->reviews ) ): ?>
-<section class="">
- <h2>
- <?= __d("ElementProject","Reviews for ")?> <?php echo $this->cell('SoftwareSummary',[$reviews->id])->render('../../Element/ProjectPage/softwareName')?>
- </h2>
-
- <p>
- <?php echo __d("ElementProject","Be the first to post a review for ")?>
- <?php echo $this->cell('SoftwareSummary',[$reviews->id])->render('../../Element/ProjectPage/softwareName').'.'?>
- </p>
-</section>
-<?php endif; ?>
\ No newline at end of file