2018-02-10 16:47:53 -06:00
|
|
|
## -*- coding: utf-8; -*-
|
2019-08-04 20:43:31 -05:00
|
|
|
<%inherit file="/form.mako" />
|
2018-11-27 18:20:15 -06:00
|
|
|
<%namespace name="base_meta" file="/base_meta.mako" />
|
2013-09-01 20:25:34 -07:00
|
|
|
|
|
|
|
<%def name="title()">Login</%def>
|
|
|
|
|
2017-02-13 19:08:18 -06:00
|
|
|
<%def name="extra_styles()">
|
|
|
|
${parent.extra_styles()}
|
2023-02-03 12:05:17 -06:00
|
|
|
<style type="text/css">
|
|
|
|
.logo img {
|
|
|
|
display: block;
|
|
|
|
margin: 3rem auto;
|
|
|
|
max-height: 350px;
|
|
|
|
max-width: 800px;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* must force a particular label with, in order to make sure */
|
|
|
|
/* the username and password inputs are the same size */
|
|
|
|
.field.is-horizontal .field-label .label {
|
|
|
|
text-align: left;
|
|
|
|
width: 6rem;
|
|
|
|
}
|
|
|
|
|
|
|
|
.buttons {
|
|
|
|
justify-content: right;
|
|
|
|
}
|
|
|
|
</style>
|
2013-09-01 20:25:34 -07:00
|
|
|
</%def>
|
|
|
|
|
2013-09-09 21:57:35 -07:00
|
|
|
<%def name="logo()">
|
2019-08-04 20:43:31 -05:00
|
|
|
${h.image(image_url, "{} logo".format(capture(base_meta.app_title)))}
|
2013-09-09 21:57:35 -07:00
|
|
|
</%def>
|
|
|
|
|
2016-12-11 18:07:30 -06:00
|
|
|
<%def name="login_form()">
|
|
|
|
<div class="form">
|
2018-02-10 16:47:53 -06:00
|
|
|
${form.render_deform(form_kwargs={'data-ajax': 'false'})|n}
|
2013-09-01 20:25:34 -07:00
|
|
|
</div>
|
2016-12-11 18:07:30 -06:00
|
|
|
</%def>
|
2013-09-01 20:25:34 -07:00
|
|
|
|
2019-08-04 20:43:31 -05:00
|
|
|
<%def name="render_this_page()">
|
|
|
|
${self.page_content()}
|
|
|
|
</%def>
|
|
|
|
|
2019-08-03 16:57:13 -05:00
|
|
|
<%def name="page_content()">
|
2019-08-04 20:43:31 -05:00
|
|
|
<div class="logo">
|
|
|
|
${self.logo()}
|
|
|
|
</div>
|
2013-09-01 20:25:34 -07:00
|
|
|
|
2023-02-03 12:05:17 -06:00
|
|
|
<div class="columns is-centered">
|
|
|
|
<div class="column is-narrow">
|
|
|
|
<div class="card">
|
|
|
|
<div class="card-content">
|
|
|
|
<tailbone-form></tailbone-form>
|
2019-08-04 20:43:31 -05:00
|
|
|
</div>
|
|
|
|
</div>
|
2023-02-03 12:05:17 -06:00
|
|
|
</div>
|
|
|
|
</div>
|
2019-08-03 16:57:13 -05:00
|
|
|
</%def>
|
|
|
|
|
2023-02-03 19:51:50 -06:00
|
|
|
<%def name="modify_this_page_vars()">
|
|
|
|
<script type="text/javascript">
|
|
|
|
|
2024-05-06 22:13:43 -05:00
|
|
|
${form.component_studly}Data.usernameInput = null
|
|
|
|
|
|
|
|
${form.component_studly}.mounted = function() {
|
2023-02-03 19:51:50 -06:00
|
|
|
this.$refs.username.focus()
|
2024-05-06 22:13:43 -05:00
|
|
|
this.usernameInput = this.$refs.username.$el.querySelector('input')
|
|
|
|
this.usernameInput.addEventListener('keydown', this.usernameKeydown)
|
|
|
|
}
|
|
|
|
|
|
|
|
${form.component_studly}.beforeDestroy = function() {
|
|
|
|
this.usernameInput.removeEventListener('keydown', this.usernameKeydown)
|
2023-02-03 19:51:50 -06:00
|
|
|
}
|
|
|
|
|
2024-05-06 22:13:43 -05:00
|
|
|
${form.component_studly}.methods.usernameKeydown = function(event) {
|
2023-02-07 16:12:09 -06:00
|
|
|
if (event.which == 13) {
|
|
|
|
event.preventDefault()
|
|
|
|
this.$refs.password.focus()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-02-03 19:51:50 -06:00
|
|
|
</script>
|
|
|
|
</%def>
|
|
|
|
|
2019-08-03 16:57:13 -05:00
|
|
|
|
|
|
|
${parent.body()}
|