*Finish task #4504.

This commit is contained in:
Yagami
2018-07-10 10:11:50 +08:00
parent 0b0146cfb5
commit 07b21f67e2
5 changed files with 19 additions and 2 deletions
+15
View File
@@ -169,6 +169,15 @@
{
var $todoes = $(obj).closest('.block-todoes');
var $form = $(obj).closest('form');
var $name = $("input[name='name']").val();
if($name == '')
{
$("input[name='name']").addClass('has-error');
$('#nameLabel').remove();
$("input[name='name']").after('<div id="nameLabel" class="text-danger help-text"><?php echo $lang->todo->noName ?></div>');
setTimeout('clearError()', 2000)
return false;
}
$.ajax(
{
type: "POST",
@@ -182,5 +191,11 @@
}
});
}
function clearError()
{
$("input[name='name']").removeClass('has-error');
$('#nameLabel').remove();
}
</script>
</div>
+1
View File
@@ -30,6 +30,7 @@ $lang->todo->import = "Import";
$lang->todo->legendBasic = "Basic Info";
$lang->todo->cycle = "Recurrence";
$lang->todo->cycleConfig = "Set Recurrence";
$lang->todo->noName = "The Name should not be empty.";
$lang->todo->reasonList['story'] = "Transfer Story";
$lang->todo->reasonList['task'] = "Transfer Task";
+1
View File
@@ -30,6 +30,7 @@ $lang->todo->import = "导入";
$lang->todo->legendBasic = "基本信息";
$lang->todo->cycle = "周期";
$lang->todo->cycleConfig = "周期设置";
$lang->todo->noName = "『待办名称』不能为空。";
$lang->todo->reasonList['story'] = "转需求";
$lang->todo->reasonList['task'] = "转任务";
+1 -1
View File
@@ -95,7 +95,7 @@
<tr>
<th><?php echo $lang->todo->name;?></th>
<td colspan='2'>
<div id='nameBox' class='hidden'><?php echo html::input('name', '', "class='form-control' autocomplete='off'");?></div>
<div class='nameBox hidden'><?php echo html::input('name', '', "class='form-control' autocomplete='off'");?></div>
<div class='nameBox required'><?php echo html::input('name', '', "class='form-control' autocomplete='off'");?></div>
</td>
</tr>
+1 -1
View File
File diff suppressed because one or more lines are too long