Example #1
0
 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())
Example #2
0
 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())
Example #3
0
 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))
Example #4
0
 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))
Example #5
0
 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())
Example #6
0
 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())
Example #7
0
 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())
Example #8
0
 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))
Example #9
0
 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))
Example #10
0
 def GET(self):
     name = gc('name')
     if name:
         user = get_user(name)
         return st("admin/add.mako", **locals())
     return st("admin/login.mako", **locals())
Example #11
0
 def GET(self):
     name = gc("name")
     if name:
         user = get_user(name)
         return st("admin/add.mako", **locals())
     return st("admin/login.mako", **locals())
Example #12
0
 def GET(self):
     name = gc('name')
     sc('name','',-2)
     return st("admin/login.mako", **locals())
Example #13
0
 def GET(self):
     name = gc('name')
     sc('name', '', -2)
     return st("admin/login.mako", **locals())