TicketDescriptionTemplates版本 4版本 5 间的差异


忽略:
时间戳:
2020-02-27T19:27:03+08:00 (5年 前)
作者:
huxy
评论:

--

图例:

未修改
增加
删除
修改
  • TicketDescriptionTemplates

    v4 v5  
    1515<!-- html template -->
    1616<style type="text/css">
    17     #panel textarea {
    18         margin: 2px;
     17    tr.panel-row textarea {
    1918        height: 85px;
    20     }
    21     #panel th {
    22         width: 100px;
    23         text-align: right;
    24         vertical-align: top;
    25         padding: 0.4em;
     19        padding-right: 0.4em;
    2620    }
    2721    .required-field-label {
    2822        color: red;
    2923        font-size: 0.6em;
     24    }
     25    input.date-picker {
     26        width: 100px;
     27    }
     28    #propertyform table.trac-properties {
     29        table-layout: unset;
     30    }
     31    #properties table.trac-properties > tbody > tr > th.col2 {
     32        border-left: 0px;
     33    }
     34    #properties table.trac-properties > tbody > tr > td.col1 {
     35        width: 28.2%;
     36    }
     37    #properties table.trac-properties > tbody > tr > td.col2 {
     38        width: 15%;
     39    }
     40    #propertyform table select {
     41        width: 99%;
     42    }
     43    #content.ticket {
     44        width: 68em;
     45    }
     46    #properties table.trac-properties > tbody > tr > th, #properties table.trac-properties > colgroup > col.th {
     47        width: 15.2%;
     48    }
     49    #propertyform table.trac-properties td input[type="text"], #propertyform table.trac-properties td textarea {
     50        width: 99%;
     51    }
     52    #properties table.trac-properties > tbody > tr > td, #properties table.trac-properties > colgroup > col.td {
     53        width: 0%;
    3054    }
    3155</style>
     
    4468
    4569    function createDescriptionPanel() {
    46         let template = '<fieldset id="panel">' + $("#panel").html() + "</fieldset>";
     70        let template = $("#panel tbody").html();
    4771        $("#panel").remove();
    48         let description_element = $("label#field-description-help").parent();
    49         $(description_element).children().css("display", "none");
    50         $(description_element).css("display", "");
    51         $(description_element).prepend(template);
    52         $("table.trac-properties").css("width", "910px");
     72        let description_row = $("label#field-description-help").parent().parent();
     73        description_row.css("display", "none");
     74        description_row.before(template);
     75        $("#field-summary").parent().attr("colspan", "5");
     76        $("#field-reporter").parent().attr("colspan", "5");
     77        $("#properties table th").css("vertical-align", "super");
    5378
    5479        let required_fields = [
     
    97122        if (description_panel != undefined && description_panel != "") {
    98123            let panel_info = JSON.parse(description_panel);
    99             $("#panel table label").each(function(index, element) {
     124            $(".panel-row label").each(function(index, element) {
    100125                let text_element = $(element).parent().next("td").find("input:text")[0];
    101126                if (text_element == undefined) {
     
    143168        let panel_info = [];
    144169        let description = "";
    145         $("#panel tr").each(function(index, element) {
     170        $(".panel-row").each(function(index, element) {
    146171            let labels = $(element).find("th label");
    147172            let row_data = [];
     
    162187                let values = $(element).find("td input:text");
    163188                for (let i = 0; i < labels.length; i++) {
     189                    let label_name = $(labels.get(i)).text();
     190                    label_name = label_name.replace(/\s*\(必填\)/, '');
    164191                    let input_val = $(values.get(i)).val();
    165                     description += "- " + $(labels.get(i)).text() + input_val + "\n";
     192                    description += "- " + label_name + input_val + "\n";
    166193                    panel_info.push(input_val);
    167194                }
     
    172199    }
    173200</script>
    174 <fieldset id="panel">
    175     <table>
    176         <tbody>
    177             <tr title="问题描述">
    178                 <th><label>问题描述 <span class="required-field-label">(必填)</span>:</label></th>
    179                 <td colspan="5"><textarea class="required-field"></textarea></td>
    180             </tr>
    181             <tr title="问题场景">
    182                 <th><label>问题场景 <span class="required-field-label">(必填)</span>:</label></th>
    183                 <td colspan="5"><textarea class="required-field"></textarea></td>
    184             </tr>
    185             <tr title="复现步骤">
    186                 <th><label>复现步骤 <span class="required-field-label">(必填)</span>:</label></th>
    187                 <td colspan="5"><textarea class="required-field"></textarea></td>
    188             </tr>
    189             <tr title="出错日志">
    190                 <th><label>出错日志:</label></th>
    191                 <td colspan="5"><textarea></textarea></td>
    192             </tr>
    193             <tr title="初步定位">
    194                 <th><label>初步定位:</label></th>
    195                 <td colspan="5"><textarea></textarea></td>
    196             </tr>
    197             <tr title="问题处理时间段">
    198                 <th><label>发现日期 <span class="required-field-label">(必填)</span>:</label></th>
    199                 <td><input type="text" id="issue-occur-date" class="date-picker required-field"></td>
    200                 <th style="width: 130px;"><label>期望解决日期 <span class="required-field-label">(必填)</span>:</label></th>
    201                 <td><input type="text" id="issue-resolve-date" class="date-picker required-field"></td>
    202                 <th style="display: none"><label>开发人员预期解决日期:</label></th>
    203                 <td style="display: none"><input type="text" id="developer-resolve-date"></td>
    204             </tr>
    205             <tr title="联系人信息">
    206                 <th style="width: 109px;"><label>沟通联系人:</label></th>
    207                 <td><input type="text"></td>
    208                 <th><label>电话:</label></th>
    209                 <td><input type="text"></td>
    210                 <th style="width: 35px"><label>邮箱:</label></th>
    211                 <td><input type="text" style="width: 160px"></td>
    212             </tr>
    213         </tbody>
    214     </table>
    215 </fieldset>
     201<table id="panel">
     202    <tbody>
     203        <tr title="问题描述" class="panel-row">
     204            <th><label>问题描述 <span class="required-field-label">(必填)</span>:</label></th>
     205            <td colspan="5"><textarea class="required-field"></textarea></td>
     206        </tr>
     207        <tr title="问题场景" class="panel-row">
     208            <th><label>问题场景 <span class="required-field-label">(必填)</span>:</label></th>
     209            <td colspan="5"><textarea class="required-field"></textarea></td>
     210        </tr>
     211        <tr title="复现步骤" class="panel-row">
     212            <th><label>复现步骤 <span class="required-field-label">(必填)</span>:</label></th>
     213            <td colspan="5"><textarea class="required-field"></textarea></td>
     214        </tr>
     215        <tr title="出错日志" class="panel-row">
     216            <th><label>出错日志:</label></th>
     217            <td colspan="5"><textarea></textarea></td>
     218        </tr>
     219        <tr title="初步定位" class="panel-row">
     220            <th><label>初步定位:</label></th>
     221            <td colspan="5"><textarea></textarea></td>
     222        </tr>
     223        <tr title="问题处理时间段" class="panel-row">
     224            <th><label>发现日期 <span class="required-field-label">(必填)</span>:</label></th>
     225            <td><input type="text" id="issue-occur-date" class="date-picker required-field"></td>
     226            <th><label>期望解决日期 <span class="required-field-label">(必填)</span>:</label></th>
     227            <td><input type="text" id="issue-resolve-date" class="date-picker required-field"></td>
     228            <th style="display: none"><label>开发人员预期解决日期:</label></th>
     229            <td style="display: none"><input type="text" id="developer-resolve-date"></td>
     230        </tr>
     231        <tr title="联系人信息" class="panel-row">
     232            <th><label>沟通联系人:</label></th>
     233            <td><input type="text"></td>
     234            <th><label>电话:</label></th>
     235            <td><input type="text"></td>
     236            <th style="width: 37px"><label>邮箱:</label></th>
     237            <td><input type="text" style="width: 170px; margin-right: 5px;"></td>
     238        </tr>
     239    </tbody>
     240</table>
    216241}}}
    217242