This is an automated email from the ASF dual-hosted git repository.

jpirek pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans-tools.git


The following commit(s) were added to refs/heads/master by this push:
     new 095e1ee  Verification log poup
     new ed691f1  Merge pull request #24 from jpirek/master
095e1ee is described below

commit 095e1ee84d21524b2927255e05f7f38578278461
Author: Jan Pirek <jan.pi...@oracle.com>
AuthorDate: Sun Jan 12 13:32:57 2020 +0100

    Verification log poup
---
 .../src/Application/Controller/IndexController.php | 17 ++++-
 .../Application/Controller/PluginController.php    |  1 -
 .../Application/Factory/IndexControllerFactory.php |  6 +-
 .../view/application/index/catalogue.phtml         | 21 ++++-
 .../view/application/index/verification-log.phtml  | 20 +++++
 pp3/public/js/script.js                            | 11 +++
 pp3/public/scss/style.css                          | 89 +++++++++++++++-------
 pp3/public/scss/style.css.map                      | 14 ++--
 pp3/public/scss/style.scss                         | 14 +++-
 9 files changed, 153 insertions(+), 40 deletions(-)

diff --git 
a/pp3/module/Application/src/Application/Controller/IndexController.php 
b/pp3/module/Application/src/Application/Controller/IndexController.php
index 5e7d863..d91177b 100755
--- a/pp3/module/Application/src/Application/Controller/IndexController.php
+++ b/pp3/module/Application/src/Application/Controller/IndexController.php
@@ -32,14 +32,16 @@ class IndexController extends BaseController {
     private $_paginator;
     private $_categoryRepository;
     private $_nbVersionRepository;
+    private $_verificationRepository;
 
-    public function __construct($pluginRepo, $config, PaginatorInterface 
$paginator, $nbVersionRepository, $categoryRepository, $pvRepo) {
+    public function __construct($pluginRepo, $config, PaginatorInterface 
$paginator, $nbVersionRepository, $categoryRepository, $pvRepo, 
$verificationRepository) {
         parent::__construct($config);
         $this->_pluginRepository = $pluginRepo;
         $this->_paginator = $paginator;
         $this->_nbVersionRepository = $nbVersionRepository;
         $this->_categoryRepository = $categoryRepository;
         $this->_pluginVersionRepository = $pvRepo;
+        $this->_verificationRepository = $verificationRepository;
     }
 
     public function indexAction() {   
@@ -92,4 +94,17 @@ class IndexController extends BaseController {
         }
        
     }
+
+    public function verificationLogAction() {
+        $vId = $this->params()->fromQuery('vId');
+        if ($vId) {
+            $verification = $this->_verificationRepository->find($vId);
+        }
+        $result = new ViewModel([
+            'verification' => $verification,
+        ]);
+        $result->setTerminal(true);
+        return $result;
+    }
+
 }
diff --git 
a/pp3/module/Application/src/Application/Controller/PluginController.php 
b/pp3/module/Application/src/Application/Controller/PluginController.php
index ddde60d..9645982 100644
--- a/pp3/module/Application/src/Application/Controller/PluginController.php
+++ b/pp3/module/Application/src/Application/Controller/PluginController.php
@@ -373,5 +373,4 @@ P.S.: This is an automatic email. DO NOT REPLY to this 
email. ');
         }
         return $response;
     }
-
 }
diff --git 
a/pp3/module/Application/src/Application/Factory/IndexControllerFactory.php 
b/pp3/module/Application/src/Application/Factory/IndexControllerFactory.php
index 50dcf7b..cd3ddb5 100755
--- a/pp3/module/Application/src/Application/Factory/IndexControllerFactory.php
+++ b/pp3/module/Application/src/Application/Factory/IndexControllerFactory.php
@@ -27,6 +27,7 @@ use Application\Controller\IndexController;
 use Application\Repository\NbVersionRepository;
 use Application\Repository\CategoryRepository;
 use Application\Repository\PluginVersionRepository;
