<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="edit.aspx.cs" Inherits="wjdhcms_SAAS.module.model.edit" %>


<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<title>内容</title>
    <!-- start: CSS file-->
    <!-- Vendor CSS-->
    <link href="../static/vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet" />
    <link href="../static/vendor/skycons/css/skycons.css" rel="stylesheet" />
    <link href="../static/vendor/font-awesome/css/font-awesome.min.css" rel="stylesheet" />
    <!-- Plugins CSS-->
    <link href="../static/plugins/bootkit/css/bootkit.css" rel="stylesheet" />
    <!-- Page CSS -->   
    <link href="../static/css/style.css" rel="stylesheet" />
    <link href="../static/css/add-ons.min.css" rel="stylesheet" />

    <!-- end: CSS file--> 
    <!-- Head Libs -->
    <script src="../static/plugins/modernizr/js/modernizr.js"></script>
    
    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
      <script src="../static/js/html5shiv.min.js"></script>
      <script src="../static/js/respond.min.js"></script>
    <![endif]-->
    




</head>

<body class="mainbody">
  <div class="container-fluid">
    <div class="row">
      <div class="col-lg-12">
        <div class="panel wizard-type1" id="wizard2">

          <form id="form" data-toggle="formcache">
                <div class="panel-heading bk-bg-primary">
                  <ul class="steps">
                      <li><a href="#tab11" data-toggle="tab"><span class="badge badge-info"><i class="fa fa-file-text"></i></span>基本信息</a></li>
                    </ul>
                    <div class="progress thin progress-striped active">
                      <div class="progress-bar progress-bar-info" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width: 0%;">
                      </div>
                    </div>
                </div>
                <div class="panel-body">
                  <form class="form">
                    <div class="tab-content">
                      <div class="tab-pane" id="tab11">
                        <div class="row">
                          <div class="col-sm-12">
                            <div class="form-horizontal">
                              <div class="form-group">
                                <label class="col-md-1 control-label" for="model_name">模型名称</label>
                                <div class="col-md-3">
                                  <input type="hidden" name="id" id="id" value="">
                                  <input type="text" name="model_name" id="model_name" class="form-control"  data-no-empty="true" value="">
                                </div>
                                <div class="col-md-2">
                                  <span class="help-block text-right">*模型名称</span>
                                </div>
                              </div>

                              <div class="form-group">
                                <label class="col-md-1 control-label" for="list_tpl">列表页模板</label>
                                <div class="col-md-3">                          
                                  <input type="text" name="list_tpl" id="list_tpl" class="form-control"  data-no-empty="true" value="">
                                </div>
                                <div class="col-md-2">
                                  <span class="help-block text-right">*请填写列表模板</span>
                                </div>
                              </div>

                              <div class="form-group">
                                <label class="col-md-1 control-label" for="show_tpl">内容页模板</label>
                                <div class="col-md-3">
                                  <input name="show_tpl" id="show_tpl" class="form-control"  data-no-empty="true" value="">
                                </div>
                                <div class="col-md-2">
                                  <span class="help-block text-right">*请填写内容模板</span>
                                </div>
                              </div>
                            </div>
                          </div>
                        </div>
                      </div>
                      
                    </div>
                    <div class="navbar-fixed-bottom" style="padding: 0 25px;">
                    <div class="actions">               
                      <input type="button" class="btn btn-info" id="submit" value="提交保存" />
                    </div>
                    </div>
                  </form>
                </div>
                </form>
              </div>
      </div>
    </div>
  </div>

    <!-- start: JavaScript-->
    
    <!-- Vendor JS-->       
    <script src="../static/vendor/js/jquery-2.1.1.min.js"></script>
    <script src="../static/vendor/js/jquery-migrate-1.2.1.min.js"></script>
    <script src="../static/vendor/bootstrap/js/bootstrap.min.js"></script>
    
    <!-- Plugins JS-->
    <script src="../static/plugins/wizard/js/jquery.bootstrap.wizard.min.js"></script>

    
    <!-- Pages JS -->
    <script src="../static/js/pages/form-wizard.js"></script>
    <script src="../static/js/ajax.js"></script>
    
    <!-- end: JavaScript-->
   


     <script type="text/javascript">
         $(function () {
             if ($.getUrlParam('action') == 'edit') {
                 get_json('../../api/models.ashx?action=get&id=' + $.getUrlParam('id'), function (data, waiting) {
                     for (var attr in data.data) {
                         $('#' + attr).val(data.data[attr])
                     }
                 })
             } else {
                 $('body').fadeIn(function () {
                     bootstrapWizard();
                 })
             }
             $('#submit').on("click", function () {
                 noEmpty(function () {
                     var json = $('#form').serializeArray();
                     var a = JSON.stringify(json);
                     console.log(a);
                     send_json('../../api/models.ashx?action=add', json, function () {
                         window.location.href = document.referrer
                     })
                 })
             });
         })
    </script>
</body>
</html>