{% extends 'obj_form.html' %}
{% load i18n %}
{% load tj_filters %}

{% block subtitle-1 %}
{% trans "分享配置" %}
{% endblock %}
{% block subtitle-2 %}
{% trans "新建邀请码" %}
{% endblock %}


{% block form_content %}
{{ block.super }}

<style>
    input[type=radio],
    input[type=checkbox] {
        display: inline-block;
        width: auto;
        height: auto;
        border: none;
        box-shadow: none;
    }

    .input-num {
        display: inline-block;
        width: 100px;
        border: none;
        border-bottom: 1px solid gray;
    }
</style>

<div class="alert alert-success" role="alert" style="display: none">保存成功！</div>

<div class="form-group">
    <label class="col-sm-2 control-label ">生成邀请码数量 </label>
    <div class="col-sm-10">
        <input type="number" name="num" placeholder="输入生成验证码数量(最小0,最大99999)"/>
	</div>
</div>
<div class="form-group">
    <label class="col-sm-2 control-label ">{% get_verbose_field_name form.instance 'tm_start' %} </label>
    <div class="col-sm-10">
		{{ form.tm_start }}
	</div>
</div>
<div class="form-group">
    <label class="col-sm-2 control-label ">{% get_verbose_field_name form.instance 'tm_end' %} </label>
    <div class="col-sm-10">
		{{ form.tm_end }}
	</div>
</div>
<div class="form-group">
    <label class="col-sm-2 control-label ">{% get_verbose_field_name form.instance 'remark' %} </label>
    <div class="col-sm-10">{{ form.remark }}</div>
</div>

<div>
    <a class="btn btn-primary btn-save" type="submit" style="float:right;">{% trans '保存' %}</a>
</div>


<script>
    $(document).ready(function () {
	
		setDatePickerZh();
        $('.datetimepicker').datetimepicker({
            i18n:{
                zh:{
                    months:['一月','二月','三月','四月','五月','六月','七月','八月','九月','十月','十一月','十二月',],
                    dayOfWeek:["一", "二", "三", "四","五", "六", "日",]
                }
            },
            //timepicker:true,
            format:'Y-m-d H:i:s',        
        });
		
        $('.btn-save').click(function () {
            $.SubmitForm('#obj_form form', '{{request.path}}');
        });
    })

</script>
{% endblock %}