<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>新增热更新管理</title>
    <!-- 最新版本的 Bootstrap 核心 CSS 文件 -->
    <link rel="stylesheet" href="<?php echo base_url();?>public/js/bootstrap/bootstrap.min.css" >

</head>
<body>
    <div class="container">
        <form action="<?php echo $url;?>" method="post" enctype="multipart/form-data">
            <div class="form-group">
                <label for="exampleInputEmail1">热更新版本号</label>
                <input type="text" class="form-control"  placeholder="subversion" name="subversion" />
            </div>
            <div class="form-group">
                <label class="radio-inline">
                    <input type="radio" name="device" value="1" checked> ANDROID
                </label>
                <label class="radio-inline">
                    <input type="radio" name="device" value="2"> IOS
                </label>
            </div>
            <div class="stage">
                <div class="form-group">
                    <label for="exampleInputPassword1" name="lableact">act</label>
                    <input type="text" class="form-control" placeholder="act" name="act[]" />
                </div>
                <div class="form-group">
                    <label for="exampleInputFile">附件</label>
                    <input type="file" name="stagefile[]" />
                </div>
                <hr style="border-color: red;" />
            </div>
            <div class="form-group">
                <button type="button" class="btn btn-primary addstage">添加新Stage</button>
                <button type="button" class="btn btn-danger delstage">删除Stage</button>
            </div>
            <button type="submit" class="btn btn-default">Submit</button>
        </form>
    </div>
</body>

<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="https://cdn.bootcss.com/jquery/1.12.4/jquery.min.js"></script>
<!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
<script src="<?php echo base_url();?>public/js/bootstrap/bootstrap.min.js" ></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->

<script type="text/javascript">
    var num = 0;
    $('.addstage').click(function () {
        if( num == 0 ){
            $('.stage').clone().insertAfter(".stage");
            $('.stage').last().attr('class', 'stage1');
        }else{
            $('.stage'+num).clone().insertAfter(".stage"+num);
            $('.stage'+num).last().attr('class', 'stage'+ (num + 1));
        }
        num++;

        //修改名称
    });

    $('.delstage').click(function () {
        $('.stage'+num).remove();
        num--;
    });
</script>
</html>