Пример #1
0
    def register_post(self):
        if (c.userid != "false"):
            redirect(url('/users/register?m=3'))

        if request.method == 'POST':
            c.form = RegisterForm(request.POST)
            if c.form.is_valid():
                newuser = model.user()
                # check to see if email allready exists
                email_users = meta.Session.query(model.user)

                if (validate_email(c.form.cleaned_data['email'])):
                    c.email = "invalid"
                    print("invalid email")
                    return render("/users/register.mako")

                newuser.email = c.form.cleaned_data['email']

                newuser.organization = c.form.cleaned_data['organization']
                newuser.password = c.form.cleaned_data['password']
                print("c.form.cleaned_data['password']",
                      c.form.cleaned_data['password'])
                newuser.salt = "salt"
                meta.Session.add(newuser)
                meta.Session.commit()

                return render("/users/succ_register.mako")
            else:
                c.form = RegisterForm(request.POST)
        return render("/users/register.mako")
Пример #2
0
    def register_post(self):
        if (c.userid != "false"):
             redirect(url('/users/register?m=3'))
           
        if request.method == 'POST':
            c.form = RegisterForm(request.POST)
            if c.form.is_valid():
                newuser= model.user()
                # check to see if email allready exists
                email_users = meta.Session.query(model.user)

                if (validate_email(c.form.cleaned_data['email'])):
                    c.email = "invalid"
                    print "invalid email"
                    return render("/users/register.mako")


                newuser.email = c.form.cleaned_data['email']

                newuser.organization = c.form.cleaned_data['organization']
                newuser.password =      c.form.cleaned_data['password']
                print "c.form.cleaned_data['password']", c.form.cleaned_data['password']
                newuser.salt =  "salt"
                meta.Session.add(newuser)
                meta.Session.commit()

                return render("/users/succ_register.mako")
            else:
                c.form = RegisterForm(request.POST)
        return render("/users/register.mako")
Пример #3
0
    def login_validate(self):
        if (c.userid != "false"):
             redirect(url('/users/login?m=2'))
        session['logged_in'] = True
        session.save()    
            
        if request.method == 'POST':
            c.form = LoginForm(request.POST)
            if c.form.is_valid():

                userid = authenticate_user(c.form.cleaned_data['email'], \
                         c.form.cleaned_data['password'])
                print "hellooooo", c.form.cleaned_data['email'], c.form.cleaned_data['password']
                if (userid != "invalid" ):
                    session['userid'] = userid
                    session.save()
                    print session['userid']
                    redirect(url('/'))
                    c.login = "******"
                else:
                 c.login = "******"

            else:
                 c.form = LoginForm(request.POST)

        return render("/users/login.mako")
Пример #4
0
    def job_table_view(self):

        user_jobs = meta.Session.query(model.job).all()

        c.jobs = paginate.Page(user_jobs, items_per_page=10)
        total_pages = len(user_jobs)/10 + 1

        #jobs = meta.Session.query(model.job)
        #if (len(user_jobs)!=0):
         #   print "\njobs------\n",jobs.first().jobinfo[1].key, jobs.first().jobinfo[1].value

        # to check if user visiting this page for  the first time and
        #assign the latest jobs page,page_num tell which page to show


        page_num  =   total_pages
        if ('page' in request.params) and request.params['page']. isdigit() and (int(request.params['page']) <= total_pages):
                page_num =int(request.params['page'])

        if 'm' in request.params:
                c.display_message = "Job successfully submitted and your Job ID is " \
                + str(request.params['id'])

        c.jobs = paginate.Page(user_jobs, page=page_num, items_per_page=10)
        c.pagenums=c.jobs.pager()
        c.pagenumber = page_num
        return render("/job_table_view.mako")
Пример #5
0
    def job_insert(self):
        if (c.userid == "false"):
             redirect(url('/users/login?m=1'))

        #extra_questions = get_questions(request)
        #form = UserCreationForm(request.POST or None, extra=extra_questions)

        if request.method == 'POST':
            appname  = request.POST['appname']
            if (appname =='tophatfusion'):
               c.form = tophatfusionForm(request.POST,request.POST )
            elif (appname =='bfast') :
               c.form = bfastForm(request.POST,request.POST )
            elif (appname =='chipseq') :
               c.form = chipseqForm(request.POST,request.POST )

            if c.form.is_valid():
                #add using job queue
                jobid =add_job(c.userid)

                for key in c.form.cleaned_data:
                    print "key", key
                    print "value", c.form.cleaned_data[key]
                    newjobinfo = model.jobinfo()
                    newjobinfo.key = key
                    newjobinfo.value = c.form.cleaned_data[key]
                    newjobinfo.submitted_time = time.asctime()
                    newjobinfo.jobid = jobid
                    add_jobinfo(newjobinfo)

                update_job_status(jobid, str(JOBSTATES.NEW))
                redirect(url('/ngs/job_table_view?m=1&id=' + str(jobid) ))
            else:
                return render('/forms/chipseq_form.mako')
