Пример #1
0
    def form(self):
        rolesData = app.model.sys.acl.getRoles()

        form = core.web.form.Form()
        form.add( core.web.form.Hidden('id') )
        form.add( core.web.form.Input('uri' , 'notEmpty' , label = 'uri') )
        form.add( core.web.form.Input('desc' , 'notEmpty' , label = '描述') )
        form.add( core.web.form.Checkbox('deny' , data = rolesData , label = '禁止访问'  ) )
        form.add( core.web.form.Checkbox('allow' , data = rolesData , label = '允许访问'  ) )
        return form
Пример #2
0
    def form(self):
        form = core.web.form.Form()
        form.add( core.web.form.Hidden('id') )

        form.add( core.web.form.Input('title' , 'notEmpty' , label='标题') )
        form.add( core.web.form.Input('slug' , 'notEmpty' , label='缩略名') )
        form.add( core.web.form.Input('tags' ,  label='tag') )
        form.add( core.web.form.Textarea('text' , 'notEmpty' , label='' , rows="16") )

        return form
Пример #3
0
    def roleForm(self):
        roleModel = app.model.uc.role()
        roles = []
        for role in roleModel.find().getAll():
            roles.append( { 'value' : role['id'] , 'label' : role['name'] } )

        form = core.web.form.Form()
        form.add( core.web.form.Hidden('id' , 'notEmpty') )
        form.add( core.web.form.Checkbox('roleIds' , label = '角色' , data = roles ) )
        return form
Пример #4
0
 def form(self):
     form = core.web.form.Form()
     form.add( core.web.form.Hidden('id' ) )
     form.add( core.web.form.Input('email', 'notEmpty' , 'isEmail' , label='邮箱') )
     form.add( core.web.form.Input('password' ,  label='密码') )
     form.add( core.web.form.Input('nickname' , 'notEmpty' , label='昵称') )
     return form
Пример #5
0
 def form(self):
     form = core.web.form.Form()
     form.add( core.web.form.Input('title', 'notEmpty' , label='站点名称')  )
     form.add( core.web.form.Input('subtitle', 'notEmpty' , label='副标题')  )
     form.add( core.web.form.Input('keywords' , 'notEmpty' , label='关键词') )
     form.add( core.web.form.Textarea('desc' , 'notEmpty' , label='站点描述') )
     return form
Пример #6
0
 def passwordForm(self):
     form = core.web.form.Form()
     form.add( core.web.form.Password('password' , 'notEmpty' , label='用户密码') )
     form.add( core.web.form.Password('confirm' , 'notEmpty', label='确认密码') )
     return form
Пример #7
0
    def form(self):
        form = core.web.form.Form()
        form.add( core.web.form.Hidden('id') )

        form.add( core.web.form.Input('title' , 'notEmpty' , label='标题') )
        form.add( core.web.form.Input('slug' , 'notEmpty' , label='缩略名') )


        #分类
        category = app.model.bc.meta().find('[type] = %s' , 'category').order('[order] DESC').getAll()
        categoryData = []
        for v in category:
            categoryData.append( { 'label' : v['name'] , 'value' : v['id'] } )

        form.add( core.web.form.Select('category_id' , label='分类' , data=categoryData) )
        form.add( core.web.form.Input('tags' ,  label='tag') )
        form.add( core.web.form.Textarea('text' , 'notEmpty' , label='' , rows="16") )

        return form
Пример #8
0
 def form(self):
     form = core.web.form.Form()
     form.add( core.web.form.Hidden('id') )
     form.add( core.web.form.Input('name' , 'notEmpty' , label='名称') )
     return form
Пример #9
0
 def form(self):
     form = core.web.form.Form()
     form.add( core.web.form.Input('disqus_shortname', 'notEmpty' , label='Disqus Site Shortname:') )
     return form
Пример #10
0
 def form(self):
     form = core.web.form.Form()
     form.add(core.web.form.Input('userEmail', 'notEmpty', 'isEmail', label='邮箱'))
     form.add(core.web.form.Password('password', 'notEmpty', label='密码'))
     return form