+use Application\Repository\VerificationRepository;
 
 class IndexControllerFactory implements FactoryInterface
 {
@@ -46,6 +47,9 @@ class IndexControllerFactory implements FactoryInterface
         $pvRepository = new PluginVersionRepository();
         $pvRepository->setEntityManager($em);
 
-        return new IndexController($repository, $config, $paginator, 
$nbVersionRepository, $categoryRepository, $pvRepository);
+        $verificationRepository = new VerificationRepository();
+        $verificationRepository->setEntityManager($em);
+
+        return new IndexController($repository, $config, $paginator, 
$nbVersionRepository, $categoryRepository, $pvRepository, 
$verificationRepository);
     }
 }
diff --git a/pp3/module/Application/view/application/index/catalogue.phtml 
b/pp3/module/Application/view/application/index/catalogue.phtml
index 280c54d..96746e1 100644
--- a/pp3/module/Application/view/application/index/catalogue.phtml
+++ b/pp3/module/Application/view/application/index/catalogue.phtml
@@ -66,8 +66,9 @@ if ($plugin) {
             echo '<tr><td><span 
class="badge">'.$version->getVersion().'</span></td><td>';
             foreach ($version->getNbVersionsPluginVersions() as $nbvPv) {
                 if ($nbvPv->getVerificationId()) {
-                    echo '<a href="./download?id='.$version->getId().'" 
title="Download" target="_blank"><span class="badge 
'.$nbvPv->getVerification()->getStatusBadgeClass().'" title="Download">
-                    <i class="fas fa-download"></i> NB 
'.$nbvPv->getNbVersion()->getVersion().' - 
'.$nbvPv->getVerification()->getStatusBadgeTitle().'</span></a> &nbsp; ';
+                    echo '<span class="badge 
'.$nbvPv->getVerification()->getStatusBadgeClass().'">
+                    <a href="./download?id='.$version->getId().'" 
title="Download" target="_blank" class="dllink"><i class="fas fa-download"></i> 
NB '.$nbvPv->getNbVersion()->getVersion().'</a> 
+                    - <span class="verifPopupLink" data-toggle="modal" 
data-verification-id="'.$nbvPv->getVerification()->getId().'" 
data-target="#verifPopup" title="Show verification 
details">'.$nbvPv->getVerification()->getStatusBadgeTitle().'</span></span> 
&nbsp; ';
                 } else {
                     echo '<a href="./download?id='.$version->getId().'" 
title="Download" target="_blank"><span class="badge badge-brown"><i class="fas 
fa-download"></i> NB '.$nbvPv->getNbVersion()->getVersion().'</span></a> &nbsp; 
';
                 }
@@ -103,6 +104,18 @@ if ($plugin) {
     </div>
     <br/>
     ';
-    
+}
+?>
 
-}
\ No newline at end of file
+<div class="modal fade" id="verifPopup" tabindex="-1" role="dialog" 
aria-labelledby="myModalLabel">
+    <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">&times;</span></button>
+                <h4 class="modal-title" id="myModalLabel">Plugin verificaion 
log</h4>
+            </div>
+            <div class="modal-body" id="verifBody">        
+            </div>
+        </div>
+    </div>
+</div>    
\ No newline at end of file
diff --git 
a/pp3/module/Application/view/application/index/verification-log.phtml 
b/pp3/module/Application/view/application/index/verification-log.phtml
new file mode 100644
index 0000000..bc8eaf4
--- /dev/null
+++ b/pp3/module/Application/view/application/index/verification-log.phtml
@@ -0,0 +1,20 @@
+<?php
+if ($this->verification) {
+    echo '<table class="table table-striped">';
+    echo '<tr>
+    <td>['.date_format($this->verification->getCreatedAt(), 'Y-m-d 
H:i').']</td>
+    <td>Verification request created</td>
+    <td></td>
+    </tr>';
+    foreach ($this->verification->getVerificationRequests() as $vRq) {
+        if ($vRq->getVotedAt()) {
+            $txt = $vRq->getVerifier()->getName().' voted 
<b>'.$vRq->getVoteBadgeTitle().'</b>'; 
+            echo '<tr>
+            <td>['.date_format($vRq->getVotedAt(), 'Y-m-d H:i').']</td>
+            <td>'.$txt.'</td>
+            <td>'.$this->escapeHtml($vRq->getComment()).'</td>
+            </tr>';
+        }
+    }
+    echo '</table>';
+}
\ No newline at end of file
diff --git a/pp3/public/js/script.js b/pp3/public/js/script.js
index 18a4731..c4ec7f6 100755
--- a/pp3/public/js/script.js
+++ b/pp3/public/js/script.js
@@ -34,4 +34,15 @@ $(function () {
       });
     }, false);
 
