<commit_before>{%extends TMPL_BASE%}{%load i18n%}{%load method_override%}

{%block title%}{%trans 'User.new' as newuser%}{{target.username|default:newuser}} - {%trans 'users'%}{%endblock%}

{%block scripts%}{{block.super}}
<script type="text/javascript" src="{% url 'webframe-js' %}"></script>
<script type="text/javascript"><!--
$(document).ready(function(){
	$('input[type=checkbox]').bootstrapSwitch();
	$('#deleteBtn').click(function(){
		if(confirm(gettext('User.msg.confirmDelete'))){
			$(this).parents('form:first')
				.find('input[name=_method]').val('DELETE').end()
				.submit();
		};
	});
});
//--></script>
{%endblock%}

{%block content%}<div class="panel panel-default">
<div class="panel-body">
    <h1>{%trans 'User.new' as newuser%}{{target.username|default:newuser}} - {%trans 'users'%}</h1>
    <form id="userFrm" method="POST" action="{%url 'user' user=target.username|default:'add'%}">
        {%csrf_token%}
        {%method_override 'POST'%}
        {%if target.id%}<div class="field">
            <label for="idFld">{%trans 'id'%}</label>
            <input name="id" value="{{target.id}}" readonly="readonly" class="form-control"/>
        </div>{%endif%}
        <div class="field">
            <label for="usernameFld">{%trans 'username'%}</label>
            <input name="username" value="{{target.username|default:''}}" class="form-control" placeholder="{%trans 'username'%}" required="true"/>
        </div>
        {%if AUTH_PASSWORD_REQUIRED%}<div class="field">
            <label for="passwordFld">{%trans 'password'%}</label>
            <input name="password" class="form-control" placeholder="{%trans 'password'%}" type="password"/>
            <div class="desc">{%trans 'input to change password'%}</div>
        </div><div class="field">
            <label for="confirmPasswdFld">{%trans 'confirm password'%}</label>
            <input name="confirmPasswd" class="form-control" placeholder="{%trans 'confirm password'%}" type="password" equalTo="input[name=password]"/>
            <div class="desc">{%trans 'reinput password to re-confirm'%}</div>
        </div>{%endif%}
        <div class="field">
            <label for="emailFld">{%trans 'email address'%}</label>
            <input name="email" value="{{target.email|default:''}}" class="form-control" placeholder="{%trans 'email address'%}" required="true"/>
        </div>
        <div class="field">
            <label for="first_nameFld">{%trans 'first name'%}</label>
            <input name="first_name" value="{{target.first_name|default:''}}" class="form-control" placeholder="{%trans 'first name'%}" required="true"/>
        </div>
        <div class="field">
            <label for="last_nameFld">{%trans 'last name'%}</label>
            <input name="last_name" value="{{target.last_name|default:''}}" class="form-control" placeholder="{%trans 'last name'%}" required="true"/>
        </div>
        {%if perms.auth%}{%if perms.auth.add_user or perms.auth.change_user%}
        <div class="field">
            <div><label for="is_activeFld">{%trans 'active'%}</label></div>
            <input type="checkbox" name="is_active" value="True"{%if target.is_active%} checked="checked"{%endif%}/>
        </div>
        <div class="field">
            <div><label for="is_staffFld">{%trans 'staff status'%}</label></div>
            <input type="checkbox" name="is_staff" value="True"{%if target.is_staff%} checked="checked"{%endif%}/>
        </div>
        <div class="field">
            <div><label for="is_superuserFld">{%trans 'superuser status'%}</label></div>
            <input type="checkbox" name="is_superuser" value="True"{%if target.is_superuser%} checked="checked"{%endif%}/>
        </div>
        {%endif%}{%endif%}
        <div class="pnl pnl-btns">
            {%for b in btns%}<a href="{%url b.href username=target.username%}" class="btn btn-{{b.lv|default:'info'}}">{%trans b.label%}</a>{%endfor%}
            {%if target.id and perms.auth and perms.auth.delete_user%}<button class="btn btn-danger" id="deleteBtn"><i class="fa fa-user-times"></i> {%trans 'User.actions.delete'%}</button>{%endif%}
            <button type="submit" class="btn btn-warning"><i class="fa fa-save"></i> {%trans 'User.actions.save'%}</button>
        </div>
    </form>
</div>
</div>{%endblock%}<commit_msg>Add the icon into USER_BTNS<commit_after>{%extends TMPL_BASE%}{%load i18n%}{%load method_override%}

{%block title%}{%trans 'User.new' as newuser%}{{target.username|default:newuser}} - {%trans 'users'%}{%endblock%}

