diff --git a/codepot/src/codepot/views/code_revision.php b/codepot/src/codepot/views/code_revision.php index 3e722c5c..a56c1187 100644 --- a/codepot/src/codepot/views/code_revision.php +++ b/codepot/src/codepot/views/code_revision.php @@ -52,7 +52,7 @@ $(function() { $(function() { - $("#code_revision_new_comment_div").dialog ( + $("#code_revision_new_review_comment_div").dialog ( { title: '=$this->lang->line('Comment')?>', width: 'auto', @@ -75,7 +75,7 @@ $(function() { $("#code_revision_new_review_comment_button").button().click ( function () { - $("#code_revision_new_comment_div").dialog('open'); + $("#code_revision_new_review_comment_div").dialog('open'); return false; } ); @@ -88,10 +88,37 @@ $(function() { $rc = $reviews[$i]; if ($login['id'] == $rc->updatedby) { + $edit_title = $this->lang->line('Comment') . ' ' . ($i + 1); + $label_ok = $this->lang->line('OK'); + $label_cancel = $this->lang->line('Cancel'); print (" + + $('#code_revision_edit_review_comment_div_{$i}').dialog ( + { + title: '{$edit_title}', + width: 'auto', + height: 'auto', + resizable: false, + autoOpen: false, + modal: true, + buttons: { + '{$label_ok}': function () { + // dynamically add a comment number to edit + var hidden_comment_no = $('').attr('type', 'hidden').attr('name', 'edit_review_comment_no').val('{$i}'); + $('#code_revision_edit_review_comment_form_{$i}').append(hidden_comment_no).submit (); + $(this).dialog('close'); + }, + '{$label_cancel}': function () { + $(this).dialog('close'); + } + }, + close: function() { } + } + ); + $('#code_revision_edit_review_comment_button_{$i}').button().click ( function () { - alert ('not implemented {$i}'); + $('#code_revision_edit_review_comment_div_{$i}').dialog('open'); return false; } ) @@ -353,7 +380,6 @@ $history = $file['history']; print "