E
E
EarthFM2016-02-02 21:18:46
BEM
EarthFM, 2016-02-02 21:18:46

How to do it right here?

Hello, help me understand how to do it right (use blocks for repetition)
I have a feedback block (1), and I need a block that will be on another page (for example message (2)), which is one in one "review" block.
(one)

.review.clearfix
            .avatar.avatar_reviews
                = image_tag 'avatar.jpg', :class => 'avatar__img-min'
            .review-describe
                p.review-describe__name Иван Петров
                p.review-describe__date сен. 11. 2016
                p.review-describe__text texttexttexttext...

(2)
.message.clearfix
            .avatar.avatar_message
                = image_tag 'avatar.jpg', :class => 'avatar__img-min'
            .message-describe
                p.message-describe__name Иван Петров
                p.message-describe__date сен. 11. 2016
                p.message-describe__text texttexttexttext.

In order not to re-write classes for the message block, I had to come up with a common block for them?
Or can you do a mix?(3)
(3)
.message.clearfix
            .avatar.avatar_message
                = image_tag 'avatar.jpg', :class => 'avatar__img-min'
            .message-describe.review-describe
                p.message-describe__name.review-describe__name  Иван Петров
                p.message-describe__date.review-describe__date  сен 11. 2016
                p.message-describe__text.review-describe__text   texttexttexttext

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey delphinpro, 2016-02-02
@EarthFM

If the blocks are the same, and differ only in content, then this is one block with different content. I think so.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question