{%block scripts%}{{block.super}}
<script type="text/javascript" src="{% url 'webframe-js' %}"></script>
<script type="text/javascript"><!--
$(document).ready(function(){
	$('input[type=checkbox]').bootstrapSwitch();
	$('#deleteBtn').click(function(){
		if(confirm(gettext('User.msg.confirmDelete'))){
			$(this).parents('form:first')
				.find('input[name=_method]').val('DELETE').end()
				.submit();
		};
	});
});
//--></script>
{%endblock%}

{%block content%}<div class="panel panel-default">
<div class="panel-body">
    <h1>{%trans 'User.new' as newuser%}{{target.username|default:newuser}} - {%trans 'users'%}</h1>
    <form id="userFrm" method="POST" action="{%url 'user' user=target.username|default:'add'%}">
        {%csrf_token%}
        {%method_override 'POST'%}
        {%if target.id%}<div class="field">
            <label for="idFld">{%trans 'id'%}</label>
            <input name="id" value="{{target.id}}" readonly="readonly" class="form-control"/>
        </div>{%endif%}
        <div class="field">
            <label for="usernameFld">{%trans 'username'%}</label>
            <input name="username" value="{{target.username|default:''}}" class="form-control" placeholder="{%trans 'username'%}" required="true"/>
        </div>
        {%if AUTH_PASSWORD_REQUIRED%}<div class="field">
            <label for="passwordFld">{%trans 'password'%}</label>
            <input name="password" class="form-control" placeholder="{%trans 'password'%}" type="password"/>
            <div class="desc">{%trans 'input to change password'%}</div>
        </div><div class="field">
            <label for="confirmPasswdFld">{%trans 'confirm password'%}</label>
            <input name="confirmPasswd" class="form-control" placeholder="{%trans 'confirm password'%}" type="password" equalTo="input[name=password]"/>
            <div class="desc">{%trans 'reinput password to re-confirm'%}</div>
        </div>{%endif%}
        <div class="field">
            <label for="emailFld">{%trans 'email address'%}</label>
            <input name="email" value="{{target.email|default:''}}" class="form-control" placeholder="{%trans 'email address'%}" required="true"/>
        </div>
        <div class="field">
            <label for="first_nameFld">{%trans 'first name'%}</label>
            <input name="first_name" value="{{target.first_name|default:''}}" class="form-control" placeholder="{%trans 'first name'%}" required="true"/>
        </div>
        <div class="field">
            <label for="last_nameFld">{%trans 'last name'%}</label>
            <input name="last_name" value="{{target.last_name|default:''}}" class="form-control" placeholder="{%trans 'last name'%}" required="true"/>
        </div>
        {%if perms.auth%}{%if perms.auth.add_user or perms.auth.change_user%}
        <div class="field">
            <div><label for="is_activeFld">{%trans 'active'%}</label></div>
            <input type="checkbox" name="is_active" value="True"{%if target.is_active%} checked="checked"{%endif%}/>
        </div>
        <div class="field">
            <div><label for="is_staffFld">{%trans 'staff status'%}</label></div>
            <input type="checkbox" name="is_staff" value="True"{%if target.is_staff%} checked="checked"{%endif%}/>
        </div>
        <div class="field">
            <div><label for="is_superuserFld">{%trans 'superuser status'%}</label></div>
            <input type="checkbox" name="is_superuser" value="True"{%if target.is_superuser%} checked="checked"{%endif%}/>
        </div>
        {%endif%}{%endif%}
        <div class="pnl pnl-btns">
            {%for b in btns%}<a href="{%url b.href username=target.username%}" class="btn btn-{{b.lv|default:'info'}}">{%if b.icon%}<i class="{{b.icon}}"></i>&nbsp;{%endif%}{%trans b.label%}</a>{%endfor%}
            {%if target.id and perms.auth and perms.auth.delete_user%}<button class="btn btn-danger" id="deleteBtn"><i class="fa fa-user-times"></i> {%trans 'User.actions.delete'%}</button>{%endif%}
            <button type="submit" class="btn btn-warning"><i class="fa fa-save"></i> {%trans 'User.actions.save'%}</button>
        </div>
    </form>
</div>
</div>{%endblock%}
{'fraction_non_alphanumeric': 0.2245508982035928, 'fraction_numerical': 0.0009212344541685859, 'mean_word_length': 3.8196448390677027, 'pattern_counts': {'":': 0, '<': 175, '<?xml version=': 0, '>': 175, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4413180', 'n_tokens_mistral': 2872, 'n_tokens_neox': 2746, 'n_words': 489}