SP/web2py/applications/admin/views/default/user.html
Saturneic 064f602b1a Add.
2018-10-25 23:33:13 +08:00

68 lines
2.2 KiB
HTML

{{extend 'layout.html'}}
<!-- begin "user" block -->
<h2>{{=T( request.args(0).replace('_',' ').capitalize() )}}</h2>
<div id="web2py_user_form">
{{if 'auth' in globals():}}
{{
# add bootstrap class to form
form['_class']='span4 well well-small'
# change form.custom.begin
form.custom.begin=XML("<%s %s>" % (form.tag,form._xml()[0]))
if request.args(0)=='login':
# delete empty label
d = form.elements("tr#auth_user_remember__row")
d[0][0] = " "
# remake remember checkbox
cbx_inp=form.element(_name='remember')
cbx_inp['_class']=""
cbx_lbl=form.element(_for='auth_user_remember')[0]
form.element('div',replace=LABEL(cbx_inp,cbx_lbl,_class="checkbox"))
# new form buttons
smt = form.element('input',_type='submit')
smt['_class']='btn'
btns = [smt]
if not 'register' in auth.settings.actions_disabled:
btns.append(A(T('register'),_href=URL(r=request,args='register'),_class='btn btn-lnk'))
pass
if not 'request_reset_password' in auth.settings.actions_disabled:
btns.append(A(T('lost password'),_href=URL(r=request,args='request_reset_password'),_class='btn btn-lnk'))
pass
form.element('input[type=submit]',replace=DIV(*btns,_class="controls-inline"))
pass
if request.args(0)in['register','profile']:
# remake is_manager checkbox
cbx_inp=form.element(_name='is_manager')
cbx_lbl=form.element(_for='auth_user_is_manager')[0]
form.element(_name='is_manager',replace=lambda cbx_inp : LABEL(cbx_inp,cbx_lbl,_class="checkbox"))
# delete is manager label
d = form.elements("tr#auth_user_is_manager__row")
d[0][0][0] = " "
# new form buttons
smt = form.element('input',_type='submit')
smt['_class']='btn'
form.element('input[type=submit]',replace=lambda button: DIV(button,_class="controls-inline"))
pass
if request.args(0)in ['request_reset_password','change_password']:
# new form buttons
smt = form.element('input',_type='submit')
smt['_class']='btn'
form.element('input[type=submit]',replace=lambda button: DIV(button,_class="controls-inline"))
pass
}}
{{=form.custom.begin}}
{{for e in form.components[0]:}}
{{= e[0][0]}}
{{= e[1][0]}}
{{pass}}
{{=form.custom.end}}
{{else:}}
{{=form}}
{{pass}}
</div>
<script language="javascript">
//<!--
jQuery("#web2py_user_form input:visible:enabled:first").focus();
//-->
</script>
<!-- end "user" block -->