+
+    $('#verifPopup').on('show.bs.modal', function (event) {
+      const verificationId = 
event.relatedTarget.getAttribute('data-verification-id');
+      if (verificationId) {
+        $.get( `../verification-log/?vId=${verificationId}`, function( data ) {
+          $('#verifBody').html( data );
+        });
+      }
+    });
+    
+
 });
diff --git a/pp3/public/scss/style.css b/pp3/public/scss/style.css
index 62a8c99..ddcb434 100644
--- a/pp3/public/scss/style.css
+++ b/pp3/public/scss/style.css
@@ -17,57 +17,73 @@
  * under the License.
  */
 body {
-  padding-bottom: 20px; }
+  padding-bottom: 20px;
+}
 
 .navbar {
-  margin-bottom: 10px; }
+  margin-bottom: 10px;
+}
 
 .navbar-brand .fa {
   margin-right: 5px;
-  color: white; }
+  color: white;
+}
 
 .navbar-nav {
-  margin: 5px; }
+  margin: 5px;
+}
 
 .navbar-fixed-top {
-  z-index: 1; }
+  z-index: 1;
+}
 
 .badge-red {
-  background-color: #c12e2a; }
+  background-color: #c12e2a;
+}
 
 .badge-green {
-  background-color: #099c09; }
+  background-color: #099c09;
+}
 
 .badge-blue {
-  background-color: #269eda; }
+  background-color: #269eda;
+}
 
 .badge-brown {
-  background-color: #b59c70; }
+  background-color: #b59c70;
+}
 
 .color-red {
-  color: #c12e2a; }
+  color: #c12e2a;
+}
 
 .color-green {
-  color: #099c09; }
+  color: #099c09;
+}
 
 .admin-nav a {
   display: inline-block;
-  margin-right: 20px; }
+  margin-right: 20px;
+}
 
 .r-white {
-  color: white; }
+  color: white;
+}
 
 .navbar-inverse .navbar-nav > li > a {
-  color: #c7c7c7; }
+  color: #c7c7c7;
+}
 
 .pp-footer {
   border-top: 1px solid #ddd;
   padding-top: 20px;
   text-align: center;
-  margin-top: 20px; }
+  margin-top: 20px;
+}
 
 #pp-navbar {
-  position: relative; }
+  position: relative;
+}
 
 #loginProviderList .providerIcon {
   display: inline-block;
@@ -76,15 +92,36 @@ body {
   height: 32px;
   background-size: contain;
   margin-right: 1ex;
-  background-repeat: no-repeat; }
+  background-repeat: no-repeat;
+}
 
 #loginProviderList .list-group-item {
