diff --git a/app/helpers/comments_helper.rb b/app/helpers/comments_helper.rb index b72a465d8..e6c7f5df9 100644 --- a/app/helpers/comments_helper.rb +++ b/app/helpers/comments_helper.rb @@ -3,4 +3,12 @@ module CommentsHelper tag.div id: dom_id(comment), class: "comment flex align-start full-width", data: { creator_id: comment.creator_id, created_by_current_user_target: "creation" }, & end + + def new_comment_placeholder(bubble) + if bubble.creator == Current.user && bubble.messages.comments.empty? + "Add some notes…" + else + "Type your comment…" + end + end end diff --git a/app/views/comments/_new.html.erb b/app/views/comments/_new.html.erb index 5c186babc..0f7c95003 100644 --- a/app/views/comments/_new.html.erb +++ b/app/views/comments/_new.html.erb @@ -7,14 +7,12 @@
<%= form_with model: Comment.new, url: bucket_bubble_comments_path(bubble.bucket, bubble), class: "flex flex-column gap full-width", data: { controller: "form", action: "keydown.meta+enter->form#submit" } do |form| %> - <%= form.text_area :body, class: "input", required: true, rows: 4, - placeholder: (bubble.messages.comments.empty? && bubble.creator == Current.user) ? "Add some notes…" : "Type your comment…" %> - - <%= form.button class: "btn btn--reversed center" do %> - <%= image_tag "check.svg", aria: { hidden: "true" }, size: 24 %> - Save + <%= form.text_area :body, class: "input", required: true, rows: 4, placeholder: new_comment_placeholder(bubble) %> + <%= form.button class: "btn btn--reversed center" do %> + <%= image_tag "check.svg", aria: { hidden: "true" }, size: 24 %> + Save + <% end %> <% end %> - <% end %>