Пример #1
0
 def GET(self):
     iflogin()
     data = web.input()
     column = data.get('column', '') 
     if column == 'all':
         column = ''
     articles = get_articles(column)
     cs = get_columns()
     content = {'columns':cs,'articles':articles}
     return template_render('admin_article.html', PATH, content)
Пример #2
0
 def GET(self):
     iflogin()
     data = web.input()
     new_name = data.get('new_name', '')
     key = data.get('key', '')
     if new_name and key:
         value_dict = {'key':key, 'name':htmlquote(new_name)}
         update_column(key, value_dict)
         raise web.seeother('/%s/columns'%ADMIN)
     else:
         cs = get_columns()
         content = {'columns':cs}
         return template_render('admin_columns.html', PATH, content)
Пример #3
0
 def GET(self, key):
     if key:
         key = htmlquote(key)
         article = get_article(key)
         if article:
             column_key = article.get('column', '')
             columns = get_columns(column_key) 
             if columns:
                 article['column_name'] = columns[0].get('name', '')
             content = {'article':article}
             return template_render('article.html', PATH, content)
         else:
             raise web.seeother('/')
     else:
         raise web.seeother('/')
Пример #4
0
 def GET(self):
     iflogin()
     data = web.input()
     key = data.get('key', '')
     article = {}
     if key:
         article = get_article(key) 
         if not article:
             raise web.seeother('/%s/article'%ADMIN)
         article['column_name'] = ''
         article['key'] = key
         column_key = article.get('column', '')
         article['tag'] = ','.join(article.get('tag', []))
         if column_key:
             columns = get_columns(column_key) 
             if columns:
                 article['column_name'] = columns[0].get('name', '')
     cs = get_columns()
     content = {'article':article, 'columns':cs}
     return template_render('admin_article_edit.html', PATH, content)
Пример #5
0
 def GET(self):
     iflogin()
     content = {}
     return template_render('admin_baseedit.html', PATH, content)
Пример #6
0
 def run(self):
     iflogin()
     content = {}
     return template_render('index.html', PATH, content)
Пример #7
0
 def GET(self):
     content = {}
     return template_render('login.html', PATH, content)