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

<!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">
                <div class="panel-heading bk-bg-primary">
                  <div class="list-articles">
                    <a href="edit.aspx?action=add" class="release btn btn-default"><i class="fa fa-pencil-square-o"></i>新增模型</a>
                  </div>
                </div>
                <div class="panel-body">
                  <div class="table-responsive">
                    <table class="table table-bordered table-striped table-condensed table-hover article-list">
                      <thead>
                        <tr>
                          <th width="30%">模型名称</th>
                          <th>列表页模板</th>
                          <th width="30%">内容页模板</th>
                          <th width="20%">操作</th>                                          
                        </tr>
                      </thead>   
                      <tbody>
                      </tbody>
                    </table>
                  </div>
              
                </div>
              </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>
    <script src="../static/vendor/skycons/js/skycons.js"></script> 
    
    <!-- Plugins JS-->
    
    <!-- Theme JS -->   


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

   

     <script>

         $(function () {
             get_json('../../api/models.ashx?action=list', function (data) {
                 var list = '';
                 for (var i = 0; i < data.data.length; i++) {
                     var id = data.data[i].id;
                     var model_id = data.data[i].model_id;
                     var title = data.data[i].model_name;
                     var listmodel = data.data[i].list_tpl;
                     var contentmodel = data.data[i].show_tpl;
                     var model_isdel = data.data[i].model_isdel;
                     var noDelete = '';
                     if (model_isdel == '1') {
                         noDelete = 'disabled'
                     }

                     list += ''
                      + '<tr id="l' + id + '">'
                         + '<td>' + title + '</td>'
                         + '<td>' + listmodel + '</td>'
                         + '<td>' + contentmodel + '</td>'
                         + '<td>'
                         + '<a class="btn btn-primary" href="list_field.aspx?model_id=' + model_id + '&name=' + title + '" data-toggle="tooltip" title="字段管理" data-original-title="字段管理">字段管理</a>'
                           + '<a class="btn btn-success" href="edit.aspx?action=edit&id=' + id + '" data-toggle="tooltip" title="编辑">'
                             + '<i class="fa fa-edit"></i>'
                           + '</a>'
                           + '<button onClick="Delete(\'..\/..\/api\/models.ashx?action=del&id=' + id + '\')" class="btn btn-info delete" ' + noDelete + '  data-toggle="tooltip" title="删除">'
                             + '<i class="fa fa-trash-o"></i>'
                           + '</button>'
                         + '</td>'
                       + '</tr>'
                 };
                 $('.table tbody').html(list);
                 $("[data-toggle='tooltip']").tooltip();
             });
         })
    </script>
    
</body>

</html>
