Skip to content

Commit

Permalink
Fix cards
Browse files Browse the repository at this point in the history
  • Loading branch information
occupant committed May 30, 2024
1 parent d0a2fe6 commit 6e4d3ed
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 91 deletions.
2 changes: 1 addition & 1 deletion templates/content/node--card-image.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
{% endif %}
{% endblock %}
{% block content %}
<p class="mt-0">{{ summary }}</p>
<p class="mt-2">{{ summary }}</p>
{% endblock %}
{% endembed %}

2 changes: 1 addition & 1 deletion templates/content/node--card-vertical.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
{% endif %}
{% endblock %}
{% block content %}
<p class="mt-0">{{ summary }}</p>
<p class="mt-2">{{ summary }}</p>
{% endblock %}
{% block actions %}
<p>
Expand Down
69 changes: 2 additions & 67 deletions templates/content/node--homepage--featured-content.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -65,82 +65,17 @@
* in different view modes.
*/
#}
{% set container_attributes = create_attribute() %}
{% set caption_attributes = create_attribute() %}
{% set title_attributes = create_attribute() %}
{% set link_attributes = create_attribute() %}
{%
set classes = [
view_mode ? 'node--view-mode-' ~ view_mode|clean_class,
'relative',
'img-cover',
]
%}
{%
set container_classes = [
'container',
'absolute',
'inset-0',
'z-40',
'flex',
'flex-col',
'justify-center',
'px-5',
'mx-auto',
'text-white',
'md--px-4',
]
%}
{%
set caption_classes = [
'p-16',
'max-w-[640px]',
'xl--max-w-[768px]',
]
%}
{%
set title_classes = [
'mt-0',
'text-white',
'heading-responsive',
]
%}
{%
set link_classes = [
'sm--text-lg',
'xl--text-4xl',
'unit-button',
'link-expand',
]
%}

{% if node.field_show_gradient_on_image.value %}
{% set gradient = 'has-gradient--after' %}
{% endif %}

{{ attach_library('kraken/scroll-to-content') }}
<div{{ attributes.addClass(classes, gradient) }}>
<div{{ attributes.addClass(classes) }}>
{% block content %}
{% if not (node.field_home_feature_image.isEmpty == true) and content.field_home_feature_image is defined %}
{{ content.field_home_feature_image['0'] }}
{% endif %}
<div{{ container_attributes.addClass(container_classes) }}>
<div{{ caption_attributes.addClass(caption_classes) }}>
<div{{ title_attributes.addClass(title_classes) }}>
{{ content.field_feature_text.0 }}
</div>
{% if not (node.field_feature_link.isEmpty == true) and content.field_feature_link is defined %}
<p>
<a{{ link_attributes.addClass(link_classes) }} href="{{ content.field_feature_link[0]['#url'] }}">{{ content.field_feature_link[0]['#title'] }}</a>
</p>
{% endif %}
</div>
<button class="absolute bottom-0 block w-full text-center left-o" id="js-scroll-to-unit-content">
<svg class="inline-block w-16 h-16 text-white rotate-90 xl--w-20 xl--h-20 stroke-[6]" role="presentation">
<use xlink:href="#icon-caret"></use>
</svg>
<span class="sr-only">Go to main content</span>
</button>
</div>
{{ content }}
{% endblock %}
</div>
21 changes: 1 addition & 20 deletions templates/content/node--ubc-profile--full.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -156,26 +156,7 @@
{% if not node.isPublished() %}
<div class="unpublished">Unpublished</div>
{% endif %}
{{ content|without(
'field_profile_accreditation',
'field_profile_affiliated',
'field_profile_category',
'field_profile_department_unit',
'field_profile_email',
'field_profile_faculty',
'field_profile_google_scholar',
'field_profile_image',
'field_profile_job_title',
'field_profile_name_prefix',
'field_profile_name_suffix',
'field_profile_office',
'field_profile_phone',
'field_profile_pronouns',
'field_profile_preferred_website',
'field_profile_research_area',
'field_profile_role',
'field_profile_tags',
'links') }}
{{ content|without('field_profile_accreditation', 'field_profile_affiliated', 'field_profile_category', 'field_profile_department_unit', 'field_profile_email', 'field_profile_faculty', 'field_profile_google_scholar', 'field_profile_image', 'field_profile_job_title', 'field_profile_name_prefix', 'field_profile_name_suffix', 'field_profile_office', 'field_profile_phone', 'field_profile_preferred_pronouns', 'field_profile_preferred_website', 'field_profile_research_area', 'field_profile_role', 'field_profile_tags', 'links') }}
</div>
{% if not (node.field_profile_tags.isEmpty == true) and content.field_profile_tags is defined %}
<hr class="mt-8 styled-hr">
Expand Down
2 changes: 1 addition & 1 deletion templates/paragraphs/paragraph--card-horizontal.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
{% endblock %}
{% block content %}
{% if not (paragraph.field_paragraph_card_text.isEmpty == true) and content.field_paragraph_card_text is defined %}
<p class="mt-0">{{ paragraph.field_paragraph_card_text.value }}</p>
<p class="mt-2">{{ paragraph.field_paragraph_card_text.value }}</p>
{% endif %}
{% endblock %}
{% block actions %}
Expand Down
2 changes: 1 addition & 1 deletion templates/paragraphs/paragraph--card-vertical.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
{% endblock %}
{% block content %}
{% if not (paragraph.field_paragraph_card_text.isEmpty == true) and content.field_paragraph_card_text is defined %}
<p class="mt-0">{{ paragraph.field_paragraph_card_text.value }}</p>
<p class="mt-2">{{ paragraph.field_paragraph_card_text.value }}</p>
{% endif %}
{% endblock %}
{% block actions %}
Expand Down

0 comments on commit 6e4d3ed

Please sign in to comment.