mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-10-31 03:09:06 -04:00
* Add comment support for plantings - Add polymorphic comments association, subject, and author methods to Planting. - Add comments_count column migration for Planting counter cache. - Update CommentsController and comments view templates to support Planting. - Render comments list and form on Planting show view. - Add specs for Planting comments in models, controllers, and requests. Co-authored-by: CloCkWeRX <365751+CloCkWeRX@users.noreply.github.com> * put 4.0.7 back * Opt comments on posts into record-page styling temporarily * Drop hr * Flatten comments * Update schema --------- Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com> Co-authored-by: Brenda Wallace <brenda@wallace.net.nz>
24 lines
1.0 KiB
Plaintext
24 lines
1.0 KiB
Plaintext
= content_for :title, "New comment"
|
|
- if @commentable.is_a?(Post)
|
|
%section.blog-post
|
|
.card.post{ id: "post-#{@commentable.id}" }
|
|
.card-header
|
|
%h2.display-3= @commentable.subject
|
|
.card-body= render "posts/single", post: @commentable || @comment.commentable, subject: true
|
|
- elsif @commentable.is_a?(Photo)
|
|
%section.blog-post
|
|
.card.photo{ id: "photo-#{@commentable.id}" }
|
|
.card-header
|
|
%h2.display-3= @commentable.subject
|
|
.card-body= render "photos/card", photo: @commentable || @comment.commentable, subject: true
|
|
- elsif @commentable.is_a?(Planting)
|
|
%section.blog-post
|
|
.card.planting{ id: "planting-#{@commentable.id}" }
|
|
.card-header
|
|
%h2.display-3= @commentable.subject
|
|
.card-body= render "plantings/card", planting: @commentable || @comment.commentable
|
|
|
|
= render partial: "comments/comments", locals: { commentable: @commentable || @comment.commentable }
|
|
|
|
= render 'form', locals: { comment: @comment, commentable: @commentable || @comment.commentable }
|