Пример #6
0
    def job_insert(self):
        if (c.userid == "false"):
             redirect(url('/users/login?m=1'))

        #extra_questions = get_questions(request)
        #form = UserCreationForm(request.POST or None, extra=extra_questions)

        if request.method == 'POST':
            appname  = request.POST['appname']
            if (appname =='tophatfusion'):
               c.form = tophatfusionForm(request.POST,request.POST )
            elif (appname =='bfast') :
               c.form = bfastForm(request.POST,request.POST )
            elif (appname =='chipseq') :
               c.form = chipseqForm(request.POST,request.POST )

            if c.form.is_valid():
                #add using job queue
                jobid =add_job(c.userid)

                for key in c.form.cleaned_data:
                    print("key", key)
                    print("value", c.form.cleaned_data[key])
                    newjobinfo = model.jobinfo()
                    newjobinfo.key = key
                    newjobinfo.value = c.form.cleaned_data[key]
                    newjobinfo.submitted_time = time.asctime()
                    newjobinfo.jobid = jobid
                    add_jobinfo(newjobinfo)

                update_job_status(jobid, str(JOBSTATES.NEW))
                redirect(url('/ngs/job_table_view?m=1&id=' + str(jobid) ))
            else:
                return render('/forms/chipseq_form.mako')
Пример #7
0
    def job_table_view(self):

        user_jobs = meta.Session.query(model.job).all()

        c.jobs = paginate.Page(user_jobs, items_per_page=10)
        total_pages = len(user_jobs)/10 + 1

        #jobs = meta.Session.query(model.job)
        #if (len(user_jobs)!=0):
         #   print "\njobs------\n",jobs.first().jobinfo[1].key, jobs.first().jobinfo[1].value

        # to check if user visiting this page for  the first time and
        #assign the latest jobs page,page_num tell which page to show


        page_num  =   total_pages
        if ('page' in request.params) and request.params['page']. isdigit() and (int(request.params['page']) <= total_pages):
                page_num =int(request.params['page'])

        if 'm' in request.params:
                c.display_message = "Job successfully submitted and your Job ID is " \
                + str(request.params['id'])

        c.jobs = paginate.Page(user_jobs, page=page_num, items_per_page=10)
        c.pagenums=c.jobs.pager()
        c.pagenumber = page_num
        return render("/job_table_view.mako")
Пример #8
0
    def login_validate(self):
        if (c.userid != "false"):
            redirect(url('/users/login?m=2'))
        session['logged_in'] = True
        session.save()

        if request.method == 'POST':
            c.form = LoginForm(request.POST)
            if c.form.is_valid():

                userid = authenticate_user(c.form.cleaned_data['email'], \
                         c.form.cleaned_data['password'])
                print("hellooooo", c.form.cleaned_data['email'],
                      c.form.cleaned_data['password'])
                if (userid != "invalid"):
                    session['userid'] = userid
                    session.save()
                    print(session['userid'])
                    redirect(url('/'))
                    c.login = "******"
                else:
                    c.login = "******"

            else:
                c.form = LoginForm(request.POST)

        return render("/users/login.mako")
Пример #9
0
    def register(self):
        if 'm' in request.params:
            m = request.params['m']

            if (int(m) ==3):
                c.display_message = "Please log out before you register "    
        elif (c.userid != "false"):
             redirect(url('/users/regitser?m=3'))
        
        c.form = RegisterForm()
        return render('/users/register.mako')
Пример #10
0
    def register(self):
        if 'm' in request.params:
            m = request.params['m']

            if (int(m) == 3):
                c.display_message = "Please log out before you register "
        elif (c.userid != "false"):
            redirect(url('/users/regitser?m=3'))

        c.form = RegisterForm()
        return render('/users/register.mako')
