<!DOCTYPE html>
<html class="" lang="en">
<head prefix="og: http://ogp.me/ns#">
    {% include 'twig/common/header/include.twig' %}

    <script src="/dev/lib/moment.js"></script>
    <script src="/dev/lib/url_param.js?v=<?= _version ?>" type="text/javascript" charset="utf-8"></script>
     <script src="/dev/js/agile/backlog.js" type="text/javascript" charset="utf-8"></script>
    <script src="/dev/js/agile/board_column.js?v=<?= _version ?>" type="text/javascript" charset="utf-8"></script>
    <script src="/dev/js/agile/board_setting.js?v=<?= _version ?>" type="text/javascript" charset="utf-8"></script>
    <script src="/dev/lib/handlebars-v4.0.10.js" type="text/javascript" charset="utf-8"></script>

    <!-- <script src="/dev/js/admin/issue_ui.js?v=<?= _version ?>" type="text/javascript" charset="utf-8"></script> -->
    <script src="/dev/js/issue/main.js?v=<?= _version ?>" type="text/javascript" charset="utf-8"></script>
    <script src="/dev/js/issue/form.js?v=<?= _version ?>" type="text/javascript" charset="utf-8"></script>


    <link rel="stylesheet" href="/dev/lib/editor.md/css/editormd.css"/>

    <script src="/dev/lib/editor.md/lib/marked.min.js"></script>
    <script src="/dev/lib/editor.md/lib/prettify.min.js"></script>
    <script src="/dev/lib/editor.md/lib/flowchart.min.js"></script>
    <script src="/dev/lib/editor.md/lib/jquery.flowchart.min.js"></script>
    <script src="/dev/lib/editor.md/editormd.js"></script>

    <!-- Fine Uploader jQuery JS file-->
    <link href="/dev/lib/fine-uploader/fine-uploader.css" rel="stylesheet">
    <link href="/dev/lib/fine-uploader/fine-uploader-gallery.css" rel="stylesheet">
    <script src="/dev/lib/e-smart-zoom-jquery.min.js"></script>
    <script src="/dev/lib/fine-uploader/jquery.fine-uploader.js"></script>

    <link href="/dev/lib/video-js/video-js.min.css" rel="stylesheet">
    <script src="/dev/lib/video-js/video.min.js"></script>

    <link href="/dev/lib/laydate/theme/default/laydate.css" rel="stylesheet">
    <script src="/dev/lib/laydate/laydate.js"></script>

    <script src="/dev/lib/bootstrap-select/js/bootstrap-select.js" type="text/javascript" charset="utf-8"></script>
    <link href="/dev/lib/bootstrap-select/css/bootstrap-select.css" rel="stylesheet">
    <script src="/dev/lib/bootstrap-paginator/src/bootstrap-paginator.js?v=<?= _version ?>"
            type="text/javascript"></script>
    <script src="/dev/lib/mousetrap/mousetrap.min.js"></script>

    <script src="/dev/lib/sweetalert2/sweetalert-dev.js"></script>
    <link rel="stylesheet" href="/dev/lib/sweetalert2/sweetalert-dev.css"/>

    <link href="/gitlab/assets/application.css?v=<?= _version ?>">
    <link rel="stylesheet" href="/dev/css/board.css?v=<?= _version ?>">
</head>

<body class="" data-group="">

{% include 'twig/common/body/script.twig' %}

