Skip to content
Snippets Groups Projects
Commit 7126d80e authored by Martin Leblanc's avatar Martin Leblanc
Browse files

initial details summary twig for contact

parent 701cd64d
No related branches found
No related tags found
1 merge request!66ISTWCMS-4704: adding date component with ability to handle multiple dates and...
...@@ -3807,6 +3807,12 @@ button { ...@@ -3807,6 +3807,12 @@ button {
.uw-footer-address .uw-footer-phone a:hover { .uw-footer-address .uw-footer-phone a:hover {
text-decoration: underline; } text-decoration: underline; }
details {
background: #b9f1c5; }
details[open] {
background: #eeaab0; }
.uw-content--grid-list__layout { .uw-content--grid-list__layout {
display: flex; display: flex;
-webkit-flex-flow: row wrap; -webkit-flex-flow: row wrap;
......
<div class="uw-contact"> {% embed "@components/details/details.twig" %}
<details class="uw-contact__details">
<summary class="uw-contact__summary"> {% block details_summary %}
<h2 class="uw-contact__h2"> {% if contact.title %}
{% if contact.link_profile %} <h2 class="uw-contact__h2">
<a href="{{ contact.link_profile }}" class="uw-contact__link-profile"> {{ contact.title }}
{% endif %} </h2>
{{ contact.title }} {% endif %}
{% if contact.link_profile %}
</a>
{% endif %}
</h2>
{% if contact.position %} {% if contact.position %}
<div class="uw-contact__position"> <div class="uw-contact__position">
{{ contact.position }} {{ contact.position }}
</div> </div>
{% endif %} {% endif %}
</summary> {% endblock %}
{% block details_content %}
<div class="uw-contact__info"> <div class="uw-contact__info">
{% if contact.image %}
<div class="uw-contact__image">
<img src="{{ contact.image }} alt="{{ contact.title }}" />
</div>
{% endif %}
{% if contact.email or contact.phone %} {% if contact.email or contact.phone %}
<div class="uw-contact__phone-email"> <div class="uw-contact__phone-email">
{% if contact.email %} {% if contact.email %}
...@@ -31,6 +34,27 @@ ...@@ -31,6 +34,27 @@
{% endif %} {% endif %}
</div> </div>
{% endif %} {% endif %}
{% if contact.additional_info %}
<div class="uw-contact__additional-info">
{{ contact.additional_info }}
</div>
{% endif %}
{% if contact.contact_for %}
<div class="uw-contact__contact-for">
{{ contact.contact_for }}
</div>
{% endif %}
{% if contact.groups %}
<div class="uw-contact__groups">
{% for group in contact.groups %}
{% if loop.index0 > 0 %}
, {{ group.title }}
{% else %}
{{ group.title }}
{% endif %}
{% endfor %}
</div>
{% endif %}
{% if contact.location %} {% if contact.location %}
<div class="uw-contact__location"> <div class="uw-contact__location">
<strong>Location:</strong><br /> <strong>Location:</strong><br />
...@@ -40,9 +64,27 @@ ...@@ -40,9 +64,27 @@
{% if contact.link_profile %} {% if contact.link_profile %}
<div class="uw-contact__profile"> <div class="uw-contact__profile">
<strong>Link to profile:</strong><br /> <strong>Link to profile:</strong><br />
<a href="{{ contact.link_profile }}">{{ contact.title }}</a> <a href="{{ contact.link_profile.uri }}">
{% if contact.link_profile.title %}
{{ contact.link_profile.title }}
{% else %}
{{ contact.title }}
{% endif %}
</a>
</div>
{% endif %}
{% if contact.personal_website %}
<div class="uw-contact__personal-website">
<strong>Link to personal website:</strong><br />
<a href="{{ contact.personal_website.uri }}">
{% if contact.personal_website.title %}
{{ contact.personal_website.title }}
{% else %}
{{ contact.title }}
{% endif %}
</a>
</div> </div>
{% endif %} {% endif %}
</div> </div>
</details> {% endblock %}
</div> {% endembed %}
\ No newline at end of file
...@@ -5,4 +5,16 @@ contact: ...@@ -5,4 +5,16 @@ contact:
email: 'someone@uwaterloo.ca' email: 'someone@uwaterloo.ca'
phone: '519-888-4567 ex. 3333' phone: '519-888-4567 ex. 3333'
location: 'EC2 4444' location: 'EC2 4444'
link_profile: 'https://google.ca' link_profile:
\ No newline at end of file uri: 'https://google.ca'
title: 'Link to my profile'
additional_info: 'This is some <b>additional info</b>'
groups:
-
title: 'Group 1'
-
title: 'Group 2'
contact_for: 'Contact for something'
personal_website:
uri: 'https://uwaterloo.ca'
title: 'My persional website'
<details class="details js-details js-form-wrapper" data-drupal-selector="edit-details" id="edit-details"{% if is_open %} open{% endif %}> <details class="details" {% if is_open %} open{% endif %}>
<summary class="details__summary" role="button" aria-controls="edit-details" aria-expanded="true" aria-pressed="true">{{ details_summary }}</summary> <summary class="details__summary">
{% block details_summary %}
Summary
{% endblock %}
</summary>
<div class="details__content"> <div class="details__content">
<div class="details__description">{{ details_description }}</div> {% block details_content %}
{{ details_content }} Content
{% endblock %}
</div> </div>
</details> </details>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment