From 92c7970e030391a998ffa6cb7b3c381686f10e1d Mon Sep 17 00:00:00 2001 From: patrikx3 Date: Thu, 11 Jul 2019 12:53:00 +0200 Subject: [PATCH] robo8x [chore] 7/11/2019, 12:53:00 PM --- INSTALL.md | 2 +- README.md | 4 ++-- artifacts/php-7.2-ubuntu.md | 2 +- artifacts/screenshots.md | 2 +- change-break.md | 2 +- changelog.md | 7 ++++++- package.json | 4 ++-- src/Gitter/Client.php | 2 +- src/Gitter/Model/File.php | 9 +++++++++ src/Gitter/Model/Tree.php | 40 +++++++++++++++++++++++++++++++++++++ src/browser/js/themes.js | 36 ++++++++++++++++----------------- src/browser/less/tree.less | 7 +++++++ src/twig/tree.twig | 33 +++++++++++++++++++++++------- todo.md | 2 +- 14 files changed, 116 insertions(+), 36 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index 99f2930f..0ee17b93 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -124,7 +124,7 @@ All my domains ([patrikx3.com](https://patrikx3.com) and [corifeus.com](https:// --- -[**P3X-GITLIST**](https://pages.corifeus.com/gitlist) Build v2019.10.107 +[**P3X-GITLIST**](https://pages.corifeus.com/gitlist) Build v2019.10.110 [![Donate for Corifeus / P3X](https://img.shields.io/badge/Donate-Corifeus-003087.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=QZVM4V6HVZJW6) [![Contact Corifeus / P3X](https://img.shields.io/badge/Contact-P3X-ff9900.svg)](https://www.patrikx3.com/en/front/contact) [![Like Corifeus @ Facebook](https://img.shields.io/badge/LIKE-Corifeus-3b5998.svg)](https://www.facebook.com/corifeus.software) diff --git a/README.md b/README.md index cb62f38b..36b7730d 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ -# 🤖 P3X Gitlist - A decorated enhanced elegant, feature rich and modern private git ui repository viewer v2019.10.107 +# 🤖 P3X Gitlist - A decorated enhanced elegant, feature rich and modern private git ui repository viewer v2019.10.110 **Note about versioning:** Versions are cut in Major.Minor.Patch schema. Major is always the current year. Minor is either 4 (January - June) or 10 (July - December). Patch is incremental by every build. If there is a breaking change, it should be noted in the readme. @@ -165,7 +165,7 @@ All my domains ([patrikx3.com](https://patrikx3.com) and [corifeus.com](https:// --- -[**P3X-GITLIST**](https://pages.corifeus.com/gitlist) Build v2019.10.107 +[**P3X-GITLIST**](https://pages.corifeus.com/gitlist) Build v2019.10.110 [![Donate for Corifeus / P3X](https://img.shields.io/badge/Donate-Corifeus-003087.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=QZVM4V6HVZJW6) [![Contact Corifeus / P3X](https://img.shields.io/badge/Contact-P3X-ff9900.svg)](https://www.patrikx3.com/en/front/contact) [![Like Corifeus @ Facebook](https://img.shields.io/badge/LIKE-Corifeus-3b5998.svg)](https://www.facebook.com/corifeus.software) diff --git a/artifacts/php-7.2-ubuntu.md b/artifacts/php-7.2-ubuntu.md index ce6619aa..c697ede7 100644 --- a/artifacts/php-7.2-ubuntu.md +++ b/artifacts/php-7.2-ubuntu.md @@ -28,7 +28,7 @@ All my domains ([patrikx3.com](https://patrikx3.com) and [corifeus.com](https:// --- -[**P3X-GITLIST**](https://pages.corifeus.com/gitlist) Build v2019.10.107 +[**P3X-GITLIST**](https://pages.corifeus.com/gitlist) Build v2019.10.110 [![Donate for Corifeus / P3X](https://img.shields.io/badge/Donate-Corifeus-003087.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=QZVM4V6HVZJW6) [![Contact Corifeus / P3X](https://img.shields.io/badge/Contact-P3X-ff9900.svg)](https://www.patrikx3.com/en/front/contact) [![Like Corifeus @ Facebook](https://img.shields.io/badge/LIKE-Corifeus-3b5998.svg)](https://www.facebook.com/corifeus.software) diff --git a/artifacts/screenshots.md b/artifacts/screenshots.md index e91aaf26..b4936222 100644 --- a/artifacts/screenshots.md +++ b/artifacts/screenshots.md @@ -33,7 +33,7 @@ All my domains ([patrikx3.com](https://patrikx3.com) and [corifeus.com](https:// --- -[**P3X-GITLIST**](https://pages.corifeus.com/gitlist) Build v2019.10.107 +[**P3X-GITLIST**](https://pages.corifeus.com/gitlist) Build v2019.10.110 [![Donate for Corifeus / P3X](https://img.shields.io/badge/Donate-Corifeus-003087.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=QZVM4V6HVZJW6) [![Contact Corifeus / P3X](https://img.shields.io/badge/Contact-P3X-ff9900.svg)](https://www.patrikx3.com/en/front/contact) [![Like Corifeus @ Facebook](https://img.shields.io/badge/LIKE-Corifeus-3b5998.svg)](https://www.facebook.com/corifeus.software) diff --git a/change-break.md b/change-break.md index 11d50478..f5c94a04 100644 --- a/change-break.md +++ b/change-break.md @@ -58,7 +58,7 @@ All my domains ([patrikx3.com](https://patrikx3.com) and [corifeus.com](https:// --- -[**P3X-GITLIST**](https://pages.corifeus.com/gitlist) Build v2019.10.107 +[**P3X-GITLIST**](https://pages.corifeus.com/gitlist) Build v2019.10.110 [![Donate for Corifeus / P3X](https://img.shields.io/badge/Donate-Corifeus-003087.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=QZVM4V6HVZJW6) [![Contact Corifeus / P3X](https://img.shields.io/badge/Contact-P3X-ff9900.svg)](https://www.patrikx3.com/en/front/contact) [![Like Corifeus @ Facebook](https://img.shields.io/badge/LIKE-Corifeus-3b5998.svg)](https://www.facebook.com/corifeus.software) diff --git a/changelog.md b/changelog.md index 4fef7c2c..51a72a62 100644 --- a/changelog.md +++ b/changelog.md @@ -5,6 +5,11 @@ [//]: #@corifeus-header:end +## v2019.100.111 +* FEATURE: Show last commited ago on the tree table by tag or branch with ellipsis +* FEATURE: Replaced mode column on the tree table with the last commit message with ellipsis + + ## v2019.4.128 * FEATURE: Added SASS/SCSS to CodeMirror @@ -303,7 +308,7 @@ All my domains ([patrikx3.com](https://patrikx3.com) and [corifeus.com](https:// --- -[**P3X-GITLIST**](https://pages.corifeus.com/gitlist) Build v2019.10.107 +[**P3X-GITLIST**](https://pages.corifeus.com/gitlist) Build v2019.10.110 [![Donate for Corifeus / P3X](https://img.shields.io/badge/Donate-Corifeus-003087.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=QZVM4V6HVZJW6) [![Contact Corifeus / P3X](https://img.shields.io/badge/Contact-P3X-ff9900.svg)](https://www.patrikx3.com/en/front/contact) [![Like Corifeus @ Facebook](https://img.shields.io/badge/LIKE-Corifeus-3b5998.svg)](https://www.facebook.com/corifeus.software) diff --git a/package.json b/package.json index cc5a6e94..99933923 100644 --- a/package.json +++ b/package.json @@ -1,9 +1,9 @@ { "name": "p3x-gitlist", - "version": "2019.10.108", + "version": "2019.10.111", "corifeus": { "prod-dir": "prod", - "css-postfix": "51277d6c756ab1e9f2f9a33fd14657d0267154f8afd49b53152c5f1ad9c66b77", + "css-postfix": "06a6aa56e6059d4a23001b44540767b6b87d4ad21af5bc9ba3885b5f309ceb28", "prefix": "p3x-", "publish": false, "type": "p3x", diff --git a/src/Gitter/Client.php b/src/Gitter/Client.php index ab20c4fe..9b5e06cf 100644 --- a/src/Gitter/Client.php +++ b/src/Gitter/Client.php @@ -82,7 +82,7 @@ public function run($repository, $command) $command = $this->getPath() . ' ' . $command; // echo $command; -// echo "
"; +// echo "\n"; // echo $repository->getPath(); // echo "
"; // echo "
"; diff --git a/src/Gitter/Model/File.php b/src/Gitter/Model/File.php index c22543d9..de3e9eba 100644 --- a/src/Gitter/Model/File.php +++ b/src/Gitter/Model/File.php @@ -11,6 +11,8 @@ class File extends AbstractModel protected $path; protected $size; protected $shortHash; + protected $lastModified; + public $message; public function getSize() { @@ -85,5 +87,12 @@ public function setShortHash($hash) return $this; } + public function getLastModified() { + return $this->lastModified; + } + + public function setLastModified($modified) { + $this->lastModified = $modified; + } } diff --git a/src/Gitter/Model/Tree.php b/src/Gitter/Model/Tree.php index 052015e5..87a153da 100644 --- a/src/Gitter/Model/Tree.php +++ b/src/Gitter/Model/Tree.php @@ -21,9 +21,16 @@ class Tree extends Item implements \RecursiveIterator protected $position = 0; private $submodules = null; + public $path = ''; + public function __construct($hash, Repository $repository) { $this->setHash($hash); + $pathArray = explode(":", $hash); + if (isset($pathArray[1])) { + $this->path = str_replace("\"", "" ,$pathArray[1]); + } + //exit; $this->setRepository($repository); } @@ -59,6 +66,20 @@ private function getSubmodules($files, $hash) return $this->submodules; } + public function decorateItem($filename, $item) { + $command = 'log -1 --pretty=tformat:"%ar%n%s" '. explode(':', $this->getHash())[0] . ' -- ' . $this->path . $filename; + // print_r($command); + $fileInfo = explode("\n", $this->getRepository()->getClient()->run($this->getRepository(), $command)); +// echo $filename; +// echo "\n"; +// print_r($fileInfo); +// echo "\n"; +// echo "\n"; + + $item->setLastModified($fileInfo[0]); + $item->message = $fileInfo[1]; + } + public function parse() { $data = $this->getRepository()->getClient()->run($this->getRepository(), 'ls-tree -lz ' . $this->getHash()); @@ -66,6 +87,8 @@ public function parse() $files = array(); $root = array(); + //print_r($data); + foreach ($lines as $key => $line) { if (empty($line)) { unset($lines[$key]); @@ -75,6 +98,7 @@ public function parse() } foreach ($files as $file) { + // submodule if ($file[0] == '160000') { $submodules = $this->getSubmodules($files, $this->getHash()); @@ -100,6 +124,7 @@ public function parse() } } $tree->setUrl($url); + $this->decorateItem( $file[4], $tree); $root[] = $tree; continue; } @@ -110,6 +135,7 @@ public function parse() $tree->setMode($file[0]); $tree->setName($file[4]); $tree->setPath($show); + $this->decorateItem( $file[4], $tree); $root[] = $tree; continue; } @@ -119,13 +145,19 @@ public function parse() $blob->setMode($file[0]); $blob->setName($file[4]); $blob->setSize($file[3]); + $this->decorateItem( $file[4], $blob); + + + $root[] = $blob; continue; } $tree = new Tree($file[2], $this->getRepository()); + $tree->setMode($file[0]); $tree->setName($file[4]); + $this->decorateItem($file[4], $tree); $root[] = $tree; } @@ -143,6 +175,8 @@ public function output() $file['size'] = $node->getSize(); $file['mode'] = $node->getMode(); $file['hash'] = $node->getHash(); + $file['lastModified'] = $node->getLastModified(); + $file['message'] = $node->message; $files[] = $file; continue; } @@ -153,6 +187,8 @@ public function output() $folder['size'] = ''; $folder['mode'] = $node->getMode(); $folder['hash'] = $node->getHash(); + $folder['lastModified'] = $node->getLastModified(); + $folder['message'] = $node->message; $folders[] = $folder; continue; } @@ -167,6 +203,8 @@ public function output() $folder['shortHash'] = $node->getShortHash(); $folder['url'] = $node->getUrl(); $folders[] = $folder; + $folder['lastModified'] = $node->getLastModified(); + $folder['message'] = $node->message; continue; } @@ -177,6 +215,8 @@ public function output() $folder['mode'] = $node->getMode(); $folder['hash'] = ''; $folder['path'] = $node->getPath(); + $folder['lastModified'] = $node->getLastModified(); + $folder['message'] = $node->message; $folders[] = $folder; } } diff --git a/src/browser/js/themes.js b/src/browser/js/themes.js index 0857957b..4b48c349 100644 --- a/src/browser/js/themes.js +++ b/src/browser/js/themes.js @@ -1,22 +1,22 @@ const themes = { - "bootstrap-default": "prod/css/bootstrap-default.51277d6c756ab1e9f2f9a33fd14657d0267154f8afd49b53152c5f1ad9c66b77.css", - "bootstrap-solar": "prod/css/bootstrap-solar.51277d6c756ab1e9f2f9a33fd14657d0267154f8afd49b53152c5f1ad9c66b77.css", - "bootstrap-cerulean": "prod/css/bootstrap-cerulean.51277d6c756ab1e9f2f9a33fd14657d0267154f8afd49b53152c5f1ad9c66b77.css", - "bootstrap-cosmo": "prod/css/bootstrap-cosmo.51277d6c756ab1e9f2f9a33fd14657d0267154f8afd49b53152c5f1ad9c66b77.css", - "bootstrap-cyborg": "prod/css/bootstrap-cyborg.51277d6c756ab1e9f2f9a33fd14657d0267154f8afd49b53152c5f1ad9c66b77.css", - "bootstrap-darkly": "prod/css/bootstrap-darkly.51277d6c756ab1e9f2f9a33fd14657d0267154f8afd49b53152c5f1ad9c66b77.css", - "bootstrap-flatly": "prod/css/bootstrap-flatly.51277d6c756ab1e9f2f9a33fd14657d0267154f8afd49b53152c5f1ad9c66b77.css", - "bootstrap-journal": "prod/css/bootstrap-journal.51277d6c756ab1e9f2f9a33fd14657d0267154f8afd49b53152c5f1ad9c66b77.css", - "bootstrap-lumen": "prod/css/bootstrap-lumen.51277d6c756ab1e9f2f9a33fd14657d0267154f8afd49b53152c5f1ad9c66b77.css", - "bootstrap-paper": "prod/css/bootstrap-paper.51277d6c756ab1e9f2f9a33fd14657d0267154f8afd49b53152c5f1ad9c66b77.css", - "bootstrap-readable": "prod/css/bootstrap-readable.51277d6c756ab1e9f2f9a33fd14657d0267154f8afd49b53152c5f1ad9c66b77.css", - "bootstrap-sandstone": "prod/css/bootstrap-sandstone.51277d6c756ab1e9f2f9a33fd14657d0267154f8afd49b53152c5f1ad9c66b77.css", - "bootstrap-simplex": "prod/css/bootstrap-simplex.51277d6c756ab1e9f2f9a33fd14657d0267154f8afd49b53152c5f1ad9c66b77.css", - "bootstrap-slate": "prod/css/bootstrap-slate.51277d6c756ab1e9f2f9a33fd14657d0267154f8afd49b53152c5f1ad9c66b77.css", - "bootstrap-spacelab": "prod/css/bootstrap-spacelab.51277d6c756ab1e9f2f9a33fd14657d0267154f8afd49b53152c5f1ad9c66b77.css", - "bootstrap-superhero": "prod/css/bootstrap-superhero.51277d6c756ab1e9f2f9a33fd14657d0267154f8afd49b53152c5f1ad9c66b77.css", - "bootstrap-united": "prod/css/bootstrap-united.51277d6c756ab1e9f2f9a33fd14657d0267154f8afd49b53152c5f1ad9c66b77.css", - "bootstrap-yeti": "prod/css/bootstrap-yeti.51277d6c756ab1e9f2f9a33fd14657d0267154f8afd49b53152c5f1ad9c66b77.css" + "bootstrap-default": "prod/css/bootstrap-default.06a6aa56e6059d4a23001b44540767b6b87d4ad21af5bc9ba3885b5f309ceb28.css", + "bootstrap-solar": "prod/css/bootstrap-solar.06a6aa56e6059d4a23001b44540767b6b87d4ad21af5bc9ba3885b5f309ceb28.css", + "bootstrap-cerulean": "prod/css/bootstrap-cerulean.06a6aa56e6059d4a23001b44540767b6b87d4ad21af5bc9ba3885b5f309ceb28.css", + "bootstrap-cosmo": "prod/css/bootstrap-cosmo.06a6aa56e6059d4a23001b44540767b6b87d4ad21af5bc9ba3885b5f309ceb28.css", + "bootstrap-cyborg": "prod/css/bootstrap-cyborg.06a6aa56e6059d4a23001b44540767b6b87d4ad21af5bc9ba3885b5f309ceb28.css", + "bootstrap-darkly": "prod/css/bootstrap-darkly.06a6aa56e6059d4a23001b44540767b6b87d4ad21af5bc9ba3885b5f309ceb28.css", + "bootstrap-flatly": "prod/css/bootstrap-flatly.06a6aa56e6059d4a23001b44540767b6b87d4ad21af5bc9ba3885b5f309ceb28.css", + "bootstrap-journal": "prod/css/bootstrap-journal.06a6aa56e6059d4a23001b44540767b6b87d4ad21af5bc9ba3885b5f309ceb28.css", + "bootstrap-lumen": "prod/css/bootstrap-lumen.06a6aa56e6059d4a23001b44540767b6b87d4ad21af5bc9ba3885b5f309ceb28.css", + "bootstrap-paper": "prod/css/bootstrap-paper.06a6aa56e6059d4a23001b44540767b6b87d4ad21af5bc9ba3885b5f309ceb28.css", + "bootstrap-readable": "prod/css/bootstrap-readable.06a6aa56e6059d4a23001b44540767b6b87d4ad21af5bc9ba3885b5f309ceb28.css", + "bootstrap-sandstone": "prod/css/bootstrap-sandstone.06a6aa56e6059d4a23001b44540767b6b87d4ad21af5bc9ba3885b5f309ceb28.css", + "bootstrap-simplex": "prod/css/bootstrap-simplex.06a6aa56e6059d4a23001b44540767b6b87d4ad21af5bc9ba3885b5f309ceb28.css", + "bootstrap-slate": "prod/css/bootstrap-slate.06a6aa56e6059d4a23001b44540767b6b87d4ad21af5bc9ba3885b5f309ceb28.css", + "bootstrap-spacelab": "prod/css/bootstrap-spacelab.06a6aa56e6059d4a23001b44540767b6b87d4ad21af5bc9ba3885b5f309ceb28.css", + "bootstrap-superhero": "prod/css/bootstrap-superhero.06a6aa56e6059d4a23001b44540767b6b87d4ad21af5bc9ba3885b5f309ceb28.css", + "bootstrap-united": "prod/css/bootstrap-united.06a6aa56e6059d4a23001b44540767b6b87d4ad21af5bc9ba3885b5f309ceb28.css", + "bootstrap-yeti": "prod/css/bootstrap-yeti.06a6aa56e6059d4a23001b44540767b6b87d4ad21af5bc9ba3885b5f309ceb28.css" }; module.exports = themes; diff --git a/src/browser/less/tree.less b/src/browser/less/tree.less index e5827cd3..69248c4c 100644 --- a/src/browser/less/tree.less +++ b/src/browser/less/tree.less @@ -2,4 +2,11 @@ a { text-decoration: none !important; } + .p3x-gitlist-tree-table-item { + opacity: 0.6; + max-width: 50px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + } } diff --git a/src/twig/tree.twig b/src/twig/tree.twig index 6b94e850..b086e242 100644 --- a/src/twig/tree.twig +++ b/src/twig/tree.twig @@ -88,13 +88,24 @@ {% endembed %} {% if files is not empty %} - +
+ + + + + + + + {% if parent is not null %} @@ -108,11 +119,12 @@ + {% endif %} {% for file in files %} - - - + + + {% endfor %} diff --git a/todo.md b/todo.md index d06b4619..c22de7cb 100644 --- a/todo.md +++ b/todo.md @@ -40,7 +40,7 @@ All my domains ([patrikx3.com](https://patrikx3.com) and [corifeus.com](https:// --- -[**P3X-GITLIST**](https://pages.corifeus.com/gitlist) Build v2019.10.107 +[**P3X-GITLIST**](https://pages.corifeus.com/gitlist) Build v2019.10.110 [![Donate for Corifeus / P3X](https://img.shields.io/badge/Donate-Corifeus-003087.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=QZVM4V6HVZJW6) [![Contact Corifeus / P3X](https://img.shields.io/badge/Contact-P3X-ff9900.svg)](https://www.patrikx3.com/en/front/contact) [![Like Corifeus @ Facebook](https://img.shields.io/badge/LIKE-Corifeus-3b5998.svg)](https://www.facebook.com/corifeus.software)
+ {%- if file.type == "folder" or file.type == "symlink" -%}   @@ -136,8 +148,15 @@ {{ file.mode }}{% if file.size %}{{ (file.size / 1024) | number_format }} kb{% endif %} + {% if file.size %}{{ (file.size / 1024) | number_format }} kb{% endif %} + + {{ file.message }} + + {{ file.lastModified }} +