<section class="has-sidebar page-layout max-sidebar">
    {% include 'twig/common/body/page-left.twig' %}

    <div class="page-layout page-content-body">
        {% include 'twig/common/body/header-content.twig' %}


        <script>
            var findFileURL = "";
        </script>

        <div class="page-with-sidebar">
            {% include 'twig/project/common-page-nav-project.twig' %}

            <div class="content-wrapper page-with-layout-nav page-with-sub-nav">
                <div class="alert-wrapper">
                    <div class="flash-container flash-container-page">
                    </div>
                </div>
                <div class="">
                    <div class="content" id="content-body">
                        <div class="scrolling-tabs-container sub-nav-scroll">

                            <div class="issues-filters">
                                <div class="filtered-search-block issues-details-filters row-content-block second-block"
                                     v-pre="false">
                                    <form class="filter-form js-filter-form" action="/<?=G_project.org_path?>/<?=G_project.key?>/kanban" accept-charset="UTF-8"  method="get">
                                        <div class="issues-other-filters filtered-search-wrapper">
                                            <div class="filter-dropdown-container">
                                                <div class="dropdown inline prepend-right-10">
                                                    <select id="boards_select" name="boards_select"
                                                            class="selectpicker">
                                                        {% for board in boards %}
                                                            <option value="<?= board['id'] ?>" {% if board_default_id==board['id'] %} selected {% endif %}><?= board['name'] ?></option>
                                                        {% endfor %}
                                                    </select>
                                                </div>
                                            </div>

                                            <div class="filtered-search-box" style="left:5px">

                                            <div class="filtered-search-box-input-container">

                                                    <ul class="tokens-container list-unstyled">
                                                        <li class="input-token">
                                                            <input type="text" class="form-control"  name="keyword"  value="<?=keyword?>"  id="kanban-keyword"  placeholder="输入关键字可模糊匹配事项标题"/>
                                                        </li>
                                                    </ul>
                                                    <i class="fa fa-filter"></i>
                                                    <button class="clear-search hidden" type="button">
                                                        <i class="fa fa-times"></i>
                                                    </button>
                                            </div>

                                            </div>
                                            <div class="filter-dropdown-container">
                                                <div class="board-extra-actions">
                                                    <button class="btn btn-default" type="submit" id="btn-search"
                                                            style="margin-left: 0px"><i class="fa fa-search"></i>
                                                    </button>
                                                    <a id="toggle_focus_mode" href="#" role="button" aria-label=""
                                                       title="切换聚焦模式"
                                                       class="btn btn-default has-tooltip prepend-left-10 js-focus-mode-btn"
                                                       data-original-title="切换聚焦模式"
                                                    >
                                                    <span style="display: none;">
                                                        <svg width="17" height="17" viewBox="0 0 17 17"
                                                             xmlns="http://www.w3.org/2000/svg">
                                                            <path d="M.147 15.496l2.146-2.146-1.286-1.286a.55.55 0 0 1-.125-.616c.101-.238.277-.357.527-.357h4a.55.55 0 0 1 .402.17.55.55 0 0 1 .17.401v4c0 .25-.12.426-.358.527-.232.101-.437.06-.616-.125l-1.286-1.286-2.146 2.146-1.428-1.428zM14.996.646l1.428 1.43-2.146 2.145 1.286 1.286c.185.179.226.384.125.616-.101.238-.277.357-.527.357h-4a.55.55 0 0 1-.402-.17.55.55 0 0 1-.17-.401v-4c0-.25.12-.426.358-.527a.553.553 0 0 1 .616.125l1.286 1.286L14.996.647zm-13.42 0L3.72 2.794l1.286-1.286a.55.55 0 0 1 .616-.125c.238.101.357.277.357.527v4a.55.55 0 0 1-.17.402.55.55 0 0 1-.401.17h-4c-.25 0-.426-.12-.527-.358-.101-.232-.06-.437.125-.616l1.286-1.286L.147 2.075 1.575.647zm14.848 14.85l-1.428 1.428-2.146-2.146-1.286 1.286c-.179.185-.384.226-.616.125-.238-.101-.357-.277-.357-.527v-4a.55.55 0 0 1 .17-.402.55.55 0 0 1 .401-.17h4c.25 0 .426.12.527.358a.553.553 0 0 1-.125.616l-1.286 1.286 2.146 2.146z"
                                                                  fill-rule="evenodd"></path>
                                                        </svg>
                                                    </span>
                                                        <span>
                                                        <svg width="15" height="15" viewBox="0 0 15 15"
                                                             xmlns="http://www.w3.org/2000/svg"><path
                                                                    d="M8.591 5.056l2.147-2.146-1.286-1.286a.55.55 0 0 1-.125-.616c.101-.238.277-.357.527-.357h4a.55.55 0 0 1 .402.17.55.55 0 0 1 .17.401v4c0 .25-.12.426-.358.527-.232.101-.437.06-.616-.125l-1.286-1.286-2.146 2.147-1.429-1.43zM5.018 8.553l1.429 1.43L4.3 12.127l1.286 1.286c.185.179.226.384.125.616-.101.238-.277.357-.527.357h-4a.55.55 0 0 1-.402-.17.55.55 0 0 1-.17-.401v-4c0-.25.12-.426.358-.527a.553.553 0 0 1 .616.125L2.872 10.7l2.146-2.147zm4.964 0l2.146 2.147 1.286-1.286a.55.55 0 0 1 .616-.125c.238.101.357.277.357.527v4a.55.55 0 0 1-.17.402.55.55 0 0 1-.401.17h-4c-.25 0-.426-.12-.527-.358-.101-.232-.06-.437.125-.616l1.286-1.286-2.147-2.146 1.43-1.429zM6.447 5.018l-1.43 1.429L2.873 4.3 1.586 5.586c-.179.185-.384.226-.616.125-.238-.101-.357-.277-.357-.527v-4a.55.55 0 0 1 .17-.402.55.55 0 0 1 .401-.17h4c.25 0 .426.12.527.358a.553.553 0 0 1-.125.616L4.3 2.872l2.147 2.146z"
                                                                    fill-rule="evenodd"></path>
                                                        </svg>
                                                    </span>
                                                    </a>
                                                    <button class="btn btn-default" type="button" title="看板设置"
                                                            id="btn-setting_board" style="margin-left: 0px"><i
                                                                class="fa fa-cog"></i>
                                                    </button>

                                                </div>
                                            </div>
                                        </div>
                                    </form>

                                </div>
                            </div>
                            {% include 'twig/issue/form.twig' %}

                            <script>
                                var filteredSearchManager = null;
                                $(document).off('page:restore').on('page:restore', function (event) {
                                    if (gl.FilteredSearchManager) {
                                        window.filteredSearchManager = new gl.FilteredSearchManager();
                                    }
                                    Issuable.init();
                                    new gl.IssuableBulkActions({
                                        prefixId: 'issue_'
                                    });
                                });
                            </script>
                        </div>

                        <div class="container-fluid">
                            <div class="issues-holder">
                                <div class="table-holder">
                                    <div class="boards-list" id="boards-list">
                                        <div class="board is-expandable">
                                            <div class="board-inner">
                                                <header class="board-header">
                                                    <h3 class="board-title">
                                                        <span class="board-title-text">Backlog</span>
                                                        <div class="board-count-badge">
                                                            <span id="backlog_count"
                                                                  class="issue-count-badge-count"></span>
                                                        </div>
                                                    </h3>
                                                </header>
                                                <div class="board-list-component">
                                                    <ul data='backlog' class="board-list" id="backlog_render_id">

                                                    </ul>
                                                </div>
                                            </div>
                                        </div>
                                        <div id="columns_render_id">
                                        </div>
                                        <div id="closed_render_id">
                                        </div>

                                    </div>

                                </div>

                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>


    {% verbatim %}<script type="text/html"  id="board_list_tpl">
    {{#boards}}

     <tr id="tr_data_id_{{id}}">
            <th scope="row"> {{i}}</th>
            <td>{{name}}</td>
            <td>{{range_type}}</td>
            <!--<td>{{#if_eq is_filter_backlog 1}} 是 {{^}} 否 {{/if_eq}}</td>
            <td>{{#if_eq is_filter_closed 1}} 是 {{^}} 否 {{/if_eq}}</td>-->
            <td>{{#if_eq is_default 1}} <a  class="btn btn-transparent" href="#">默认</a> {{^}}
            <a class="btn btn-transparent btn-action list_for_default " style="color:blue" title="设置默认"  href="javascript:void(0);"  data-id="{{id}}">设置</a>{{/if_eq}}</td>
            <td>{{weight}}</td>
            <td>
                {{#if_eq is_system '1'}}
                系统自带
                {{^}}
                    <a class="btn btn-transparent btn-action list_for_edit" title="编辑看板"  href="javascript:void(0);"  style="color:blue"  data-id="{{id}}">
                        <i class="fa fa-pencil-square-o"></i>
                    </a>
                    <a class="btn btn-transparent btn-action list_for_delete" title="删除看板"  class="list_for_delete"  style="color:blue" data-id="{{id}}"  href="javascript:void(0)">
                        <i class="fa fa-trash-o"></i>
                    </a>
                {{/if_eq}}

            </td>
      </tr>
    {{/boards}}
</script>{% endverbatim %}

        <form id="form-board_setting2" action="#" name="form-board_setting2" method="post">
        <div class="modal board_setting-modal" id="modal-board_setting">

            <div class="form-horizontal" id="form-board_setting">

                <input type="hidden" name="project_id" value="<?= project_id ?>">
                <input type="hidden" name="form_board_id" id ="form_board_id" value="">

                <div class="modal-dialog" style="width: 60%;">
                    <div class="modal-content modal-middle">
                        <div class="modal-header">
                            <a class="close js-key-modal-close1" data-dismiss="modal" href="#">×</a>
                            <h3 id="board-header-title" class="modal-header-title">看板管理</h3>
                        </div>

                        <div id="board_table" class="modal-body" style="min-height: 400px">

                                <div class="panel">
                                    <table class="table table-hover">
                                        <thead>
                                        <tr>
                                            <th>#</th>
                                            <th>名称</th>
                                            <th>数据范围</th>
                                            <th>是否默认</th>
                                            <th>排序权重</th>
                                            <th>操作</th>
                                        </tr>
                                        </thead>
                                        <tbody id="board_list_render_id">

                                        </tbody>
                                    </table>
                                </div>
                        </div>
                        <div class="modal-footer form-actions" id="action-board_list">
                            <button type="button" class="btn btn-info" id="btn-show_add_board">
                                <i  class="fa fa-plus"></i> 创建看板
                            </button>
                            <a  class="btn btn-cancel" data-dismiss="modal" href="javascript:;" onclick="$board_setting.refreshBoards()">关 闭</a>
                        </div>

                        <div id="board_add_form" class="modal-body hide" style="min-height: 400px">
                                <div class="form-group">
                                    <div class="col-sm-2"> 看板名称：</div>
                                    <div class="col-sm-3">
                                        <input type="text" class="form-control" name="board_name" id="board_name"  value="">
                                        <p id="tip-board_name" class="gl-field-error hide"></p>
                                    </div>
                                </div>
                                <div class="form-group hide">
                                    <div class="col-sm-2"> 排序权重：</div>
                                    <div class="col-sm-3">
                                        <input type="number" class="form-control" name="board_weight" id="board_weight" value="0">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <div class="col-sm-2">数据范围：</div>
                                    <div class="col-sm-3">
                                        <select id="range_type" name="range_type" class="selectpicker form-control"
                                                dropdownAlignRight="true" title="当前项目">
                                            <option value="all"  >当前项目</option>
                                            <option value="sprints" > 迭 代</option>
                                            <option value="modules"  > 模 块</option>
                                            <option value="issue_types" > 事项类型</option>
                                        </select>
                                    </div>
                                    <div class="col-sm-6" id="range_container">
                                        <div id="range-all" >
                                           当前项目所有事项
                                        </div>
                                        <div id="range-sprints" class="hide">
                                            <select id="range_sprints" name="range_sprints" class="selectpicker form-control"  multiple data-selected-text-format="count > 5"
                                                    dropdownAlignRight="true" title="迭代列表"></select>
                                        </div>
                                        <div id="range-modules" class="hide">
                                            <select id="range_modules" name="range_modules" class="selectpicker form-control"  multiple data-selected-text-format="count > 5"
                                                    dropdownAlignRight="true" title="模块列表"></select>
                                        </div>
                                        <div id="range-issue_types" class="hide">

                                            <select id="range_issue_types" name="range_issue_types" class="selectpicker" multiple data-none-selected-text="请选择"></select>
                                        </div>
                                    </div>

                                    <div class="col-sm-2">
                                    </div>
                                </div>
                                <hr>
                                <div class="board-setting-line">
                                    <div class="board-setting-line-item sequence" >
                                        <div class="board-tools-line-btn">

                                        </div>
                                        <div class="thumbnail">
                                            <div class="board-item-caption">
                                                <div class="js-board-item-title-input" style="display: none;">
                                                    <input type="hidden" class="form-control board-item-title-input" name="text_column_backlog" value="待办事项" >
                                                </div>
                                                <div class="js-board-item-title board-item-title">
                                                    <span>待办事项</span>
                                                </div>
                                            </div>
                                            <div class="board-create-line-btn hide">
                                                <i class="fa fa-plus"></i>
                                            </div>
                                            <div class="board-item-body">
                                                <img data-src="holder.js/100%x150" alt="100%x150"
                                                        src="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9InllcyI/PjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB3aWR0aD0iMjQyIiBoZWlnaHQ9IjIwMCIgdmlld0JveD0iMCAwIDI0MiAyMDAiIHByZXNlcnZlQXNwZWN0UmF0aW89Im5vbmUiPjwhLS0KU291cmNlIFVSTDogaG9sZGVyLmpzLzEwMCV4MjAwCkNyZWF0ZWQgd2l0aCBIb2xkZXIuanMgMi42LjAuCkxlYXJuIG1vcmUgYXQgaHR0cDovL2hvbGRlcmpzLmNvbQooYykgMjAxMi0yMDE1IEl2YW4gTWFsb3BpbnNreSAtIGh0dHA6Ly9pbXNreS5jbwotLT48ZGVmcz48c3R5bGUgdHlwZT0idGV4dC9jc3MiPjwhW0NEQVRBWyNob2xkZXJfMTZlZGMwMzM1YmYgdGV4dCB7IGZpbGw6I0FBQUFBQTtmb250LXdlaWdodDpib2xkO2ZvbnQtZmFtaWx5OkFyaWFsLCBIZWx2ZXRpY2EsIE9wZW4gU2Fucywgc2Fucy1zZXJpZiwgbW9ub3NwYWNlO2ZvbnQtc2l6ZToxMnB0IH0gXV0+PC9zdHlsZT48L2RlZnM+PGcgaWQ9ImhvbGRlcl8xNmVkYzAzMzViZiI+PHJlY3Qgd2lkdGg9IjI0MiIgaGVpZ2h0PSIyMDAiIGZpbGw9IiNFRUVFRUUiLz48Zz48dGV4dCB4PSI4OS44MDQ2ODc1IiB5PSIxMDUuMSI+MjQyeDIwMDwvdGV4dD48L2c+PC9nPjwvc3ZnPg=="
                                                        data-holder-rendered="true"
                                                        style="height: 200px; width: 100%; display: block;">
                                                <p style="margin-top: 5px;">未列入迭代的事项</p>
                                                <div class="row  ">
                                                    <div class="col-sm-8">
                                                        <div class="checkbox" title="隐藏">
                                                            <label>
                                                                <input type="checkbox" id="checkbox_is_filter_backlog" name="checkbox_is_filter_backlog"> 隐藏
                                                            </label>
                                                        </div>
                                                    </div>

                                                </div>
                                            </div>

                                        </div>
                                    </div>

                                    <!-- 活动泳道 -->
                                    <div class="board-setting-line-active" id="board_swim_render">

                                    </div>
                                    <!-- 活动泳道 end -->
                                    
                                    <!-- 关闭泳道 -->
                                    <div class="board-setting-line-item sequence" >
                                        <div class="thumbnail">
                                            <div class="board-item-caption">
                                                <div class="js-board-item-title-input" style="display: none;">
                                                    <input type="text" class="form-control board-item-title-input" name="text_column_1" value="已关闭" >
                                                </div>
                                                <div class="js-board-item-title board-item-title">
                                                    <span>已关闭</span>
                                                </div>
                                            </div>
                                            <div class="board-item-body">
                                                <img data-src="holder.js/100%x150" alt="100%x150"
                                                        src="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9InllcyI/PjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB3aWR0aD0iMjQyIiBoZWlnaHQ9IjIwMCIgdmlld0JveD0iMCAwIDI0MiAyMDAiIHByZXNlcnZlQXNwZWN0UmF0aW89Im5vbmUiPjwhLS0KU291cmNlIFVSTDogaG9sZGVyLmpzLzEwMCV4MjAwCkNyZWF0ZWQgd2l0aCBIb2xkZXIuanMgMi42LjAuCkxlYXJuIG1vcmUgYXQgaHR0cDovL2hvbGRlcmpzLmNvbQooYykgMjAxMi0yMDE1IEl2YW4gTWFsb3BpbnNreSAtIGh0dHA6Ly9pbXNreS5jbwotLT48ZGVmcz48c3R5bGUgdHlwZT0idGV4dC9jc3MiPjwhW0NEQVRBWyNob2xkZXJfMTZlZGMwMzM1YmYgdGV4dCB7IGZpbGw6I0FBQUFBQTtmb250LXdlaWdodDpib2xkO2ZvbnQtZmFtaWx5OkFyaWFsLCBIZWx2ZXRpY2EsIE9wZW4gU2Fucywgc2Fucy1zZXJpZiwgbW9ub3NwYWNlO2ZvbnQtc2l6ZToxMnB0IH0gXV0+PC9zdHlsZT48L2RlZnM+PGcgaWQ9ImhvbGRlcl8xNmVkYzAzMzViZiI+PHJlY3Qgd2lkdGg9IjI0MiIgaGVpZ2h0PSIyMDAiIGZpbGw9IiNFRUVFRUUiLz48Zz48dGV4dCB4PSI4OS44MDQ2ODc1IiB5PSIxMDUuMSI+MjQyeDIwMDwvdGV4dD48L2c+PC9nPjwvc3ZnPg=="
                                                        data-holder-rendered="true"
                                                        style="height: 200px; width: 100%; display: block;">
                                                <p style="margin-top: 5px;">已经关闭的事项</p>
                                                <div class="row  ">
                                                    <div class="col-sm-8">
                                                        <div class="checkbox" title="隐藏">
                                                            <label>
                                                                <input type="checkbox" id="checkbox_is_filter_closed" name="checkbox_is_filter_closed"> 隐藏
                                                            </label>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>

                                        </div>
                                    </div>
                                    <!-- end -->
                                </div>



                        </div>
                        <div class="modal-footer form-actions hide" id="action-board_form">

                            <button name="btn-setting_columns" type="button" class="btn btn-default "  id="btn-back_board_list">
                                <i class="fa fa-arrow-left"></i> 返回看板列表
                            </button>
                            <button name="btn-setting_columns" type="button" class="btn btn-success "   id="btn-board_save">
                                <i class="fa fa-save"></i> 保存看板
                            </button>
                        </div>

                    </div>
                </div>

            </div>

        </div>
        </form>
        <div class="modal" id="modal-issue_move">
            <form class="js-quick-submit js-upload-blob-form form-horizontal" id="form_issue_move"
                  action="/agile/board_issue_move"
                  accept-charset="UTF-8"
                  method="post">
                <div class="modal-dialog">
                    <div class="modal-content">
                        <div class="modal-header">
                            <a class="close" data-dismiss="modal" href="#">×</a>
                            <h3 class="modal-header-title">移动事项</h3>
                        </div>

                        <div class="modal-body">
                            <input type="hidden" name="id" id="edit_id" value="">
                            <input type="hidden" name="format" id="format" value="json">

                            <div class="form-group">
                                <label class="control-label" for="id_name">显示名称:<span class="required"> *</span></label>
                                <div class="col-sm-6">
                                    <div class="form-group">
                                        <input type="text" class="form-control" name="params[name]" id="edit_name"
                                               value=""/>
                                    </div>
                                </div>
                            </div>

                            <div class="form-group">
                                <label class="control-label" for="id_description">描述:</label>
                                <div class="col-sm-6">
                                    <div class="form-group">
                                        <input type="text" class="form-control" name="params[description]"
                                               id="edit_description" value=""/>
                                    </div>
                                </div>
                            </div>

                            <div class="modal-footer">
                                <button name="submit" type="button" class="btn btn-save" id="btn-issue_type_update">保存
                                </button>
                                <a class="btn btn-cancel" data-dismiss="modal" href="#">取消</a>
                            </div>
                        </div>
                    </div>
            </form>
        </div>

    </div>
</section>

{% verbatim %}<script type="text/html" id="board_column_tpl">
 {{#columns}}
    <div data-seq="{{i}}" class="board-setting-line-item  board_swim_item" draggable="true">
        <div class="board-tools-line-btn">
            <i class="fa fa-pencil js-board-item-title-edit-btn" title="编辑"></i>
        </div>
        <div class="board-create-line-btn hide">
            <i class="fa fa-plus"></i>
        </div>
        <div class="thumbnail">
            <div class="board-item-caption">
                <div class="js-board-item-title-input" style="display: none;">
                    <input type="text" class="form-control board-item-title-input" name="name_column_{{i}}" id="name_column_{{i}}" value="{{name}}" >
                </div>
                <div class="js-board-item-title board-item-title">
                    <span id="title_column_{{i}}">{{../name}}</span>
                </div>
            </div>
            <div class="board-item-body">
                <img data-src="holder.js/100%x150" alt="100%x150"
                    src="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9InllcyI/PjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB3aWR0aD0iMjQyIiBoZWlnaHQ9IjIwMCIgdmlld0JveD0iMCAwIDI0MiAyMDAiIHByZXNlcnZlQXNwZWN0UmF0aW89Im5vbmUiPjwhLS0KU291cmNlIFVSTDogaG9sZGVyLmpzLzEwMCV4MjAwCkNyZWF0ZWQgd2l0aCBIb2xkZXIuanMgMi42LjAuCkxlYXJuIG1vcmUgYXQgaHR0cDovL2hvbGRlcmpzLmNvbQooYykgMjAxMi0yMDE1IEl2YW4gTWFsb3BpbnNreSAtIGh0dHA6Ly9pbXNreS5jbwotLT48ZGVmcz48c3R5bGUgdHlwZT0idGV4dC9jc3MiPjwhW0NEQVRBWyNob2xkZXJfMTZlZGMwMzNhNjYgdGV4dCB7IGZpbGw6I0FBQUFBQTtmb250LXdlaWdodDpib2xkO2ZvbnQtZmFtaWx5OkFyaWFsLCBIZWx2ZXRpY2EsIE9wZW4gU2Fucywgc2Fucy1zZXJpZiwgbW9ub3NwYWNlO2ZvbnQtc2l6ZToxMnB0IH0gXV0+PC9zdHlsZT48L2RlZnM+PGcgaWQ9ImhvbGRlcl8xNmVkYzAzM2E2NiI+PHJlY3Qgd2lkdGg9IjI0MiIgaGVpZ2h0PSIyMDAiIGZpbGw9IiNFRUVFRUUiLz48Zz48dGV4dCB4PSI4OS44MDQ2ODc1IiB5PSIxMDUuMSI+MjQyeDIwMDwvdGV4dD48L2c+PC9nPjwvc3ZnPg=="
                    data-holder-rendered="true"
                    style="height: 200px; width: 100%; display: block;">
                <p style="margin-top: 5px">数据源：</p>
                <div class="row board-setting-line-item-row">
                    <div class="col-sm-1">

                    </div>
                    <div class="col-sm-10">
                        <select id="select_status_column_{{i}}" name="select_status_column_{{i}}"  class="selectpicker form-control" multiple data-selected-text-format="count > 3"
                                dropdownAlignRight="true" title="状态筛选">

                        </select>
                    </div>
                </div>
                <div class="row board-setting-line-item-row">
                    <div class="col-sm-1">
                          或
                    </div>
                    <div class="col-sm-10">
                        <select id="select_label_column_{{i}}" name="select_label_column_{{i}}"  class="selectpicker form-control" multiple data-selected-text-format="count > 3"
                                dropdownAlignRight="true" title="标签筛选">

                        </select>
                    </div>
                </div>
                <div class="row board-setting-line-item-row">
                    <div class="col-sm-1">
                        或
                    </div>
                    <div class="col-sm-10">
                        <select id="select_resolve_column_{{i}}" name="select_resolve_column_{{i}}"  class="selectpicker form-control" multiple data-selected-text-format="count > 3"
                                dropdownAlignRight="true" title="解决结果筛选">

                        </select>
                    </div>
                </div>
                <div class="row board-setting-line-item-row">
                    <div class="col-sm-1">
                         或
                    </div>
                    <div class="col-sm-10">
                        <select id="select_assignee_column_{{i}}" name="select_assignee_column_{{i}}" class="selectpicker form-control" multiple data-selected-text-format="count > 3"
                                dropdownAlignRight="true" title="经办人筛选">

                        </select>
                    </div>
                </div>
            </div>
            <div  id="btn_delete_column_{{i}}" name="btn_delete_column_{{i}}" class="board-item-foot js-board-item-title-close-btn">
                <i class="fa fa-close" title="删除"></i> 删除泳道
            </div>
        </div>
    </div>
 {{/columns}}
</script>
{% endverbatim %}
{% verbatim %}<script type="text/html" id="backlog_list_tpl">

    {{#backlogs}}
    <li data-issue_id="{{id}}"  data-from-backlog="true" data-from_closed="false" draggable="false" class="card board-item">
        <div>
            <div class="card-header">
                <h4 class="card-title">
                    {{issue_type_html issue_type }}
                    <a href="/issue/detail/index/{{id}}" target="_blank" title="#" class="js-no-trigger">
                        <span class="card-number">#{{id}}</span>
                        {{summary}}
                    </a>
                </h4>
                <div class="card-assignee">{{make_user assignee}}</div>
            </div>
            <div class="card-footer">
                {{priority_html priority}}
                {{status_html status}}
                {{resolve_html resolve}}
                <!--<a href="#" data-issue_id="{{id}}">
                    <i class="fa fa-pencil"></i>
                </a>-->
            </div>
        </div>
    </li>
    {{/backlogs}}

</script>{% endverbatim %}

{% verbatim %}<script type="text/html" id="column_list_tpl">
    {{#columns}}
        {{#if_eq name 'Closed' }}

        {{^}}
            <div class="board is-draggable">
                <div class="board-inner">
                    <header class="board-header has-border">
                        <h3 class="board-title js-board-handle">
                            <span class="board-title-text color-label">{{name}}</span>
                            {{#if count }}
                                <div class="board-count-badge">
                                    <span class="issue-count-badge-count">{{count}}</span>
                                </div>
                            {{/if}}
                        </h3>
                    </header>
                    <div class="board-list-component">
                        <ul  id="ul_{{id}}" data='{{data}}' class="board-list">
                            {{#issues}}
                            <li data-issue_id="{{id}}"  data-from-backlog="false" data-from_closed="false"  class="card is-disabled board-item">
                                <div>
                                    <div class="card-header">
                                        <h4 class="card-title">
                                            {{issue_type_html issue_type }}
                                            <a href="/issue/detail/index/{{id}}" target="_blank" title="#" class="js-no-trigger">
                                                <span class="card-number">#{{id}}</span>
                                                {{summary}}
                                            </a>
                                        </h4>
                                        <div class="card-assignee">{{user_html assignee}}</div>
                                    </div>
                                    <div class="card-footer">
                                        {{priority_html priority}}
                                        {{status_html status}}
                                        {{resolve_html resolve}}
                                        <!--<a href="#modal-edit-issue" class="js-board-item-edit board-item-edit" data-issue_id="{{id}}">
                                            <i class="fa fa-pencil"></i>
                                        </a>-->
                                    </div>
                                </div>
                            </li>
                            {{/issues}}
                        </ul>
                    </div>
                </div>
            </div>
        {{/if_eq}}
    {{/columns}}
</script>{% endverbatim %}

{% verbatim %}<script type="text/html" id="closed_list_tpl">
    {{#columns}}
        {{#if_eq name 'Closed' }}
    <div class="board is-expandable close">
        <div class="board-inner">
            <header class="board-header">
                <h3 class="board-title js-board-handle">
                    <span class="board-title-text">{{name}}</span>
                    {{#if count }}
                    <div class="board-count-badge">
                        <span class="issue-count-badge-count">{{count}}</span>
                    </div>
                    {{/if}}
                </h3>
            </header>
            <div class="board-list-component">
                <ul  id="ul_{{id}}" data='closed'  class="board-list">

                    {{#issues}}
                    <li  data-issue_id="{{id}}" data-from_closed="true" data-from_backlog="false"  class="card is-disabled board-item">
                        <div>
                            <div class="card-header">
                                <h4 class="card-title">
                                    {{issue_type_html issue_type }}
                                    <a href="/issue/detail/index/{{id}}" target="_blank" title="#" class="js-no-trigger">
                                        <span class="card-number">#{{id}}</span>
                                        {{summary}}
                                    </a>
                                </h4>
                                <div class="card-assignee">{{user_html assignee}}</div>
                            </div>
                            <div class="card-footer">
                                {{priority_html priority}}
                                {{status_html status}}
                                {{resolve_html resolve}}
                                <!--<a href="#modal-edit-issue" class="js-board-item-edit board-item-edit" data-issue_id="{{id}}">
                                    <i class="fa fa-pencil"></i>
                                </a>-->
                            </div>
                        </div>
                    </li>
                    {{/issues}}

                </ul>
            </div>
        </div>
    </div>
        {{/if_eq}}
    {{/columns}}
</script>

<script type="text/html" id="wrap_field">
    <div class=" form-group">
        <div class="col-sm-1"></div>
        <div class="col-sm-2">{{display_name}}:{{required_html}}</div>
        <div class="col-sm-8">{field_html}</div>
        <div class="col-sm-1"></div>
    </div>
</script>

<script type="text/html" id="nav_tab_li_tpl">
    <li role="presentation" class="active">
        <a id="a_{{id}}" href="#{{id}}" role="tab" data-toggle="tab">
            <span id="span_{{id}}">{{title}}&nbsp;</span>
        </a>
    </li>
</script>

<script type="text/html" id="content_tab_tpl">
    <div role="tabpanel" class="tab-pane " id="{{id}}">
        <div class="dd-list" id="{{type}}_ui_config-{{id}}" style="min-height: 200px">

        </div>
    </div>
</script>{% endverbatim %}

<script src="/dev/lib/sortable/Sortable.js"></script>
<script src="/dev/js/handlebars.helper.js?v=<?= _version ?>"></script>
<script type="text/javascript">

    var _simplemde = {};

    var _issueConfig = {
        "priority":<?= priority|json_encode()|raw ?>,
        "issue_types":<?= issue_types|json_encode()|raw ?>,
        "issue_status":<?= issue_status|json_encode()|raw ?>,
        "issue_resolve":<?= issue_resolve|json_encode()|raw ?>,
        "issue_module":<?= project_modules|json_encode()|raw ?>,
        "issue_version":<?= project_versions|json_encode()|raw ?>,
        "issue_labels":<?= project_labels|json_encode()|raw ?>,
        "users":<?= users|json_encode()|raw ?>,
        "project_users":<?= project_users|json_encode()|raw ?>,
        "project_sprints":<?= sprints|json_encode()|raw ?>,
        "projects":<?= projects|json_encode()|raw ?>
    };
    var _issue_id = null;
    var _cur_project_id = '<?= project_id ?>';
    var _active_sprint_id = '<?= active_sprint_id ?>';
    var $IssueMain = null;
    var _description_templates = <?= description_templates|json_encode()|raw ?>;
    var _default_issue_type_id = '<?=project.default_issue_type_id?>';

    var _perm_kanban = <?= perm_kanban ? 1:0 ?>;

    var $board = null;
    var $board_setting = null;
    var _current_columns = [];
    var _board_default_id = <?=board_default_id?>;
    $(function () {

        var options = {}
        window.$board = new BoardColumn(options);
        window.$board_setting = new BoardSetting(options);
        // 聚焦模式切换
        $('#toggle_focus_mode').bind('click', function () {
            $('.main-sidebar').toggleClass('hidden');
            $('.with-horizontal-nav').toggleClass('hidden');
            $('.layout-nav').toggleClass('hidden');
        });
        $('#btn-setting_board').bind('click', function () {
            $('#board-header-title').html('看板管理');
            $('#modal-board_setting').modal('show');
            $('#board_add_form').hide();
            $('#board_table').show();
            $('#action-board_form').hide();
            $('#action-board_list').show();
            window.$board_setting.fetchBoards();
        });
        // 返回看板列表时
        $('#btn-back_board_list').bind('click', function () {
            $('#board-header-title').html('看板管理');
            $('#board_add_form').hide();
            $('#board_table').show();
            $('#action-board_form').hide();
            $('#action-board_list').show();
            window.$board_setting.fetchBoards();
        });
        // 点击创建按钮时
        $('#btn-show_add_board').bind('click', function () {
            $('#board_add_form').show();
            $('#action-board_form').show();
            $('#board_table').hide();
            $('#action-board_list').hide();
            window.$board_setting.showCreateBoardById('');
        });

        window.$board_setting.initBoardFormSprint(window._issueConfig.project_sprints,[]);
        window.$board_setting.initBoardFormModule(window._issueConfig.issue_module,[]);
        window.$board_setting.initBoardFormIssueType(window._issueConfig.issue_types,[]);

        $("#range_type").bind("change", function () {
            console.log($(this).val())
            let range_value = $(this).val();
            $('#range_container div').addClass('hide');
            $('#range-'+range_value).removeClass(('hide'));
        });
        window.$board.fetchBoardById(_board_default_id);

        //$('.selectpicker').selectpicker();
        $("#boards_select").change(function () {
            console.log($(this).val());
            //$('.selectpicker').selectpicker('refresh');
            window.$board.fetchBoardById($(this).val());
        });

        $("#btn-create-issue").bind("click", function () {
            if (_cur_project_id != '') {
                console.log(_issueConfig.issue_types);
                var issue_types = [];
                for (key in _issueConfig.issue_types) {
                    issue_types.push(_issueConfig.issue_types[key]);
                }
                IssueMain.prototype.initCreateIssueType(issue_types, true);
            }
        });

         $(".tokens-container").on("click", ".selectable-close", function () {
            $(this).parents(".js-visual-token").remove()
        })

        let dom_board_setting_line = $(".board-setting-line");
        dom_board_setting_line.on("click",".js-board-item-title-edit-btn", function(){
            var caption = $(this).closest(".board-setting-line-item").find(".board-item-caption")
            caption.find(".js-board-item-title-input").show()
            caption.find(".js-board-item-title").hide()
        })

        dom_board_setting_line.on("keyup",".js-board-item-title-input", function(){
            if(event.keyCode==13){
                var caption = $(this).closest(".board-setting-line-item").find(".board-item-caption")
                var input = caption.find(".js-board-item-title-input")
                var text = caption.find(".js-board-item-title")
                text.html(input.find(".board-item-title-input").val()).show()
                input.hide()
            }
        })

        dom_board_setting_line.on("blur", ".js-board-item-title-input", function(){
            var caption = $(this).closest(".board-setting-line-item").find(".board-item-caption")
            var input = caption.find(".js-board-item-title-input")
            var text = caption.find(".js-board-item-title")
            text.html(input.find(".board-item-title-input").val()).show()
            input.hide()
        })

        dom_board_setting_line.on("mouseover", ".board-setting-line-item", function(){
            $(this).find(".board-create-line-btn").show()
        }).on("mouseout", ".board-setting-line-item", function(){
            $(this).find(".board-create-line-btn").hide()
        });

        dom_board_setting_line.on("click", ".js-board-item-title-close-btn", function(){
            $(this).closest(".board-setting-line-item").remove()
        });

        dom_board_setting_line.on("click",".board-create-line-btn", function() {
            window.$board_setting.addSwim($(this));
        });


        $('#btn-board_save').bind('click', function () {
            window.$board_setting.saveSetting();
        });


        $(".board-setting-line-active, .board-setting-line-item")
            .on('dragenter', function(event){
                event.preventDefault();  
                $(this).addClass("board-setting-line-item-out-line");
                console.log('enter')
            })
            .on('dragover', function(event){
                event.preventDefault();
                $(this).addClass("board-setting-line-item-out-line");
            })
            .on('drop', function(event){
                event.preventDefault();  
                id = $(this).data('id');
                $(this).removeClass("board-setting-line-item-out-line");
                console.log('drop')
            })
            .on('dragleave', function(event){
                event.preventDefault(); 
                console.log('dragleave')
                $(this).removeClass("board-setting-line-item-out-line");
            })
            .on('mouseleave', function(event){
                $(this).removeClass("board-setting-line-item-out-line");
            })

        var items = document.getElementsByClassName('board-setting-line-active');
        [].forEach.call(items, function (el){
            Sortable.create(el, {
                group: 'item',
                animation: 150,
                ghostClass: 'board-setting-line-item-out-line',
                onEnd: function(evt){
                    //console.log('end', evt.item);
                    //console.log("form data:",$('#form-board_setting2').serialize());

                }
            })
        })

        $("#modal-create-issue").on('show.bs.modal', function (e) {
            keyMaster.addKeys([
                {
                    key: ['command+enter', 'ctrl+enter'],
                    'trigger-element': '#modal-create-issue .btn-save',
                    trigger: 'click'
                },
                {
                    key: 'esc',
                    'trigger-element': '#modal-create-issue .close',
                    trigger: 'click'
                }
            ])
        })

    });
    var _curFineAttachmentUploader = null;
    var _curIssueId = null;
    var _curTmpIssueId = null;
    var _curQrToken = null;
    var mobileUploadInterval = null;

</script>


</body>
</html>
