Skip to content
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

add small teaser person template #30

Open
wants to merge 1 commit into
base: 8.x-4.1.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 76 additions & 0 deletions templates/node--person--small-teaser.html.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
{%
set classes = [
'node',
'node--type-' ~ node.bundle|clean_class,
node.isPromoted() ? 'node--promoted',
node.isSticky() ? 'node--sticky',
not node.isPublished() ? 'node--unpublished',
view_mode ? 'node--view-mode-' ~ view_mode|clean_class,
'clearfix',
]
%}
{{ attach_library('classy/node') }}
{{ attach_library('unl_fourone/person') }}
<article{{ attributes.addClass('wdn-band').addClass(classes) }}>

{% if display_submitted %}
<footer>
{{ author_picture }}
<div{{ author_attributes }}>
{% trans %}Submitted by {{ author_name }} on {{ date }}{% endtrans %}
{{ metadata }}
</div>
</footer>
{% endif %}

<div{{ content_attributes }}>
<figure class="wdn-frame">
{% if node.field_person_portrait.value %}
{{ content.field_person_portrait }}
{% else %}
<img src="{{ node.field_my_unl_id.entity.field_imageurl.value }}" alt="Avatar for {{ label }}" />
{% endif %}
</figure>
<div class="person-small-teaser-contact">
<h5 class="clear-top wdn-brand">{{ label }}
<span class="wdn-subhead" itemprop="jobTitle">
{% if node.field_person_job_title.value %}
{{ content.field_person_job_title }}
{% else %}
{{ node.field_my_unl_id.entity.field_jobtitle.value }}
{% endif %}
</span>
</h5>
<div class="tel work icon-phone attribute">
<span class="type">Work</span>
{% if node.field_person_phone.value %}
<span class="value"><a href="tel:{{ node.field_person_phone.value|replace({'-':''}) }}">
<span itemprop="telephone">{{ node.field_person_phone.value }}</span>
</a>
</span>
{% if node.field_person_phone.value|slice(0,7) == '402-472' %}
<abbr class="on-campus-dialing" title="For on-campus dialing only. Off-campus, dial {{ node.field_person_phone.value }}">On-campus {{ node.field_person_phone.value|replace({'402-472-':'2-'}) }}</abbr>
{% endif %}
{% else %}
<span class="value"><a href="tel:{{ node.field_my_unl_id.entity.field_telephonenumber.value|replace({' ':''}) }}">
<span itemprop="telephone">{{ node.field_my_unl_id.entity.field_telephonenumber.value|replace({' ':'-'}) }}</span>
</a>
</span>
{% if node.field_my_unl_id.entity.field_telephonenumber.value|slice(0,7) == '402 472' %}
<abbr class="on-campus-dialing" title="For on-campus dialing only. Off-campus, dial {{ node.field_my_unl_id.entity.field_telephonenumber.value }}">On-campus {{ node.field_my_unl_id.entity.field_telephonenumber.value|replace({'402 472':'2-'}) }}</abbr>
{% endif %}
{% endif %}
</div>
<div class="icon-email attribute">
{% if node.field_person_email.value %}
<a class="email" href="mailto:{{ content.field_person_email }}" itemprop="email">{{ content.field_person_email }}</a>
{% else %}
<a class="email" href="mailto:{{ node.field_my_unl_id.entity.field_mail.value }}" itemprop="email">{{ node.field_my_unl_id.entity.field_mail.value }}</a>
{% endif %}
</div>
{% if content.body.value or node.field_my_unl_id.entity.field_knowledge_bio.value %}
<a href="{{ node_url }}" >Full {{ label }} bio</a>
{% endif %}
</div>
</div>
</article>
4 changes: 2 additions & 2 deletions templates/node--person--teaser.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
{{ attach_library('classy/node') }}
{{ attach_library('unl_fourone/person') }}
<article{{ attributes.addClass('wdn-band').addClass(classes) }}>

{% if display_submitted %}
<footer>
{{ author_picture }}
Expand All @@ -28,7 +28,7 @@
<div class="wdn-inner-wrapper wdn-inner-padding-sm">
<div class="wdn-grid-set">
<div class="bp480-wdn-col-one-sixth wdn-pull-right">
<figure class="wdn-frame">{% if content.field_person_portrait %}
<figure class="wdn-frame">{% if node.field_person_portrait.value %}
{{ content.field_person_portrait }}
{% else %}
<img class="photo profile_pic" itemprop="image" src="{{ node.field_my_unl_id.entity.field_imageurl.value }}" alt="Avatar for {{ label }}" />
Expand Down
10 changes: 4 additions & 6 deletions templates/node--person.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,11 @@
<div class="wdn-grid-set knowledge-grid">
<div class="bp2-wdn-col-two-sevenths directory-knowledge-summary">
<div class="vcard faculty" data-uid="{{ node.field_my_unl_id.entity.uid.value }}" data-preferred-name="{{ label }}" itemscope itemtype="http://schema.org/Person">
<a class="card-profile planetred_profile" href="https://planetred.unl.edu/pg/profile/{{ node.field_my_unl_id.entity.uid.value }}" title="Planet Red profile for {{ label }}" itemprop="url">
{% if content.field_person_portrait %}
{{ content.field_person_portrait }}
{% else %}
{% if node.field_person_portrait.value %}
{{ content.field_person_portrait }}
{% else %}
<img class="photo profile_pic" itemprop="image" src="{{ node.field_my_unl_id.entity.field_imageurl.value }}" alt="Avatar for {{ label }}" />
{% endif %}
</a>
{% endif %}
<div class="vcardInfo">
<h1 class="headline">
<a class="permalink" href="{{ node.field_my_unl_id.entity.field_unldirectoryaddress.value }}" itemprop="url">
Expand Down