Пример #1
0
def homeAdminTitleView(email, title):
    loggedEmail = request.cookies.get("loggedEmail")
    thesis = fetchThesisWithEmail(email)
    stepTitle = fetchStepByEmailStep(email, STEP_TITLE)
    stepFirst = fetchStepByEmailStep(email, STEP_FIRST)
    stepSecond = fetchStepByEmailStep(email, STEP_SECOND)
    stepThird = fetchStepByEmailStep(email, STEP_THIRD)
    stepClose = fetchStepByEmailStep(email, STEP_CLOSE)
    return render_template('homeAdmin.html', **request.args, thesis=thesis, stepTitle=stepTitle, stepFirst=stepFirst, stepSecond=stepSecond, stepThird=stepThird, stepClose=stepClose)
Пример #2
0
def userThird() :
    loggedEmail = request.cookies.get("loggedEmail")
    notiList, newNotiNo = notiMiddleware(loggedEmail)

    if request.method == 'GET':
        loggedEmail = request.cookies.get("loggedEmail")
        thesis = fetchThesisWithEmail(loggedEmail)
        step = fetchStepByEmailStep(loggedEmail, STEP_THIRD)
        stepNo = fetchStepNoByEmailStep(loggedEmail)

        prevStep = fetchStepByEmailStep(loggedEmail, STEP_SECOND)
        sdate = prevStep.deadline+datetime.timedelta(days=1) if prevStep else None
        
        return render_template('homeUser.html', **request.args, step=step, thesis=thesis, stepNo=stepNo, sdate=sdate, newNotiNo=newNotiNo)
    else :
        deadline = request.form["deadline"]
        taskRaw = request.form.getlist("task")

        if len(taskRaw)>0 :
            tasks = commaSeparatedListString(taskRaw)
            saveStep(loggedEmail, STEP_THIRD, deadline, tasks, "")
            return redirect("/userThird")
Пример #3
0
def homeUser() :
    loggedEmail = request.cookies.get("loggedEmail")
    notiList, newNotiNo = notiMiddleware(loggedEmail)

    if request.method == 'GET':
        thesis = fetchThesisWithEmail(loggedEmail)
        step = fetchStepByEmailStep(loggedEmail, STEP_TITLE)
        stepNo = fetchStepNoByEmailStep(loggedEmail)
        # print("sdddate::", request.args )
        sdate = datetime.date.today()+datetime.timedelta(days=1)
        return render_template('homeUser.html', **request.args, thesis=thesis, step=step, stepNo=stepNo, newNotiNo=newNotiNo, sdate=sdate)
    else :
        selectedTitle = request.form["title"]
        userRaw = fetchUserWithEmail(loggedEmail)
        email = userRaw[0]
        name = userRaw[1]
        rollNo = userRaw[2]
        saveThesis(selectedTitle, email, name, rollNo, "2018-2019", 0)
        thesis = fetchThesisWithEmail(loggedEmail)
        return render_template('homeUser.html', **request.args, thesis = thesis, newNotiNo=newNotiNo, )