Ejemplo n.º 1
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())
Ejemplo n.º 2
0
 def get(self, url):
     if url.startswith('admin/'):
         # 后台管理员管理文章页面的网址是直接用的aid
         aid = url.split('/')[1]
     else:
         import pabo.utils.tinyurl as tinyurl
         try:
             aid = tinyurl.decode_url(url)
         except ValueError:
             self.redirect('/404')
             return
     article = ctrl.get_article(aid, need_abs=False)
     if article is None:
         self.redirect('/404')
     else:
         self.render('article.html', article=article)
Ejemplo n.º 3
0
 def get(self, aid):
     self.write(
         self.macro('admin_widgets.html').box(ctrl.get_article(
             aid, need_abs=True),
                                              ajax=True))
Ejemplo n.º 4
0
 def get(self, aid=None):
     if aid is None:
         self.redirect('/404')
     else:
         article = ctrl.get_article(aid, need_abs=True)
         self.render('product.html', article=article)