diff --git a/public/app.js b/public/app.js
index 8cdeeae..3096620 100644
--- a/public/app.js
+++ b/public/app.js
@@ -115,8 +115,21 @@ function factsHtml(p) {
}
function gitHtml(git, short = false) {
- const label = short ? t('git.' + git.level) : git.label
- return `${ic(GIT_ICON[git.level], 'sm')}${escapeHtml(label)}`
+ const label = short ? t('git.' + git.level) : gitLabel(git)
+ return `${ic(GIT_ICON[git.level], 'sm')}${escapeHtml(label)}`
+}
+// Git status line in the current language, built from the server's raw fields (lib/git.js)
+function gitLabel(g) {
+ if (!g) return ''
+ if (!g.isRepo) return t('gitl.noGit')
+ if (g.label === 'Git nicht installiert') return t('gitl.notInstalled')
+ const parts = []
+ if (g.dirty) parts.push(t('gitl.changed', { n: g.dirty }))
+ if (g.ahead) parts.push(t('gitl.unpushed', { n: g.ahead }))
+ if (g.behind) parts.push(t('gitl.behind', { n: g.behind }))
+ if (!g.remote) return [t('gitl.noRemote'), ...parts].join(' · ')
+ if (!g.upstream) return [t('gitl.noUpstream'), ...parts].join(' · ')
+ return parts.length ? parts.join(' · ') : t('gitl.saved')
}
// Backup state of one project (p.lastBackup from the server: own or full backup, newer one)
@@ -1473,7 +1486,7 @@ function rowHtml(p) {
${rootTag(p, true)}
${ic('folder', 'sm')}${p.storage?.sizeMB != null ? fmtMB(p.storage.sizeMB) : '–'}
${ic('file-pen', 'sm')}${fmtDate(lastActivity(p))}${fmtDate(lastActivity(p), false)}
- ${ic(GIT_ICON[p.git.level], 'sm')}
+ ${ic(GIT_ICON[p.git.level], 'sm')}
${ic('hard-drive', 'sm')}
${open ? `${ic('list-checks', 'sm')}${open}` : ''}
${p.published ? `${ic('rocket', 'sm')}` : ''}
@@ -1562,7 +1575,7 @@ function renderGallery() {
${statusHtml(p.status)}
${favBtn(p, 'onthumb')}
- ${pubBadge(p)}${cloudBadge(p)}${ic(GIT_ICON[p.git.level])}
+ ${pubBadge(p)}${cloudBadge(p)}${ic(GIT_ICON[p.git.level])}