diff --git a/module/bug/css/create.css b/module/bug/css/create.css index f2d241b1be..f1ea6d96d3 100644 --- a/module/bug/css/create.css +++ b/module/bug/css/create.css @@ -2,10 +2,14 @@ .ke-outline .ke-icon-savetemplate {background-image: url(theme/default/images/kindeditor/save.gif); background-position: center; width: 56px; height: 20px;} /* template box */ -#tplBox .list-group-item {padding: 6px 6px;} -#tplBox .list-group-item:hover {background: #f1f1f1} -#tplBox .list-group-item a {color: #333} .bootbox-prompt .modal-dialog {width: 500px; margin-top: 10%;} #buildBoxActions {padding-left: 15px;} + +#tplBoxWrapper {position: relative; z-index: 10;} +#tplBoxWrapper > .btn-toolbar {position: absolute; right: 5px; top: 2px;} +#tplBoxWrapper .btn {padding: 2px 8px} +#tplBox li {position: relative;} +#tplBox li .btn-delete {position: absolute; right: 0; top: 0; display: block; width: 40px; text-align:center;} +#tplBox li .tpl-name {padding-right: 40px;} diff --git a/module/bug/js/create.js b/module/bug/js/create.js index 97daa8971a..4b16c78933 100644 --- a/module/bug/js/create.js +++ b/module/bug/js/create.js @@ -41,29 +41,46 @@ function setAssignedTo(moduleID, productID) }); } -/* Save template. */ -KindEditor.plugin('savetemplate', function(K) +$(function() { - var self = this, name = 'savetemplate'; - self.plugin.savetemplate = + $('#saveTplBtn').on('click', function() { - click: function(id) + var content = $('#steps').val(); + bootbox.prompt(setTemplateTitle, function(r) { - content = self.html(); - bootbox.prompt(setTemplateTitle, function(r) + if(!r || !content) return; + saveTemplateLink = createLink('bug', 'saveTemplate'); + $.post(saveTemplateLink, {title:r, content:content}, function(data) { - if(!r || !content) return; - saveTemplateLink = createLink('bug', 'saveTemplate'); - $.post(saveTemplateLink, {title:r, content:content}, function(data) - { - $('#tplBox').html(data); - }); + $('#tplBox').html(data); }); - } - }; - self.clickToolbar(name, self.plugin.savetemplate.click); + }); + }); }); +// /* Save template. */ +// KindEditor.plugin('savetemplate', function(K) +// { +// var self = this, name = 'savetemplate'; +// self.plugin.savetemplate = +// { +// click: function(id) +// { +// content = self.html(); +// bootbox.prompt(setTemplateTitle, function(r) +// { +// if(!r || !content) return; +// saveTemplateLink = createLink('bug', 'saveTemplate'); +// $.post(saveTemplateLink, {title:r, content:content}, function(data) +// { +// $('#tplBox').html(data); +// }); +// }); +// } +// }; +// self.clickToolbar(name, self.plugin.savetemplate.click); +// }); + /* Set template. */ function setTemplate(templateID) { diff --git a/module/bug/lang/en.php b/module/bug/lang/en.php index cbcdb5a7e3..78dc6f5ac7 100644 --- a/module/bug/lang/en.php +++ b/module/bug/lang/en.php @@ -160,6 +160,7 @@ $lang->bug->confirmDelete = 'Are you sure to delete this bug?'; $lang->bug->setTemplateTitle = 'Please input the template title:'; $lang->bug->remindTask = 'This bug has been to be a task, update the task:%s or not?'; $lang->bug->skipClose = 'The status of bug:%s are not resolved, so can not close!'; +$lang->bug->applyTemplate = 'Apply template'; /* Templates. */ $lang->bug->tplStep = "
[Steps]
\n"; diff --git a/module/bug/lang/zh-cn.php b/module/bug/lang/zh-cn.php index 13061b5e25..3849b87d5d 100644 --- a/module/bug/lang/zh-cn.php +++ b/module/bug/lang/zh-cn.php @@ -160,6 +160,7 @@ $lang->bug->confirmDelete = '您确认要删除该Bug吗?'; $lang->bug->setTemplateTitle = '请输入bug模板标题(保存之前请先填写bug重现步骤):'; $lang->bug->remindTask = '该Bug已经转化为任务,是否更新任务(编号:%s)状态 ?'; $lang->bug->skipClose = 'Bug %s 不是已解决状态,不能关闭。'; +$lang->bug->applyTemplate = '应用模版'; /* 模板。*/ $lang->bug->tplStep = "[步骤]
\n"; diff --git a/module/bug/view/buildtemplates.html.php b/module/bug/view/buildtemplates.html.php index 7c9f163d54..7ee1cafd06 100644 --- a/module/bug/view/buildtemplates.html.php +++ b/module/bug/view/buildtemplates.html.php @@ -1,13 +1,12 @@ $template) { - echo "| bug->lblProductAndModule;?> | -+ |
-
+
refresh);
}
?>
- | + | ||
|---|---|---|---|---|---|
| bug->project;?> | @@ -73,17 +73,27 @@ js::set('refresh', $lang->refresh);|||||
| bug->steps;?> | -- |
-
|
+
+
+
+
|
- ||
| bug->lblStory;?> | - | ||||
| bug->task;?> | diff --git a/module/common/view/kindeditor.html.php b/module/common/view/kindeditor.html.php index e5805a1777..b59d3d311a 100755 --- a/module/common/view/kindeditor.html.php +++ b/module/common/view/kindeditor.html.php @@ -18,7 +18,7 @@ var editor = ; var bugTools = [ 'formatblock', 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', 'italic','underline', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist', 'insertunorderedlist', '|', -'emoticons', 'image', 'code', 'link', '|', 'removeformat','undo', 'redo', 'fullscreen', 'source', 'savetemplate', 'about']; +'emoticons', 'image', 'code', 'link', '|', 'removeformat','undo', 'redo', 'fullscreen', 'source', 'about']; var simpleTools = [ 'formatblock', 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', 'italic','underline', '|', | ||||