Exemplo n.º 1
0
 def POST(self):
     ipt = web.input(_unicode=True)
     f = self.add_article_form()
     myf = mww.MyForm(f,'/cumt/AddArticle')
     if not f.validates(ipt):
         s = mww.ListGroup(session.get_session().actions).render()
         l = mww.Panel('Settings',s)
         r = mww.Panel('Add New Article',myf.render_css())
         return render.l3r9(left=l.render(),right=r.render())
     else:
         if f.d.parent == "NEW_TOPIC":
             articles.add_article(f.d.name, f.d.title, f.d.content, "NOPARENT" )
         else:
             articles.add_article(f.d.name, f.d.title, f.d.content, f.d.parent )
         web.config._title_list = articles.gen_title_list()
         return "success"
Exemplo n.º 2
0
 def POST(self):
     ipt = web.input(_unicode=True)
     f = self.del_article_form()
     myf = mww.MyForm(f,'/cumt/DelArticle')
     if not f.validates(ipt):
         s = mww.ListGroup(session.get_session().actions).render()
         l = mww.Panel('Settings',s)
         r = mww.Panel('Del A Article',myf.render_css())
         return render.l3r9(left=l.render(),right=r.render())
     else:
         a = articles.get_article_by_name(ipt.name)
         leaves = articles.get_articles_by_parent(a.parent)
         assert len(leaves) > 1
         #parent = articles.get_article_by_name(a.parent)
         articles.del_article_by_name(ipt.name)
         web.config._title_list = articles.gen_title_list()
         return 'success'
Exemplo n.º 3
0
    def POST(self):
        ipt  = web.input(_unicode=True)
        if 'article' in ipt and articles.name_exist_p(ipt.article):
            article_info = articles.get_article_by_name(ipt.article)
            s = mww.ListGroup(session.get_session().actions).render()
            l = mww.Panel('Settings',s)
            aaf = mww.MyForm(self.alter_article_form()(article_info),'/cumt/AlterArticle')
            asf = mww.MyForm(self.article_select_form(),'/cumt/AlterArticle')
            asf.form.fill(ipt)
            r1 = mww.Panel('Article Select',asf.render_css())
            r2 = mww.Panel('Alter Article',aaf.render_css())
            return render.l3r9(left=l.render(),right=r1.render()+r2.render())

        elif 'name' in ipt and 'parent' in ipt and 'has_child_p' in ipt and articles.parent_sans_p(ipt.parent):
            # TODO result check
            articles.update(ipt.aid,content = ipt.content,title=ipt.title,parent=ipt.parent,has_child_p=ipt.has_child_p)
            web.config._title_list = articles.gen_title_list()
            return "success"
        else:
            myf = mww.MyForm(self.article_select_form(),'/cumt/AlterArticle')
            s = mww.ListGroup(session.get_session().actions).render()
            l = mww.Panel('Settings',s)
            r = mww.Panel('Article Select',myf.render_css())
            return render.l3r9(left=l.render(),right=r.render())
Exemplo n.º 4
0
    '/Application',
    'app.controllers.attendant.Application',
    '/SendApplication',
    'app.controllers.attendant.SendApplication',
    '/ApplicationRoute',
    'app.controllers.attendant.ApplicationRoute',
    '/UserManage',
    'app.controllers.admin.UserManage',
    '/ResetUserPassword',
    'app.controllers.admin.ResetUserPassword',
    '/AddArticle',
    'app.controllers.articlemanage.AddArticle',
    '/DelArticle',
    'app.controllers.articlemanage.DelArticle',
    '/AlterArticle',
    'app.controllers.articlemanage.AlterArticle',
    '/UserDetail',
    'app.controllers.detail.UserDetail',
    '/RegReport',
    'app.controllers.report.RegReport',
)

app = web.application(urls, globals())
session.add_sessions_to_app(app)
web.config._title_list = articles.gen_title_list()

application = app.wsgifunc()

if __name__ == "__main__":
    app.run()
Exemplo n.º 5
0
    '/Login',                          'app.controllers.account.Login',
    '/Logout',                         'app.controllers.account.Logout',
    '/Profile',                        'app.controllers.account.Profile',
    #'/ResendPassword',                 'app.controllers.account.ResendPassword',
    '/ResetPassword',                  'app.controllers.account.ResetPassword',

    '/Application',                    'app.controllers.attendant.Application',
    '/SendApplication',                'app.controllers.attendant.SendApplication',
    '/ApplicationRoute',               'app.controllers.attendant.ApplicationRoute',

    '/UserManage',                     'app.controllers.admin.UserManage',
    '/ResetUserPassword',              'app.controllers.admin.ResetUserPassword',

    '/AddArticle',                     'app.controllers.articlemanage.AddArticle',
    '/DelArticle',                     'app.controllers.articlemanage.DelArticle',
    '/AlterArticle',                   'app.controllers.articlemanage.AlterArticle',

    '/UserDetail',                     'app.controllers.detail.UserDetail',

    '/RegReport',                      'app.controllers.report.RegReport',
)

app = web.application(urls,globals())
session.add_sessions_to_app(app)
web.config._title_list = articles.gen_title_list()

application = app.wsgifunc()

if __name__ == "__main__":
    app.run()