def GET(self): name = gc('name') if name: #return 'test' user = get_user(name) return st("admin/main.mako", **locals()) return st("admin/login.mako", **locals())
def GET(self, id): name = gc('name') article = Article.get(id) if article and name: user = get_user(name) return st("admin/edit.mako", **locals()) return st("404.mako", **locals())
def POST(self, name): authen = gc('name') if authen: article = Article.get(name) article.delete() return js(dict(r=True, id=name)) return js(dict(r=False))
def GET(self): name = gc('name') if name: #return 'test' user = get_user(name) articles = get_user_articles(user.name) return st("admin/manage.mako", **locals()) return st("admin/login.mako", **locals())
def POST(self): req = gd() name = gc('name') if name: user = get_user(name) ok = add(req.cate, req.title, req.url, req.content, user.name) return js(dict(r = True, ok = ok)) else: return js(dict(r = False))
def POST(self): req = gd() name = gc("name") if name: user = get_user(name) ok = add(req.cate, req.title, req.url, req.content, user.name) return js(dict(r=True, ok=ok)) else: return js(dict(r=False))
def GET(self): name = gc('name') if name: user = get_user(name) return st("admin/add.mako", **locals()) return st("admin/login.mako", **locals())
def GET(self): name = gc("name") if name: user = get_user(name) return st("admin/add.mako", **locals()) return st("admin/login.mako", **locals())
def GET(self): name = gc('name') sc('name','',-2) return st("admin/login.mako", **locals())
def GET(self): name = gc('name') sc('name', '', -2) return st("admin/login.mako", **locals())