-
Notifications
You must be signed in to change notification settings - Fork 12
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
OEL-1159: Align search variant with default card pattern #178
Conversation
a08173e
to
ab81793
Compare
ab81793
to
0034c57
Compare
@@ -10,47 +10,81 @@ card: | |||
description: 'Card with special behaviour for print search results items.' | |||
fields: | |||
orientation: | |||
# Full type: `'horizontal'|'vertical'`. |
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.
We don't have any comment. Please remove them.
preview: 'Title card' | ||
url: |
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.
I'm not agree with the url field. We already have the title field. I don't feel comfortable with two fields for the same when we are trying to keep the patterns as simple as possible.
Also If anybody needs a link then they maybe want to customise, a custom class, title, etc. And with url you loose this possibility you have with the title field. Maybe if instead url it was a link pattern and then print the link in the template, it would have more sense. But IMHO with title field is enough for cover this.
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.
I am ok to see it removed.
The motivation was that calling code should not have to set the 'underline-hover' class on the link.
But ok for me to remove.
* | ||
* Differences to main variant: | ||
* - Always use horizontal layout, with specific classes. | ||
* - Add extra classes on card body (right column), to prevent padding. | ||
* This should probably be handled by BCL if horizontal is used. | ||
* - Use text color dark. | ||
* - Set different margin-bottom for text element. | ||
* - Set special parameters on the image. | ||
* - Add special wrapper attributes. | ||
* - Ignore 'subtitle', 'date', 'card_header', 'card_footer'. |
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.
Really need this? Please remove.
type: text | ||
label: 'Card footer' | ||
description: 'Card footer content.' | ||
preview: 'Footer of card' | ||
badges: | ||
# Full type: `list<array{label: string|render|markup, ..}>`. | ||
# See 'bcl-badge.html.twig'. | ||
type: array | ||
label: 'Badges' | ||
description: 'List of badges for the card.' |
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.
The badges label are primary and secondary but has the same aspect, so I would change the label or add the badge style to the badges.
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.
I am confused by the wording of this comment.
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.
I think this is good now.
'subtitle': subtitle, | ||
'text': text, | ||
'tag': 'div', | ||
} : {}, | ||
'content': content, | ||
'image': image, | ||
'card_header': header, | ||
'card_footer': footer, | ||
'badges': badges, |
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.
default badges has set the outline to true.
'date': (date is not empty) ? { | ||
'day': date|date('d'), | ||
'month': date|date('M'), | ||
'year': date|date('Y'), | ||
'date_time': date|date('Y-m-d'), | ||
} : {}, |
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.
We can remove date until full date ticket is prepared.
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.
I notice that date is not even declared in the pattern definition.
I kept it there because it existed in the current version of the template.
But I agree to remove it.
@@ -35,6 +35,15 @@ card: | |||
preview: | |||
path: 'https://placeimg.com/1000/500/people' | |||
alt: 'Alternative text for card image' | |||
meta: | |||
# Full type: `list<text|render|markup>`. |
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.
Please remove comments
e892485
to
97dfdfd
Compare
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.
Some minor remarks.
@@ -5,58 +5,54 @@ | |||
*/ | |||
#} | |||
{% spaceless %} |
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.
Let's take the chance to replace these with {% apply spaceless %}
as this one used above is deprecated already.
{% endfor %} | ||
{% endif %} | ||
{% include '@oe-bcl/card' with { | ||
horizontal: 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.
In the other template we quote the keys, in here we don't. We should stick to one, I believe we went for always quote.
e873d97
to
63fea3a
Compare
This will break whitelabel and showcase. |
63fea3a
to
dd75b38
Compare
c4db4bb
to
453ff3c
Compare
Also add trailing comma after last array value.
Any <p> tag should be sent with the content of the 'text' parameter.
This reverts commit 0034c57.
This reverts commit 8c07b90.
…twig. This reverts commit e0d892a.
The parameter was not declared in the pattern definition. A new date parameter might be introduced in the future.
Changes: - Make 'rounded_pill: true, outline: true' the default for all badges in cards. This is the most common way badges are shown in cards. - Preserve custom settings when merging defaults. - Expose the full signature of bcl-badge in the badge parameter. (this was previously not the case for search variant) - Have 3 badges in the preview, to show different options.
453ff3c
to
4870149
Compare
content: content | ||
} only %} | ||
{% endspaceless %} | ||
<div>{{ content }}</div> |
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.
is the compulsory div intentional ?
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.
see below.
{% endfor %} | ||
</div> | ||
{% endif %} | ||
<div>{{ content }}</div> |
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.
is the compulsory div intentional ?
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.
I think @brummbar mentioned we should wrap this in a div. I don't have a strong opinion on it myself.
In earlier versions of the theme, the idea was that "content" is like a general-purpose variable where developers can put additional stuff that is not already handled with other variables. so it would support more than one element, and these elements would already have their own wrappers.
This said: If we do keep the div, we need to check first that the content is not empty.
So we can either drop the div, or check emptiness first.
'text': (text is not empty) ? { | ||
'content': text, | ||
'classes': 'mb-2-5', | ||
'tag': 'div', |
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.
why div ? it was p before, I see p in netlify..
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.
We want to support formatted text which may already contain <p>
tags.
Then the <div>
is just an additional wrapper.
{% apply spaceless %} | ||
{% set content %} | ||
{% if meta is not empty %} | ||
{# Use negative margin to compensate for me-3 on each item. #} |
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.
lets remember to revisit this with BCL 0.21
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.
ok but not now, right?
It turns out that 'content is empty' is not sufficient, because e.g. ['#markup' => ''] won't be determined as empty. Also, 'content|render' does not behave as desired, if content is already a Markup object.
9f84037
to
1dc402a
Compare
Jira issue(s):