Beispiel #1
0
    def GET(self, result=''):
        per = users.get_permission_by_douid(user.douban_id)
        rights = per[0].rights
        if rights > 1:
            results_per_page = 10
            default_order = 'id'

            i = web.input(start=0, order=default_order, desc='desc', query='')
            start = int(i.start)

            results, num_results = help.query(query=i.query, 
                offset=start, limit=results_per_page, order=i.order + ' ' + i.desc)

            pager = web.storage(paging.get_paging(start, num_results, 
                results_per_page=results_per_page, window_size=1))

            results = list(results)
            user_list = []
            for i in xrange(len(results)):
                if users.get_douban_users_by_doubanid(results[i].douban_id):
                    user_list += users.get_douban_users_by_doubanid(results[i].douban_id)
                else:
                    user_list += []

            return view.template_admin(view.admin_feedback(results, user_list, pager))
Beispiel #2
0
    def GET(self, c=''):
        per = users.get_permission_by_douid(user.douban_id)
        rights = per[0].rights
        if rights > 2:
            results_per_page = 10
            default_order = 'id'

            i = web.input(start=0, order=default_order, desc='desc', query='', c ='')
            start = int(i.start)
            c = i.c

            results, num_results = admin.confirm_log_query(query=i.query, 
                offset=start, limit=results_per_page, order=i.order + ' ' + i.desc, c=c)

            pager = web.storage(paging.get_paging(start, num_results, 
                results_per_page=results_per_page, window_size=1))

            results = list(results)

            if c == '1' or c == '':
                user_list = []
                for i in xrange(len(results)):
                    user_list += users.get_douban_users_by_doubanid(results[i].douban_id)
            elif c == '0':
                user_list = []

            return view.template_admin(view.admin_confirm(results, user_list, pager, c))
Beispiel #3
0
    def GET(self, result=''):
        per = users.get_permission_by_douid(user.douban_id)
        rights = per[0].rights

        if rights > 1:
            results_per_page = 8 #每页显示8条记录
            default_order = 'id'

            i = web.input(start=0, order=default_order, desc='desc', query='', result='')
            start = int(i.start)
            result = i.result

            results, num_results = users.get_applys(query=i.query, 
                offset=start, limit=results_per_page, order=i.order + ' ' + i.desc, user_id=None, result=result)

            pager = web.storage(paging.get_paging(start, num_results, 
                results_per_page=results_per_page, window_size=1))

            apply_list = list(results)

            admin_list = []
            for i in xrange(len(apply_list)):
                admin_list += users.get_users_by_id(apply_list[i].operator)

            user_list = []
            for i in xrange(len(apply_list)):
                user_list += users.get_douban_users_by_doubanid(apply_list[i].douban_id)

            return view.template_admin(view.admin_apply_for_permission(apply_list, pager, admin_list, user_list, result))
        else:
            raise web.notfound