-  padding: 0; }
-  #loginProviderList .list-group-item a {
-    padding: 10px 15px;
-    text-decoration: none;
-    color: black;
-    background-color: white; }
-    #loginProviderList .list-group-item a:hover, #loginProviderList 
.list-group-item a:focus {
-      color: black;
-      background-color: #e8e8e8; }
+  padding: 0;
+}
+
+#loginProviderList .list-group-item a {
+  padding: 10px 15px;
+  text-decoration: none;
+  color: black;
+  background-color: white;
+}
+
+#loginProviderList .list-group-item a:hover, #loginProviderList 
.list-group-item a:focus {
+  color: black;
+  background-color: #e8e8e8;
+}
+
+.dllink {
+  color: inherit;
+}
+
+.dllink:hover {
+  color: inherit;
+  text-decoration: underline;
+}
+
+.verifPopupLink:hover {
+  text-decoration: underline;
+  cursor: pointer;
+}
+/*# sourceMappingURL=style.css.map */
\ No newline at end of file
diff --git a/pp3/public/scss/style.css.map b/pp3/public/scss/style.css.map
index 1fce345..1b4f000 100644
--- a/pp3/public/scss/style.css.map
+++ b/pp3/public/scss/style.css.map
@@ -1,7 +1,9 @@
 {
-"version": 3,
-"mappings": 
"AAAA,IAAK;EAED,cAAc,EAAE,IAAI;;AAGxB,OAAQ;EACJ,aAAa,EAAE,IAAI;;AAEvB,iBAAkB;EACd,YAAY,EAAE,GAAG;EACjB,KAAK,EAAE,KAAK;;AAEhB,WAAY;EACR,MAAM,EAAE,GAAG;;AAEf,iBAAkB;EACd,OAAO,EAAE,CAAC;;AAEd,UAAW;EACP,gBAAgB,EAAE,OAAO;;AAE7B,YAAa;EACT,gBAAgB,EAAE,OAAO;;AAE7B,WAAY;EACR,gBAAgB,EAAC,OAAO;;AAE5B,YAAa;EAET,gBAAgB,EAAE,OAAO;;AAG7B,UAAW;EACP,KAAK,EAAE,OAAO;;AAElB,YAAa;EACT,KAAK,EAAE,OAAO;;AAElB,YAAa;EACT,OAAO,EAAE,YAAY;EACrB,YAAY,EAAE,IAAI;;AAEtB,QAAS;EACL,KAAK,EAAE,KAAK;;AAEhB,oCAAiC
 [...]
-"sources": ["style.scss"],
-"names": [],
-"file": "style.css"
-}
+    "version": 3,
+    "mappings": 
"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,AAAA,IAAI,CAAC;EAED,cAAc,EAAE,IAAI;CACvB;;AAED,AAAA,OAAO,CAAC;EACJ,aAAa,EAAE,IAAI;CACtB;;AACD,AAAA,aAAa,CAAC,GAAG,CAAC;EACd,YAAY,EAAE,GAAG;EACjB,KAAK,EAAE,KAAK;CACf;;AACD,AAAA,WAAW,CAAC;EACR,MAAM,EAAE,GAAG;CACd;;AACD,AAAA,iBAAiB,CAAC;EACd,OAAO,EAAE,CAAC;CACb;;AACD,AAAA,UAAU,CAAC;EACP,gBAAgB,EAAE,OAAO;CAC5B;;AACD,AAAA,YAAY,CAAC;EACT,gBAAgB,EAAE,OAAO;CAC5B;;AACD,AAAA,WAAW,CAAC;EACR,gBAAgB,EAAC,OAAO;CAC3B;;AACD,AAAA,YAAY,CAAC;EAET,gBAAgB,EAAE
 [...]
+    "sources": [
+        "style.scss"
+    ],
+    "names": [],
+    "file": "style.css"
+}
\ No newline at end of file
diff --git a/pp3/public/scss/style.scss b/pp3/public/scss/style.scss
index 159613e..c421abb 100755
--- a/pp3/public/scss/style.scss
+++ b/pp3/public/scss/style.scss
@@ -96,4 +96,16 @@ body {
             background-color: #e8e8e8;
         }
     }
-}
\ No newline at end of file
+}
+
+.dllink  {
+    color: inherit;
+    &:hover {
+        color: inherit;
+        text-decoration: underline;
+    }
+}
+.verifPopupLink:hover {
+    text-decoration: underline;
+    cursor: pointer;
+}


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to