Beispiel #1
0
    def password(self, name, id=None, **attrs):
        kw = {'class_': 'password'}
        kw.update(attrs)

        id = id or name

        return tags.password(name, id=id, **kw)
Beispiel #2
0
 def password(self, name, value=None, id=None, **attrs):
     """
     Outputs a password input.
     """
     id = id or name
     val = self.value(name, value)
     return tags.password(self.prefix + name, val, id, **attrs) + self.getErrorTag(name)
Beispiel #3
0
	def password(self, name, id=None, **attrs):
		kw = {'class_': 'password'}
		kw.update(attrs)

		id = id or name

		return tags.password(name, id=id, **kw)
 def password(self, name, value=None, id=None, **attrs):
     """
     Outputs a password input.
     """
     return tags.password(
         name, self.value(name, value), 
         self._get_id(id, name), 
         **attrs)
Beispiel #5
0
def password_field(name="password", value=None, **options):
    """
    Creates a password field

    Takes the same options as text_field
    """
    _update_fa(options, name)
    return password(name, value=value, **options)
Beispiel #6
0
 def password(
         self, name, value=None, id=None,
         cols=10, inner_cols=None, errors=True, **attrs):
     """
     Outputs a password input.
     """
     id = id or name
     if inner_cols:
         attrs = css_add_class(attrs, 'small-%d' % inner_cols)
     result = tags.password(name, self.value(name, value), id, **attrs)
     if cols:
         return self.column(name, result, cols, inner_cols, errors)
     else:
         return result
Beispiel #7
0
 def display_login_block(self):
     page = context.page
     table = HTML.table(
         HTML.tr(
             HTML.th("Username"),
             HTML.td(tags.text("username")),
         ),
         HTML.tr(
             HTML.th("Password"),
             HTML.td(tags.password("password")),
         ),
         HTML.tr(
             HTML.td(tags.submit(name="submit", value="Log In"), colspan=2)
         ),
         HTML.tr(
             HTML.td(HTML.small(HTML.a("Create Account", href=make_link("user_admin/create"))), colspan=2)
         ),
         # class_="form",
     )
     form = HTML.form(table, action=make_link("user_admin/login"), method="POST")
     page.add_block(Block("Login", form, self._user_block_location(), 90))
Beispiel #8
0
 def password(self, name, value=None, id=None, **attrs):
     return tags.password(name,
                          self.value(name, value),
                          self._id(id, name),
                          **attrs)
Beispiel #9
0
 def password(self, name, value=None, id=None, **attrs):
     """
     Outputs a password input.
     """
     return tags.password(name, self.value(name, value),
                          self._get_id(id, name), **attrs)
Beispiel #10
0
 def test_password_field(self):
     eq_(
         password("password"),
         u'<input id="password" name="password" type="password" />'
     )
Beispiel #11
0
 def password(self, name, value=None, id=None, **attrs):
     """
     Outputs a password input.
     """
     id = id or name
     return tags.password(name, self.value(name, value), id, **attrs)