diff --git a/src/main/resources/appresource.properties b/src/main/resources/appresource.properties index be22fd948..df0490d37 100644 --- a/src/main/resources/appresource.properties +++ b/src/main/resources/appresource.properties @@ -111,6 +111,8 @@ label.draft=Draft label.release=Release label.new=New label.initialize=Initialize +label.move.up=Move Up +label.move.down=Move Down label.public.view= [Public] label.protect.view= [Protection] @@ -796,4 +798,6 @@ knowledge.survey.label.answer.count=Count knowledge.survey.label.answer.date=DateTime knowledge.survey.label.answer.user=User knowledge.survey.msg.survey=Please post first (because you need to assign ID) +knowledge.survey.msg.warning.move=Please do not delete items or move up and down, if there is an answer already. + diff --git a/src/main/resources/appresource_ja.properties b/src/main/resources/appresource_ja.properties index 1b2ff6622..b05c3f1ce 100644 --- a/src/main/resources/appresource_ja.properties +++ b/src/main/resources/appresource_ja.properties @@ -111,6 +111,8 @@ label.draft=下書き label.release=投稿する label.new=新規作成 label.initialize=初期化 +label.move.up=上へ移動 +label.move.down=下へ移動 label.public.view= [公開] label.protect.view= [保護] @@ -796,4 +798,5 @@ knowledge.survey.label.answer.count=回答件数 knowledge.survey.label.answer.date=回答日時 knowledge.survey.label.answer.user=回答者 knowledge.survey.msg.survey=先に投稿してください(IDを採番する必要があるため) +knowledge.survey.msg.warning.move=既にアンケートの回答が登録されている場合は、項目の削除、上下の移動をしないでください。 diff --git a/src/main/webapp/WEB-INF/views/admin/template/include_template_label.jsp b/src/main/webapp/WEB-INF/views/admin/template/include_template_label.jsp index 9987ce735..5ecf2c75e 100644 --- a/src/main/webapp/WEB-INF/views/admin/template/include_template_label.jsp +++ b/src/main/webapp/WEB-INF/views/admin/template/include_template_label.jsp @@ -25,5 +25,9 @@ var LABEL_ADD_CHOICE = '<%= jspUtil.label("knowledge.template.label.choice.add") var LABEL_DELETE_CHOICE = '<%= jspUtil.label("knowledge.template.label.choice.remove") %>'; var LABEL_CHOICE_LABEL = '<%= jspUtil.label("knowledge.template.label.choice.label") %>'; var LABEL_CHOICE_VALUE = '<%= jspUtil.label("knowledge.template.label.choice.value") %>'; + +var LABEL_MOVE_UP = '<%= jspUtil.label("label.move.up") %>'; +var LABEL_MOVE_DOWN = '<%= jspUtil.label("label.move.down") %>'; + diff --git a/src/main/webapp/WEB-INF/views/protect/survey/edit.jsp b/src/main/webapp/WEB-INF/views/protect/survey/edit.jsp index 1cfdb63ab..93f0db4f2 100644 --- a/src/main/webapp/WEB-INF/views/protect/survey/edit.jsp +++ b/src/main/webapp/WEB-INF/views/protect/survey/edit.jsp @@ -34,6 +34,12 @@

<%= jspUtil.label("knowledge.survey.label.edit") %>

+ +
diff --git a/src/main/webapp/js/template-item-edit.js b/src/main/webapp/js/template-item-edit.js index bdafaea44..1e7b89f18 100644 --- a/src/main/webapp/js/template-item-edit.js +++ b/src/main/webapp/js/template-item-edit.js @@ -25,6 +25,20 @@ $(document).ready(function() { var s = '#' + itemId; $(s).remove(); }; + + var moveupItem = function(itemId) { + var s = '#' + itemId; + var e = $(s); + e.prev().insertAfter(e); + + } + var movedownItem = function(itemId) { + var s = '#' + itemId; + var e = $(s); + e.next().insertBefore(e); + + } + /** * 入力項目に対し、選択肢を追加(ラジオやチェックボックスなどの選択項目) * @param itemid 入力項目のID @@ -108,17 +122,23 @@ $(document).ready(function() { addItem += '
'; addItem += '
' + kind + ''; if (document._TEMPLATE.editable) { - addItem += ' '; if (kind === LABEL_RADIO_ITEM || kind === LABEL_CHECKBOX_ITEM) { addItem += ' '; addItem += ''; + addItem += ' '; } + addItem += ' '; + addItem += ' '; + addItem += ' '; } addItem += '
'; addItem += '
'; @@ -143,6 +163,12 @@ $(document).ready(function() { $('#deleteItem_' + itemId).click(function() { deleteItem(itemId); }); + $('#moveupItem_' + itemId).click(function() { + moveupItem(itemId); + }); + $('#movedownItem_' + itemId).click(function() { + movedownItem(itemId); + }); $('#addChoice_' + itemId).click(function() { addChoice(itemId); });