示例#1
0
文件: handlers.py 项目: jvfu/pabo
 def get(self):
     if self.request.path.endswith('.json'):
         self.write(
             self.macro('admin_widgets.html').classes_table(
                 ctrl.get_all_classes(), ajax=True))
     else:
         self.render('admin_classes.html', classes=ctrl.get_all_classes())
示例#2
0
 def get(self, aid):
     article = ctrl.get_article(aid, need_md=True)
     if article is None:
         self.redirect('/404')
     else:
         self.render('admin_editor.html', article=article,
                 classes=ctrl.get_all_classes())
示例#3
0
 def get(self, aid):
     article = ctrl.get_article(aid, need_md=True)
     if article is None:
         self.redirect('/404')
     else:
         self.render('admin_editor.html', article=article,
                 classes=ctrl.get_all_classes())
示例#4
0
 def get(self, cid=None, page_num=None):
     if cid is None:
         # 归档首页
         self.render('archives.html', classes=ctrl.get_all_classes())
     else:
         app = g.kv.get(settings.K_SITE_INFO)['app']
         if page_num is None:
             page_num = 1
         page_num = int(page_num)
         offset = (page_num - 1) * app
         self.render('archives.html',
                 articles=ctrl.get_all_articles(
                     offset=offset, limit=app, need_abs=True, cid=cid),
                 page_num=page_num, app=app, cid=cid)
示例#5
0
 def get(self, cid=None, page_num=None):
     if cid is None:
         # 归档首页
         self.render('archives.html', classes=ctrl.get_all_classes())
     else:
         app = g.kv.get(settings.K_SITE_INFO)['app']
         if page_num is None:
             page_num = 1
         page_num = int(page_num)
         offset = (page_num - 1) * app
         self.render('archives.html',
                 articles=ctrl.get_all_articles(
                     offset=offset, limit=app, need_abs=True, cid=cid),
                 page_num=page_num, app=app, cid=cid)
示例#6
0
 def get(self):
     self.write(self.macro('admin_widgets.html').classes_select(
         ctrl.get_all_classes(), ajax=True))
示例#7
0
 def get(self):
     self.render('admin_add_article.html', classes=ctrl.get_all_classes())
示例#8
0
 def get(self):
     if self.request.path.endswith('.json'):
         self.write(self.macro('admin_widgets.html').classes_table(
             ctrl.get_all_classes(), ajax=True))
     else:
         self.render('admin_classes.html', classes=ctrl.get_all_classes())
示例#9
0
文件: handlers.py 项目: jvfu/pabo
 def get(self):
     self.write(
         self.macro('admin_widgets.html').classes_select(
             ctrl.get_all_classes(), ajax=True))
示例#10
0
文件: handlers.py 项目: jvfu/pabo
 def get(self):
     self.render('admin_add_article.html', classes=ctrl.get_all_classes())