コード例 #1
0
ファイル: main.py プロジェクト: Ms2ger/mozilla-weekly-updates
    def userteamposts(self, userid):
        teamposts = model.get_teamposts(userid)
        team = model.get_userteam(userid)
        projects = model.get_projects()

        return render('teamposts.xhtml', userid=userid, team=team,
                      teamposts=teamposts, projects=projects)
コード例 #2
0
 def GET(self):
     uid = 3
     if uid:
         projects = model.get_projects(uid)
         return render.index_project(projects)
     else:
         return render.error('登录超时,请重新登录!')
コード例 #3
0
    def index(self):
        loginid = cherrypy.request.loginid

        projects = model.get_projects()
        iteration, daysleft = model.get_current_iteration()

        if loginid is None:
            team = ()
            teamposts = None
            userposts = None
            todaypost = None
            bugs = None
            recent = model.get_recentposts()
        else:
            team = model.get_user_projects(loginid)
            teamposts = model.get_teamposts(loginid)
            userposts, todaypost = model.get_user_posts(loginid)
            bugs = model.get_currentbugs(loginid, iteration)
            recent = None

        return render('index.xhtml',
                      projects=projects,
                      recent=recent,
                      team=team,
                      bugs=bugs,
                      iteration=iteration,
                      daysleft=daysleft,
                      teamposts=teamposts,
                      userposts=userposts,
                      todaypost=todaypost)
コード例 #4
0
 def GET(self):
     if session.privilege == 2:
         wh = ''
     elif session.privilege == 3:
         wh = ' and uid=' + str(session.uid)
     projects = model.get_projects(wh)
     render = create_render(session.privilege)
     return render.index_project(projects)
コード例 #5
0
 def GET(self):
     uid = 3
     render = create_render(session.privilege)
     if uid:
         projects = model.get_projects(uid)
         return render.index_project(projects)
     else:
         return render.error('登录超时,请重新登录!')
コード例 #6
0
    def userteamposts(self, userid):
        teamposts = model.get_teamposts(userid)
        team = model.get_userteam(userid)
        projects = model.get_projects()

        return render('teamposts.xhtml',
                      userid=userid,
                      team=team,
                      teamposts=teamposts,
                      projects=projects)
コード例 #7
0
 def GET(self):
     if logged():
         web.header('content-type', 'text/json')
         if session.privilege == 2:
             wh = ''
         elif session.privilege == 3:
             wh = ' and uid=' + str(session.uid)
         projectslist = list(model.get_projects(wh))
         return json.dumps(projectslist)
     else:
         return []
コード例 #8
0
 def GET(self):
     if logged():
         if session.privilege == 2:
             wh = ''
         elif session.privilege == 3:
             wh = ' and uid=' + str(session.uid)
         projects = model.get_projects(wh)
         render = create_render(session.privilege)
         return render.index_project(projects)
     else:
         raise web.seeother('/')
コード例 #9
0
ファイル: main.py プロジェクト: Ms2ger/mozilla-weekly-updates
    def project(self, projectname):
        cur = model.get_cursor()
        cur.execute('''SELECT projectname FROM projects WHERE projectname = ?''',
                    (projectname,))
        if cur.fetchone() is None:
            raise cherrypy.HTTPError(404, "Project not found")

        users = model.get_project_users(projectname)
        posts = model.get_project_posts(projectname)
        late = model.get_project_late(projectname)
        iteration, daysleft = model.get_current_iteration()
        projects = model.get_projects()

        return render('project.xhtml', projectname=projectname, users=users,
                      posts=posts, late=late, team=[projectname], iteration=iteration,
                      daysleft=daysleft, projects=projects)
コード例 #10
0
ファイル: main.py プロジェクト: clopez/mozilla-weekly-updates
    def index(self):
        loginid = cherrypy.request.loginid

        projects = model.get_projects()

        if loginid is None:
            teamposts = None
            userposts = None
            todaypost = None
            recent = model.get_recentposts()
        else:
            teamposts = model.get_teamposts(loginid)
            userposts, todaypost = model.get_user_posts(loginid)
            recent = None

        return render('index.xhtml', projects=projects, recent=recent,
                      teamposts=teamposts, userposts=userposts, todaypost=todaypost)
コード例 #11
0
    def project(self, projectname):
        cur = model.get_cursor()
        cur.execute(
            '''SELECT projectname FROM projects WHERE projectname = ?''',
            (projectname, ))
        if cur.fetchone() is None:
            raise cherrypy.HTTPError(404, "Project not found")

        users = model.get_project_users(projectname)
        posts = model.get_project_posts(projectname)
        late = model.get_project_late(projectname)
        iteration, daysleft = model.get_current_iteration()
        projects = model.get_projects()

        return render('project.xhtml',
                      projectname=projectname,
                      users=users,
                      posts=posts,
                      late=late,
                      team=[projectname],
                      iteration=iteration,
                      daysleft=daysleft,
                      projects=projects)
コード例 #12
0
ファイル: main.py プロジェクト: Ms2ger/mozilla-weekly-updates
    def index(self):
        loginid = cherrypy.request.loginid

        projects = model.get_projects()
        iteration, daysleft = model.get_current_iteration()

        if loginid is None:
            team = ()
            teamposts = None
            userposts = None
            todaypost = None
            bugs = None
            recent = model.get_recentposts()
        else:
            team = model.get_user_projects(loginid)
            teamposts = model.get_teamposts(loginid)
            userposts, todaypost = model.get_user_posts(loginid)
            bugs = model.get_currentbugs(loginid, iteration)
            recent = None

        return render('index.xhtml', projects=projects, recent=recent, team=team, bugs=bugs,
                      iteration=iteration, daysleft=daysleft, teamposts=teamposts, userposts=userposts,
                      todaypost=todaypost)
コード例 #13
0
ファイル: item.py プロジェクト: wenfengst/Management-System
 def GET(self):
     table=alltable['project']
     items = model.get_projects()
     return render.index_project(table,items)
コード例 #14
0
 def posts(self):
     recent = model.get_recentposts()
     projects = model.get_projects()
     return render('posts.xhtml', recent=recent, team=[], projects=projects)
コード例 #15
0
 def GET(self):
     projects = model.get_projects()
     return render.index_project(projects)
コード例 #16
0
ファイル: main.py プロジェクト: Ms2ger/mozilla-weekly-updates
 def posts(self):
     recent = model.get_recentposts()
     projects = model.get_projects()
     return render('posts.xhtml', recent=recent, team=[], projects=projects)