From d601878452a1862aa24af5a89edd7deb8cb7d68e Mon Sep 17 00:00:00 2001 From: Felix Wolff Date: Sat, 28 Mar 2015 18:39:55 +0100 Subject: [PATCH] Show editor for code commenting, and allow commenting as well --- app/assets/javascripts/editor.js | 4 +- .../stylesheets/request-for-comments.css.scss | 4 + app/views/request_for_comments/show.html.erb | 83 ++++++++++++++++++- 3 files changed, 87 insertions(+), 4 deletions(-) create mode 100644 app/assets/stylesheets/request-for-comments.css.scss diff --git a/app/assets/javascripts/editor.js b/app/assets/javascripts/editor.js index 8f744e76..787dff6a 100644 --- a/app/assets/javascripts/editor.js +++ b/app/assets/javascripts/editor.js @@ -344,7 +344,7 @@ $(function() { commentModal.find('#removeAllButton').off('click') commentModal.find('#addCommentButton').on('click', function(e){ - var user_id = element.data('user-id') + var user_id = $(element).data('user-id') var commenttext = commentModal.find('textarea').val() if (commenttext !== "") { @@ -354,7 +354,7 @@ $(function() { }) commentModal.find('#removeAllButton').on('click', function(e){ - var user_id = element.data('user-id') + var user_id = $(element).data('user-id') deleteComment(user_id,file_id,row,editor); commentModal.modal('hide') }) diff --git a/app/assets/stylesheets/request-for-comments.css.scss b/app/assets/stylesheets/request-for-comments.css.scss new file mode 100644 index 00000000..02dab676 --- /dev/null +++ b/app/assets/stylesheets/request-for-comments.css.scss @@ -0,0 +1,4 @@ +#commentitor { + margin-top: 2rem; + height: 600px; +} \ No newline at end of file diff --git a/app/views/request_for_comments/show.html.erb b/app/views/request_for_comments/show.html.erb index 5a785a5e..02b2d7e7 100644 --- a/app/views/request_for_comments/show.html.erb +++ b/app/views/request_for_comments/show.html.erb @@ -5,5 +5,84 @@

-
-
\ No newline at end of file +
+
+

Line

+ +
+
+

Comment

+ +
+ +
+ +
+ <%= CodeOcean::File.find(@request_for_comment.fileid).content %> +
+ + \ No newline at end of file