1
0
mirror of https://github.com/S2-/gitlit synced 2025-08-02 12:20:05 +02:00

show splash screen on startup if passed path is not a git repo

This commit is contained in:
s2
2019-06-20 15:51:56 +02:00
parent 7cae3f33ec
commit 4178caa94a
2 changed files with 17 additions and 1 deletions

View File

@@ -4,8 +4,11 @@
const electronFind = require('electron-find');
let findInPage = new electronFind.FindInPage(remote.getCurrentWebContents());
let firstRun = true;
//events
ipcRenderer.on('fileList', (event, files) => {
firstRun = false;
if (files && files.length > 0) {
ejs.preloadTemplate('templates/files.ejs')
.then(t => {
@@ -28,7 +31,12 @@
});
ipcRenderer.on('isNoGitLfsRepo', (event, repoDir) => {
$('.js-container').html(ejs.rr('templates/isNoGitLfsRepo.ejs', {repoDir: repoDir}));
if (firstRun) {
firstRun = false;
$('.js-container').html(ejs.rr('templates/firstRun.ejs', {repoDir: repoDir}));
} else {
$('.js-container').html(ejs.rr('templates/isNoGitLfsRepo.ejs', {repoDir: repoDir}));
}
});
ipcRenderer.on('notification', (event, notification) => {

View File

@@ -0,0 +1,8 @@
<div class="jumbotron text-center">
<h1>gitlit</h1>
<p class="lead">Handle git lfs locks with ease</p>
<div class="text-center">
<a class="btn btn-primary btn-lg js-open-folder" href="javascript:///">Open git repository folder</a>
<input type="file" style="display: none" class="js-open-folder-input" webkitdirectory />
</div>
</div>