def profile(): if not user.isUserLogined(sql): return redirect(url_for('login')) if request.method == 'GET': username = user.getLoginedUserName(sql) userInfo = user.getUserInfo(sql) return render_template('profile.html', username = username, userInfo = userInfo, flag = (username != "NULL")) else: pass
def file_manager(): if not user.isUserLogined(sql): return redirect(url_for('login')) filelist = sql.getUserFileNameList() shared=sharedFiles(sql) sharedFileList=shared.getSharedFileList() yoursharedfiles=shared.getUserSharedFileList(user.getLoginedUserName(sql)) for file in filelist: for shareF in yoursharedfiles: if file['fileType']==shareF['fileType'] and file['fileName']==shareF['fileName'] and shareF['name']==user.getLoginedUserName(sql): file['shared']=True for file in filelist: if not 'shared' in file: file['shared']=False print sql.getUserPartByLoginuser() return render_template('file_manager.html', filelist = filelist,sharedFileList = sharedFileList,userpart=sql.getUserPartByLoginuser())
def goToProtocol(): if user.isUserLogined(sql): return render_template('protocol.html') else: return redirect(url_for('login'))
def goToPlasmid(): if user.isUserLogined(sql): return render_template('plasmid.html') else: return redirect(url_for('login'))
def goToGeneCircuit(): if user.isUserLogined(sql): return render_template('genecircuit.html') else: return redirect(url_for('login'))
def createnewpart(): if user.isUserLogined(sql): return render_template('createNewPart.html') else: return redirect(url_for('login'))
def index(): if user.isUserLogined(sql): return render_template('index.html') else: return redirect(url_for('login'))
def login2(): if user.isUserLogined(sql): user.userLogout(sql) return render_template('login.html')
def goToSimulation(): if user.isUserLogined(sql): return render_template('simulation.html') else: return redirect(url_for('login'))