<commit_before><!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8"/>
    <title>product</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
    <link rel="icon" type="image/x-icon" href="/assets/favicon.ico"/>
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-touch-fullscreen" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="default">
    <meta content="<%= pkg.description %>
" name="description"/>
    <meta content="<%= pkg.author %>
" name="author"/>


    <link href="<%= config.media_res_url %>/templete/plugins/dropzone/css/dropzone.css" rel="stylesheet" type="text/css"/>
    <%- include ../inc/style.html %>
    <link href="/templete/plugins/summernote/css/summernote.css" rel="stylesheet" type="text/css" media="screen">


</head>
<body class="fixed-header <%= menupin %>
 ">
<%- include ../inc/sidebar.html %>
<div class="page-container">
    <%- include ../inc/header.html %>
    <div class="page-content-wrapper">
        <div class="content" id="content">
            <div class="jumbotron" data-pages="parallax">
                <div class="container-fluid container-fixed-lg sm-p-l-20 sm-p-r-20">
                    <div class="inner">
                        <ul class="breadcrumb">
                            <li>
                                <p>
                                    product
                                </p>
                            </li>
                            <li><a href="../<%= event.id %>">list</a>
                            </li>
                            <li><a href="#" class="active">create</a>
                            </li>
                        </ul>
                    </div>
                </div>
            </div>
            <div class="container-fluid container-fixed-lg">
                <div class="row">
                    <div class="col-md-12">
                        <div class="panel panel-default">
                            <div class="panel-heading">
                                <div class="panel-title">
                                    product
                                </div>
                            </div>
                            <div class="panel-body">
                                <h5>
                                    商品
                                </h5>
                                <div class="row">
                                    <div class="col-md-6">
                                        <div class="form-group">
                                            <label>商品名称</label>
                                            <input type="text" class="form-control input_name" value="<%= data.name %>">
                                        </div>
                                        <div class="form-group">
                                            <label>计量单位</label>
                                            <input type="text" class="form-control input_unit" value="<%= data.unit %>">
                                        </div>
                                        <div class="form-group">
                                            <label>排序值</label>
                                            <input type="text" class="form-control input_sort" value="<%= data.sort %>">
                                        </div>
                                    </div>
                                    <div class="col-md-6">

                                        <div class="form-group">
                                            <label>商品类别</label>
                                            <input type="text" class="form-control input_categoryName" value="<%= data.categoryName %>">
                                        </div>

                                        <div class="form-group">
                                            <label>是否上架</label>
                                            <input type="text" class="form-control input_isSale" value="<%= data.isSale %>">
                                        </div>

                                        <div class="form-group">
                                            <label>市场价</label>
                                            <input type="text" class="form-control input_price" value="<%= data.price %>">
                                        </div>
                                    </div>
                                </div>
                                <h5>商品信息</h5>
                                <div class="summernote-wrapper">
                                    <div id="summernote">
                                        <%- data.content %>
                                    </div>
                                </div>
                                <div class="row" style="margin-top: 20px;">
                                    <div class="col-md-12">
                                        <input type="hidden" class="form-control input_id" value="<%= data.id %>">
                                        <a class="btn btn-success btn_create">提交</a>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <%- include ../inc/footer.html %>
    </div>
</div>
<%- include ../inc/script.html %>
<script src="/templete/plugins/summernote/js/summernote.min.js" type="text/javascript"></script>
<script src="/templete/plugins/summernote/js/summernote-zh-CN.js" type="text/javascript"></script>


<script type="text/javascript" src="<%= config.media_res_url %>/templete/plugins/dropzone/dropzone.min.js"></script>
<script type="text/javascript" src="<%= config.media_res_url %>/assets/js/mustache.min.js"></script>
<script type="text/javascript" src="<%= config.media_res_url %>/api/<%= eventExt.media_appId %>/media_app.js"></script>

