Commit 1c61592a authored by Alain Takoudjou's avatar Alain Takoudjou Committed by Nicolas Wavrant

Fix empty repository status

parent 2976d8f7
...@@ -229,7 +229,7 @@ $(document).ready(function () { ...@@ -229,7 +229,7 @@ $(document).ready(function () {
node.setFocus(); node.setFocus();
node.setActive(); node.setActive();
if (srcElement.hasClass('fancytree-folder')){ if (srcElement.hasClass('fancytree-folder')){
menu.disableContextMenuItems("#edit,#editfull,#view,#md5sum"); menu.disableContextMenuItems("#edit,#editfull,#view,#md5sum,#favorite");
} }
else{ else{
menu.disableContextMenuItems("#nfile,#nfolder,#refresh,#paste"); menu.disableContextMenuItems("#nfile,#nfolder,#refresh,#paste");
...@@ -550,6 +550,9 @@ $(document).ready(function () { ...@@ -550,6 +550,9 @@ $(document).ready(function () {
} }
function addToFavourite(filepath){ function addToFavourite(filepath){
if (! filepath ) {
return;
}
var i = favourite_list.length, var i = favourite_list.length,
filename = filepath.replace(/^.*(\\|\/|\:)/, ''); filename = filepath.replace(/^.*(\\|\/|\:)/, '');
if (i === 0){ if (i === 0){
......
...@@ -304,11 +304,13 @@ def getProjectStatus(): ...@@ -304,11 +304,13 @@ def getProjectStatus():
#view for current software release files #view for current software release files
def editCurrentProject(): def editCurrentProject():
project = os.path.join(app.config['etc_dir'], ".project") project = os.path.join(app.config['etc_dir'], ".project")
if os.path.exists(project): projectList = listFolder(app.config, 'workspace')
if os.path.exists(project) and projectList:
return render_template('softwareFolder.html', workDir='workspace', return render_template('softwareFolder.html', workDir='workspace',
project=open(project).read(), project=open(project).read(),
projectList=listFolder(app.config, 'workspace')) projectList=projectList)
return redirect(url_for('configRepo')) flash('Please clone slapos repository and then, <br/>open or create a software to start with your project!!')
return redirect(url_for('manageRepository'))
#create file or directory #create file or directory
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment