Skip to content

Commit

Permalink
single profile fixes, order by semester on about page
Browse files Browse the repository at this point in the history
  • Loading branch information
bak11004 committed Apr 10, 2016
1 parent f626e94 commit c134b79
Show file tree
Hide file tree
Showing 6 changed files with 90 additions and 36 deletions.
10 changes: 8 additions & 2 deletions www/wp-content/themes/ation2016/page.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,11 @@
*/
else if ( $post->post_name === 'about' ) {
$semesters = Timber::get_terms('semester');
$sems = [];
// Loop through each semester, place in key=>val by start_date=>term_info
foreach ( $semesters as $key => $semester ) {
$sems[$semester->start_date] = $semester;
// Query members for that term and add to term_info
$member_args = array(
'post_type' => 'member',
'posts_per_page' => -1,
Expand All @@ -67,9 +71,11 @@
),
);
$semester_members = Timber::get_posts( $member_args );
$semesters[$key]->members = $semester_members;
$sems[$semester->start_date]->members = $semester_members;
}
$context['semesters'] = $semesters;
// Sort by reverse date, so most recent semester is on top.
krsort( $sems, SORT_NUMERIC );
$context['semesters'] = $sems;
}

/*
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.member-profile {
h1:first-child {
margin-top: 0;
}
h1,h2,h3,h4,h5,h6 {
color: $orange;
}
}
1 change: 1 addition & 0 deletions www/wp-content/themes/ation2016/src/styles/site.scss
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ $header-height-sticky: 70px;
@import 'components/work';
@import 'components/services';
@import 'components/about';
@import 'components/member-profile';
@import 'components/footer';
@import 'components/mobile-menu';

Expand Down
6 changes: 6 additions & 0 deletions www/wp-content/themes/ation2016/static/styles/site.css
Original file line number Diff line number Diff line change
Expand Up @@ -5993,6 +5993,12 @@ html, body {
.about-members .row div {
padding: 0; }

.member-profile h1:first-child {
margin-top: 0; }

.member-profile h1, .member-profile h2, .member-profile h3, .member-profile h4, .member-profile h5, .member-profile h6 {
color: #ff7200; }

footer {
border-top: 1px solid #eeeeee;
background-color: #a8a8a8; }
Expand Down
2 changes: 1 addition & 1 deletion www/wp-content/themes/ation2016/static/styles/site.min.css

Large diffs are not rendered by default.

99 changes: 66 additions & 33 deletions www/wp-content/themes/ation2016/templates/single-member.twig
Original file line number Diff line number Diff line change
@@ -1,43 +1,76 @@
{% extends "base.twig" %}

{% block content %}
<div class="container">
<div class="container member-profile">

<div class="col-xs-12 col-sm-6 col-md-4">
{% if post.get_thumbnail %}
{% if post.get_thumbnail %}
{# Top Layout if has thumbnail #}
<div class="col-xs-12 col-sm-6 col-md-4">
<img src="{{ post.get_thumbnail.get_src | resize( 600, 600 ) }}">
{% endif %}
{% if post.email %}
<p>
<a href="mailto:{{ post.email }}">{{ post.email }}</a>
</p>
{% endif %}
{% if post.website_portfolio_link %}
<p>
<a href="{{post.website_portfolio_link}}">{{ post.website_portfolio_link }}</a>
</p>
{% endif %}
{% if post.linkedin %}
<p>
<a href="{{ post.linkedin }}">{{ post.linkedin }}</a>
</p>
{% endif %}
</div>
{% if post.email %}
<p>
<a href="mailto:{{ post.email }}">{{ post.email }}</a>
</p>
{% endif %}
{% if post.website_portfolio_link %}
<p>
<a href="{{post.website_portfolio_link}}">{{ post.website_portfolio_link }}</a>
</p>
{% endif %}
{% if post.linkedin %}
<p>
<a href="{{ post.linkedin }}">{{ post.linkedin }}</a>
</p>
{% endif %}
</div>

<div class="col-xs-12 col-sm-6 col-md-8">
<h1>{{ post.name }}</h1>
{% if post.major_concentration %}
<h3>
{% for concentration in post.major_concentration %}
{{ concentration }}{% if not loop.last %}, {% endif %}
{% endfor %}
</h3>
{% endif %}
{% if post.hometown %}
<h6>{{ post.hometown }}</h6>
{% endif %}
</div>
<div class="col-xs-12 col-sm-6 col-md-8">
<h1>{{ post.name }}</h1>
{% if post.major_concentration %}
<h3>
{% for concentration in post.major_concentration %}
{{ concentration }}{% if not loop.last %}, {% endif %}
{% endfor %}
</h3>
{% endif %}
{% if post.hometown %}
<h6>{{ post.hometown }}</h6>
{% endif %}
</div>

{% else %}
{# Top layout if no thumbnail #}
<div class="col-xs-12">
<h1>{{ post.name }}</h1>
{% if post.major_concentration %}
<h3>
{% for concentration in post.major_concentration %}
{{ concentration }}{% if not loop.last %}, {% endif %}
{% endfor %}
</h3>
{% endif %}
{% if post.hometown %}
<h6>{{ post.hometown }}</h6>
{% endif %}
{% if post.email %}
<p>
<a href="mailto:{{ post.email }}">{{ post.email }}</a>
</p>
{% endif %}
{% if post.website_portfolio_link %}
<p>
<a href="{{post.website_portfolio_link}}">{{ post.website_portfolio_link }}</a>
</p>
{% endif %}
{% if post.linkedin %}
<p>
<a href="{{ post.linkedin }}">{{ post.linkedin }}</a>
</p>
{% endif %}
</div>
{% endif %}

{# Bio and Quote #}
<div class="col-xs-12">
{% if post.content %}
<h2>Bio</h2>
Expand Down

0 comments on commit c134b79

Please sign in to comment.