Exemplo n.º 1
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())
Exemplo n.º 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())
Exemplo n.º 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())
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 6
0
 def get(self):
     self.write(self.macro('admin_widgets.html').classes_select(
         ctrl.get_all_classes(), ajax=True))
Exemplo n.º 7
0
 def get(self):
     self.render('admin_add_article.html', classes=ctrl.get_all_classes())
Exemplo n.º 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())
Exemplo n.º 9
0
 def get(self):
     self.write(
         self.macro('admin_widgets.html').classes_select(
             ctrl.get_all_classes(), ajax=True))
Exemplo n.º 10
0
 def get(self):
     self.render('admin_add_article.html', classes=ctrl.get_all_classes())