-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor & Add Comments to create.js.erb; Style Fixes for Question Comments & Toolbar Buttons #9195
Conversation
Code Climate has analyzed commit a29e2c6 and detected 0 issues on this pull request. View more on Code Climate. |
Codecov Report
@@ Coverage Diff @@
## main #9195 +/- ##
=======================================
Coverage ? 82.05%
=======================================
Files ? 100
Lines ? 5939
Branches ? 0
=======================================
Hits ? 4873
Misses ? 1066
Partials ? 0 |
@@ -1,23 +1,43 @@ | |||
// this code runs after a new comment is posted. | |||
// 1. it inserts the new comment into the DOM | |||
// 2. it also creates image upload functionality for the new comment form (see /app/assets/javascripts/editorToolbar.js) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Explanatory comment.
selector: '#dropzone-small-reply-<%= @comment.cid %>', | ||
isButton: true | ||
} | ||
]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reminder that this code is for attaching image upload functionality to fresh comments.
I realized that a fresh comment can either:
- Be a comment NOT responding to another comment (will have both an edit form and a reply form).
- Be in response to another comment (will have ONLY an edit form).
Therefore, if a comment is a response, image upload functionality should only be attached to the edit form (the reply form doesn't exist).
That's the main change I'm making in this PR.
<% comments.includes([:node, :replied_comments]).order("timestamp ASC").each do |comment| %> | ||
<% if comment.reply_to.nil? %> | ||
<%= render :partial => "notes/comment", :locals => {:comment => comment} %> | ||
<div id="legacy-editor-container" class="col-lg-10"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style fix here to shrink the width of question comment container to 75%... That's what it used to be before recent changes I can't track.
The partials for question/show
, wiki/show
, and notes/show
could use some serious clean-up!
Nicely done. And, agree about the cleanup in the views; that code has seen MANY iterations! |
…mments & Toolbar Buttons (publiclab#9195) * stop instantiating fileupload for non-existent elements; add comments * style fixes for toolbar buttons * shorten width of comment container
…mments & Toolbar Buttons (publiclab#9195) * stop instantiating fileupload for non-existent elements; add comments * style fixes for toolbar buttons * shorten width of comment container
…mments & Toolbar Buttons (publiclab#9195) * stop instantiating fileupload for non-existent elements; add comments * style fixes for toolbar buttons * shorten width of comment container
cursor: pointer;
question/show
partial(This issue is part of the larger Comment Editor Overhaul Project with Outreachy. Refer to Planning Issue #9069 for more context)