pp3/module/Application/view/application/verification/list.phtml (134 lines of code) (raw):
<?php
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
?>
<h3>My verification requests</h3>
<p>
Showing only your verification requests with yet undecided overal status.
</p>
<?= $this->partial('layout/flash.phtml'); ?>
<table class="table table-striped table-hover">
<thead>
<tr>
<th>Request for</th>
<th></th>
<th>Created</th>
<th>Overal status</th>
<th>My vote</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<?php
foreach ($this->pendingVerifications as $verification) {
$verificationRequest = array_key_exists($verification->getId(), $this->verificationRequests) ? $this->verificationRequests[$verification->getId()] : false;
$nbVersion = $verification->getNbVersionPluginVersion()->getNbVersion();
$pluginVersion = $verification->getNbVersionPluginVersion()->getPluginVersion();
$plugin = $pluginVersion->getPlugin();
echo '<tr>
<td>
<div class="text text-primary" style="font-size:1.2em"><a href="'.$pluginVersion->getUrl().'">'.$plugin->getName().'</a></div>';
echo '<table class="table" style="margin: 0">';
foreach($pluginVersion->getDigests() as $digest) {
printf("<tr><td>%s</td><td>%s</td></tr>\n", $digest->getAlgorithm(), $digest->getValue());
}
echo '</table>';
echo '</td>
<td>
<span class="badge">'.$pluginVersion->getVersion().'</span> <i class="fas fa-arrow-right"></i>
<span class="badge">NB '.$nbVersion->getVersion().'</span>
</td>
<td>'.$verification->getCreatedAt()->format('Y-m-d H:i').'</td>
<td>
<span class="badge '.$verification->getStatusBadgeClass().'" title="'.$verification->getStatusBadgeTitle().'">'.$verification->getStatusBadgeTitle().'</span>
</td>
<td>';
printf(
'<span class="badge %1$s" title="%2$s">%2$s</span>',
htmlspecialchars($verificationRequest ? $verificationRequest->getVoteBadgeClass() : ''),
htmlspecialchars($verificationRequest ? $verificationRequest->getVoteBadgeTitle() : 'Undecided')
);
echo '</td>
<td>
<div>
<a href="'.$this->url('verification', array('action'=>'vote-go'), array('query' => array('id'=>$verification->getId()))).'" class="btn btn-success" role="button">Go</a>
<a href="'.$this->url('verification', array('action'=>'vote-undecided'), array('query' => array('id'=>$verification->getId()))).'" class="btn btn-default" role="button">Undecided</a>
<button type="button" class="btn btn-danger" role="button" data-toggle="modal" data-target="#noGoModal-'.$verification->getId().'">NoGo</button>
';
// master options
if ($this->isAdmin) {
echo ' |
<a href="'.$this->url('verification', array('action'=>'vote-master-go'), array('query' => array('id'=>$verification->getId()))).'" class="btn btn-success" role="button">Master Go</a>
<button type="button" class="btn btn-danger" role="button" data-toggle="modal" data-target="#masterNoGoModal-'.$verification->getId().'">Master NoGo</a>
';
}
echo '
</div>
<div class="modal fade" id="noGoModal-'.$verification->getId().'" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<form action="'.$this->url('verification', array('action'=>'vote-nogo'), array('query' => array('id'=>$verification->getId()))).'" method="post">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title" id="myModalLabel">NoGo</h4>
</div>
<div class="modal-body">
<div class="form-group">
<label for="comment">NoGo Comment</label>
<textarea class="form-control" id="comment" name="comment" rows="5"
placeholder="Short description why giving NoGo"></textarea>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="submit" class="btn btn-danger">NoGo</button>
</div>
</div>
</div>
</form>
</div>
<div class="modal fade" id="masterNoGoModal-'.$verification->getId().'" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<form action="'.$this->url('verification', array('action'=>'vote-master-nogo'), array('query' => array('id'=>$verification->getId()))).'" method="post">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title" id="myModalLabel">NoGo</h4>
</div>
<div class="modal-body">
<div class="form-group">
<label for="comment">NoGo Comment</label>
<textarea class="form-control" id="comment" name="comment" rows="5"
placeholder="Short description why giving NoGo"></textarea>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="submit" class="btn btn-danger">NoGo</button>
</div>
</div>
</div>
</form>
</div>
</td>
</tr>';
}
?>
</tbody>
</table>