<script src="/assets/js/summernote-ext-bal-media/summernote-ext-bal-media.js" type="text/javascript"></script>
<script>
    $(document).ready(function() {
        $('#summernote').summernote({
            height: 300,
            lang: 'zh-CN',
            toolbar: [
                //[groupname, [button list]]
                ['group', ['bal_media']],
                ['style', ['bold', 'italic', 'underline', 'clear']],
                ['font', ['strikethrough']],
                ['fontsize', ['fontsize','fontname']],
                ['color', ['color']],
                ['para', ['ul', 'ol', 'paragraph']],
                ['height', ['height']],
                ['Insert', ['table','hr']],
            ],
            fontNames: [
                "Lantinghei SC", "Open Sans", "Arial", "Hiragino Sans GB", "Microsoft YaHei", "微软雅黑", "STHeiti", "WenQuanYi Micro Hei", "SimSun", "sans-serif"
            ],
            onImageUpload: function(files) {
//                console.log('image upload:', files);
                // upload image to server and create imgNode...
//                $('#summernote').summernote('insertNode', imgNode);
            }
        });
        $('#summernote').on('summernote.image.upload', function(customEvent, files) {
            data = new FormData();
            data.append("file", files[0]);
            console.log('image upload:', file, editor, welEditable);
            console.log(data);
            $.ajax({
                data: data,
                type: "POST",
                url: "upload/index/news",
                cache: false,
                contentType: 'multipart/form-data',
                processData: false,
                success: function(url) {
//                    editor.insertImage(welEditable, url);
                }
            });
            console.log('image upload:', files);
        });

    });

    $('.btn_create').click(function(){
        var obj = {};
        obj.name = $('.input_name').val();
        obj.categoryId = $('.input_categoryId').val();
        obj.categoryName = $('.input_categoryName').val();
        obj.unit = $('.input_unit').val();
        obj.isSale = $('.input_isSale').val();
        obj.sort = $('.input_sort').val();<commit_msg>添加产品后台界面完成<commit_after><!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8"/>
    <title>product</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
    <link rel="icon" type="image/x-icon" href="/assets/favicon.ico"/>
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-touch-fullscreen" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="default">
    <meta content="<%= pkg.description %>" name="description"/>
    <meta content="<%= pkg.author %>" name="author"/>


    <link href="<%= config.media_res_url %>/templete/plugins/dropzone/css/dropzone.css" rel="stylesheet" type="text/css"/>
    <%- include ../inc/style.html %>
    <link href="/templete/plugins/summernote/css/summernote.css" rel="stylesheet" type="text/css" media="screen">
    <style>
        .table tbody tr td {
            padding: 0px;
        }
        .table tbody tr .td_thumb {
            padding: 0px;
        }
        .table tbody tr .td_index {
            padding: 5px;
        }
        .table tbody tr .td_control {
            padding: 5px;
        }
    </style>

</head>
<body class="fixed-header <%= menupin %>
 ">
<%- include ../inc/sidebar.html %>
<div class="page-container">
    <%- include ../inc/header.html %>
    <div class="page-content-wrapper">
        <div class="content" id="content">
            <div class="jumbotron" data-pages="parallax">
                <div class="container-fluid container-fixed-lg sm-p-l-20 sm-p-r-20">
                    <div class="inner">
                        <ul class="breadcrumb">
                            <li>
                                <p>
                                    product
                                </p>
                            </li>
                            <li><a href="../<%= event.id %>">list</a>
                            </li>
                            <li><a href="#" class="active">create</a>
                            </li>
                        </ul>
                    </div>
                </div>
            </div>
            <div class="container-fluid container-fixed-lg">
                <div class="row">
                    <div class="col-md-12">
                        <div class="panel panel-default">
                            <div class="panel-heading">
                                <div class="panel-title">
                                    product
                                </div>
                            </div>
                            <div class="panel-body">
                                <h5>
                                    商品
                                </h5>
                                <div class="row">
                                    <div class="col-md-6">
                                        <div class="form-group">
                                            <label>商品名称</label>
                                            <input type="text" class="form-control input_name" value="<%= data.name %>">
                                        </div>
                                        <div class="form-group">
                                            <label>计量单位</label>
                                            <input type="text" class="form-control input_unit" value="<%= data.unit %>">
                                        </div>
                                        <div class="form-group">
                                            <label>排序值</label>
                                            <input type="text" class="form-control input_sort" value="<%= data.sort %>">
                                        </div>
                                    </div>
                                    <div class="col-md-6">

                                        <div class="form-group">
                                            <label>商品类别</label>
                                            <input type="text" class="form-control input_categoryName" value="<%= data.categoryName %>">
                                        </div>

                                        <div class="form-group">
                                            <label>是否上架</label>
                                            <input type="text" class="form-control input_isSale" value="<%= data.isSale %>">
                                        </div>

                                        <div class="form-group">
                                            <label>市场价</label>
                                            <input type="text" class="form-control input_price" value="<%= data.price %>">
                                        </div>
                                    </div>
                                </div>
                                <h5>商品信息</h5>
                                <div class="summernote-wrapper">
                                    <div id="summernote">
                                        <%- data.content %>
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="col-md-3">
                                        <table class="table table-bordered">
                                            <thead>
                                            <tr class="active">
                                                <th width="10"></th>
                                                <th width="120">缩略图</th>
                                                <!--<th>商品编码</th>-->
                                                <!--<th>条形码</th>-->
                                                <th>操作</th>
                                            </tr>
                                            </thead>
                                            <tbody>
                                            <tr>
                                                <td class="td_index"></td>
                                                <td class="td_thumb">
                                                    <style>
                                                        .td_thumb {
                                                            width: 120px;
                                                            height: 120px;
                                                            border: 1px solid #e1e1e1;
                                                            overflow: hidden;
                                                            position: relative;
                                                            z-index: 0;
                                                            margin: 0;
                                                        }
                                                        .td_thumb .op {
                                                            height: 20px;
                                                            position: absolute;
                                                            bottom: 0;
                                                            width: 100%;
                                                            z-index: 10;
                                                            display: none;
                                                            text-align: center;
                                                        }
                                                        .td_thumb:hover .op{
                                                            display: block;
                                                        }
                                                    </style>
                                                    <img src="" width="120" height="120">
                                                    <div class="op">
                                                        <div class="op-btn"><a class="delete-pic" href="javascript:void(0)"><em class="ui-btn-del-white-ico"></em>修改</a></div>
                                                    </div>
                                                </td>
                                                <!--<td><input class="form-control"></td>-->
                                                <!--<td><input class="form-control"></td>-->
                                                <td class="td_control"><a class="btn btn-default" href="javascript:void(0)">修改</a></td>
                                            </tr>
                                            </tbody>
                                        </table>
                                    </div>
                                </div>
                                <div class="row">
                                    <style>
                                        .productAlbumBox {
                                            margin-top: 20px;
                                            overflow: hidden;
                                            margin-left: 0px;
                                        }
                                        .productAlbumBox .productAlbumItem {
                                            float: left;
                                            width: 128px;
                                            height: 128px;
                                            position: relative;
                                            border: 1px solid #d6dee3;
                                            overflow: hidden;
                                            margin-right: 15px;
                                            margin-bottom: 15px;
                                        }
                                        .productAlbumItem .op{
                                            height: 20px;
                                            position: absolute;
                                            bottom: 0;
                                            width: 100%;
                                            z-index: 10;
                                            display: none;
                                            text-align: center;
                                        }
                                        .op .op-btn{
                                            width: 100%;
                                            height: 20px;
                                            position: absolute;
                                            bottom: 0;
                                        }
                                        .op .op-btn a{
                                            display: block;
                                            color: #FFF;
                                            line-height: 20px;
                                            background-color: rgba(0, 0, 0, 0.5);
                                        }
                                        .productAlbumItem:hover .op{
                                            display: block;
                                        }
                                    </style>
                                    <div class="col-md-12">
                                        <div class="productAlbumBox">
                                            <div class="productAlbumItem">
                                                <img src="" width="100%" height="100%">
                                                <div class="op">
                                                    <div class="op-btn"><a class="delete-pic" href="javascript:void(0)"><em class="ui-btn-del-white-ico"></em>删除</a></div>
                                                </div>
                                            </div>
                                            <a class="productAlbumItem btn btn-primary btn-lg btn-larger btn-block" style="padding-top: 50px;">添加产品图</a>
                                        </div>
                                    </div>
                                </div>
                                <div class="row" style="margin-top: 20px;">
                                    <div class="col-md-12">
                                        <input type="hidden" class="form-control input_id" value="<%= data.id %>">
                                        <a class="btn btn-success btn_create">提交</a>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <%- include ../inc/footer.html %>
    </div>
</div>
<%- include ../inc/script.html %>
<script src="/templete/plugins/summernote/js/summernote.min.js" type="text/javascript"></script>
<script src="/templete/plugins/summernote/js/summernote-zh-CN.js" type="text/javascript"></script>


<script type="text/javascript" src="<%= config.media_res_url %>/templete/plugins/dropzone/dropzone.min.js"></script>
<script type="text/javascript" src="<%= config.media_res_url %>/assets/js/mustache.min.js"></script>
<script type="text/javascript" src="<%= config.media_res_url %>/api/<%= eventExt.media_appId %>/media_app.js"></script>

<script src="/assets/js/summernote-ext-bal-media/summernote-ext-bal-media.js" type="text/javascript"></script>
<script>
    $(document).ready(function() {
        $('#summernote').summernote({
            height: 300,
            lang: 'zh-CN',
            toolbar: [
                ['group', ['bal_media']],
                ['style', ['bold', 'italic', 'underline', 'clear']],
                ['font', ['strikethrough']],
                ['fontsize', ['fontsize','fontname']],
                ['color', ['color']],
                ['para', ['ul', 'ol', 'paragraph']],
                ['height', ['height']],
                ['Insert', ['table','hr']],
            ],
            fontNames: [
                "Lantinghei SC", "Open Sans", "Arial", "Hiragino Sans GB", "Microsoft YaHei", "微软雅黑", "STHeiti", "WenQuanYi Micro Hei", "SimSun", "sans-serif"
            ]
        });

    });

    $('.btn_create').click(function(){
        var obj = {};
        obj.name = $('.input_name').val();
        obj.categoryId = $('.input_categoryId').val();
        obj.categoryName = $('.input_categoryName').val();
        obj.unit = $('.input_unit').val();
        obj.isSale = $('.input_isSale').val();
        obj.sort = $('.input_sort').val();
{'fraction_non_alphanumeric': 0.127095277692678, 'fraction_numerical': 0.0059083548514158165, 'mean_word_length': 0.7771037486389796, 'pattern_counts': {'":': 0, '<': 365, '<?xml version=': 0, '>': 365, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 311, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3376538', 'n_tokens_mistral': 5076, 'n_tokens_neox': 4732, 'n_words': 891}