Пример #11
0
    def login(self):
        #h.flash('Please login')

        if 'm' in request.params:
           m = request.params['m']
           if (int(m) ==1):
               c.display_message = "Please log in before you submit a job "
           if (int(m) ==2):
               c.display_message = "Please log out before you login "
           if (int(m) ==4):
               c.display_message = "Please log in before you delete a job "
                
        elif (c.userid != "false"):
             redirect(url('/users/login?m=2'))
             
        c.form = LoginForm()
        return render('/users/login.mako')
Пример #12
0
    def login(self):
        #h.flash('Please login')

        if 'm' in request.params:
            m = request.params['m']
            if (int(m) == 1):
                c.display_message = "Please log in before you submit a job "
            if (int(m) == 2):
                c.display_message = "Please log out before you login "
            if (int(m) == 4):
                c.display_message = "Please log in before you delete a job "

        elif (c.userid != "false"):
            redirect(url('/users/login?m=2'))

        c.form = LoginForm()
        return render('/users/login.mako')
Пример #13
0
 def dalliance(self):
     """ dalliance visual"""
     return render('/dalliance.mako')
Пример #14
0
 def bfast_form(self):
     if (c.userid == "false"):
          redirect(url('/users/login?m=1'))
     c.form = bfastForm()
     return render('/forms/bfast_form.mako')
Пример #15
0
 def using_bfast(self):
     return render('/pages/using_bfast.mako')
Пример #16
0
 def resources(self):
     return render('/pages/resources.mako')
Пример #17
0
 def software(self):
     return render('/pages/software.mako')
Пример #18
0
 def about(self):
     return render('/pages/about.mako')
Пример #19
0
 def using_tophatfusion(self):
     return render('/pages/using_tophatfusion.mako')
Пример #20
0
 def tophatfusion_form(self):
     if (c.userid == "false"):
          redirect(url('/users/login?m=1'))
     c.form = tophatfusionForm()
     return render('/forms/tophatfusion_form.mako')
Пример #21
0
 def using_chipseq(self):
     return render('/pages/using_chipseq.mako')
Пример #22
0
 def contact(self):
     return render('/pages/contact.mako')
Пример #23
0
 def bfast_form(self):
     if (c.userid == "false"):
          redirect(url('/users/login?m=1'))
     c.form = bfastForm()
     return render('/forms/bfast_form.mako')
Пример #24
0
 def software(self):
     return render('/pages/software.mako')
Пример #25
0
 def trac(self):
     return render('/pages/trac.mako')
Пример #26
0
 def resources(self):
     return render('/pages/resources.mako')
Пример #27
0
 def chipseq_form(self):
     if (c.userid == "false"):
          redirect(url('/users/login?m=1'))
     c.form = chipseqForm()
     return render('/forms/chipseq_form.mako')
Пример #28
0
 def about(self):
     return render('/pages/about.mako')
Пример #29
0
    def index(self):

        return render('/pages/index.mako')
Пример #30
0
    def index(self):

        return render('/pages/index.mako')
Пример #31
0
 def using_chipseq(self):
     return render('/pages/using_chipseq.mako')
Пример #32
0
 def tophatfusion_view(self):
     """ dalliance visual"""
     jobid= request.params['id']
     if jobid is None:
        redirect(url('/ngs/job_table_view'))
     return render('/results/result_'+ jobid+'.mako')
Пример #33
0
 def using_bfast(self):
     return render('/pages/using_bfast.mako')
Пример #34
0
 def chipseq_form(self):
     if (c.userid == "false"):
          redirect(url('/users/login?m=1'))
     c.form = chipseqForm()
     return render('/forms/chipseq_form.mako')
Пример #35
0
 def trac(self):
     return render('/pages/trac.mako')
Пример #36
0
 def dalliance(self):
     """ dalliance visual"""
     return render('/dalliance.mako')
Пример #37
0
 def contact(self):
     return render('/pages/contact.mako')
Пример #38
0
 def tophatfusion_view(self):
     """ dalliance visual"""
     jobid= request.params['id']
     if jobid is None:
        redirect(url('/ngs/job_table_view'))
     return render('/results/result_'+ jobid+'.mako')
Пример #39
0
 def tophatfusion_form(self):
     if (c.userid == "false"):
          redirect(url('/users/login?m=1'))
     c.form = tophatfusionForm()
     return render('/forms/tophatfusion_form.mako')
Пример #40
0
 def using_tophatfusion(self):
     return render('/pages/using_tophatfusion.mako')