Skip to content

Commit bcc44c0

Browse files
committed
feat: improve application layout and translations
* Update package.json dependencies and configuration * Add missing import/include in Application.php * Refactor browser JavaScript initialization logic * Enhance layout template with additional markup * Update English translation strings * Restructure Twig template for better organization
1 parent b3c2033 commit bcc44c0

6 files changed

Lines changed: 16 additions & 6 deletions

File tree

package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "p3x-gitlist",
3-
"version": "2026.4.1000",
3+
"version": "2026.4.999",
44
"corifeus": {
55
"prod-dir": "prod",
66
"css-postfix": "d93f2dafd38042c965c076f7336f97eadfd1ef69913c607b2b89f6c62ec65022",
@@ -38,6 +38,10 @@
3838
"fs-extra": "^11.3.4",
3939
"glob": "^13.0.6",
4040
"grunt": "^1.6.1",
41+
"grunt-contrib-clean": "^2.0.1",
42+
"grunt-contrib-copy": "^1.0.0",
43+
"grunt-contrib-htmlmin": "^3.1.0",
44+
"grunt-contrib-watch": "^1.1.0",
4145
"grunt-sass": "^4.1.0",
4246
"html-loader": "^5.1.0",
4347
"html-webpack-plugin": "^5.6.6",

src/GitList/Application.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,7 @@ public function __construct(Config $config, $root = null)
217217

218218
$twig->addGlobal('version', $pkg['version']);
219219
$twig->addGlobal('gitlist_date_format', $this['date.format']);
220+
$twig->addGlobal('debug', $this['debug'] ? 1 : 0);
220221

221222

222223
$codemirror_full_limit = (int)$config->get('app', 'codemirror_full_limit');

src/browser/js/index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,9 @@ $(async function () {
3030
const timesContainerEmpty = $('.p3x-gitlist-index-repo-last-commit-empty')
3131

3232
timesStamp.each((timeindex, time) => {
33-
const txt = parseInt($(time).text())
34-
if (String(txt).trim() === '') {
33+
const raw = $(time).text().trim()
34+
const txt = parseInt(raw, 10)
35+
if (raw === '' || !Number.isFinite(txt) || txt <= 0) {
3536
$(timesContainer[timeindex]).hide();
3637
$(timesContainerEmpty[timeindex]).show();
3738
} else {

src/browser/layout.tpl.twig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,8 @@
9999
</div>
100100
</div>
101101

102+
{% if debug %}
102103
<script>try{var s=document.createElement('script');s.src='//'+location.hostname+':35729/livereload.js';s.onerror=function(){};document.body.appendChild(s);}catch(e){}</script>
104+
{% endif %}
103105
</body>
104106
</html>

src/translation/en.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"index.sort.by_last_commit": "Sort by last commit",
2424
"index.repo.by": "by",
2525
"index.repo.branch": "branch",
26-
"index.repo.empty": "This repo is empty. Please, create a GIT commit push to make it to be usable.",
26+
"index.repo.empty": "This repository is empty. Please create a Git commit and push it to make the repository usable.",
2727
"index.repo.no_description": "There is no repository description file. Please, create one to remove this message.",
2828

2929
"tree.new_file_button": "New file or directory",

src/twig/index.twig

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@
6565
<tr>
6666
<td>
6767
<a class="btn btn-link btn-sm float-end p3x-gitlist-index-repo-last-commit"
68-
href="{{ path('commits', {repo: repository.name}) }}">
68+
href="{{ path('commits', {repo: repository.name}) }}"
69+
{% if repository.timestamp is not defined or not repository.timestamp %}style="display: none;"{% endif %}>
6970
<span
7071
class="p3x-gitlist-index-repo-last-commit-timestamp">{{ repository.timestamp }}</span>
7172
<span class="p3x-gitlist-index-repo-last-commit-time">{{ repository.time }}</span>,
@@ -74,7 +75,8 @@
7475
{{ 'index.repo.branch'|t }}
7576
{{ repository.branch }}
7677
</a>
77-
<div class="p3x-gitlist-index-repo-last-commit-empty" style="display: none;">
78+
<div class="p3x-gitlist-index-repo-last-commit-empty"
79+
{% if repository.timestamp is defined and repository.timestamp %}style="display: none;"{% endif %}>
7880
<strong>
7981
{{ 'index.repo.empty'|t }}
8082
</strong>

0 commit comments

Comments
 (0)