Skip to content

Commit

Permalink
style login form
Browse files Browse the repository at this point in the history
  • Loading branch information
lenadax committed May 24, 2024
1 parent 36646fc commit 499233d
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 8 deletions.
20 changes: 20 additions & 0 deletions scss/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -322,3 +322,23 @@ body {
.table_length, .table_filter {
width: unset;
}

// login view
#form-loginform {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
width: 100%;
height: 100%;

#field-loginform-user, #field-loginform-password {
display: grid;
grid-template-columns: 1fr 2fr;
}

#input-loginform-login {
margin-top: 2rem;
width: 200px;
}
}
9 changes: 2 additions & 7 deletions src/cone/app/browser/login.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,25 +43,20 @@ def prepare(self):
'field:label:div:help:error:text',
props={
'required': _('no_username_given', default='No username given'),
'label': _('username', default='Username'),
'label.class_add': 'col-sm-2',
'div.class_add': 'col-sm-5',
'label': _('username', default='Username')
})
form['password'] = factory(
'field:label:div:help:*credentials:error:password',
props={
'required': _('no_password_given', default='No password given'),
'label': _('password', default='Password'),
'label.class_add': 'col-sm-2',
'div.class_add': 'col-sm-5',
},
custom={
'credentials': ([self.login], [], [], []),
})
actions = form['form_actions'] = factory(
'field:div',
props={
'div.class_add': 'col-sm-offset-2 col-sm-5',
'structural': True,
})
actions['login'] = factory(
Expand All @@ -72,7 +67,7 @@ def prepare(self):
'handler': self.noop,
'next': self.next,
'label': _('login', default='Login'),
'div.class_add': 'col-sm-offset-2 col-sm-5',
'class_add': 'bg-primary text-light'
})
self.form = form

Expand Down
20 changes: 20 additions & 0 deletions src/cone/app/browser/static/cone/cone.app.css
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@
color: #212529;
background-color: #fff;
}
[data-bs-theme=light] #input-loginform-login {
color: #f8f9fa;
}

/* import everything where we need changed bootstrap variables for here */
:root {
Expand Down Expand Up @@ -328,3 +331,20 @@ body {
.table_length, .table_filter {
width: unset;
}

#form-loginform {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
width: 100%;
height: 100%;
}
#form-loginform #field-loginform-user, #form-loginform #field-loginform-password {
display: grid;
grid-template-columns: 1fr 2fr;
}
#form-loginform #input-loginform-login {
margin-top: 2rem;
width: 200px;
}
2 changes: 1 addition & 1 deletion src/cone/app/browser/static/cone/cone.app.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 499233d

Please sign in to comment.