From 88ca336ff5a755989eee894c78ff8db9e4874d51 Mon Sep 17 00:00:00 2001 From: briandunnigan Date: Fri, 18 Dec 2015 13:53:02 -0500 Subject: [PATCH] UC People Update -Updates to styles and templates --- css/executive.css | 250 ++++++++++++++++++++++++++++++- inc/people-grid.php | 144 ++++++++++++++++++ inc/person-no-about.php | 82 ++++++++++ inc/person-with-about.php | 88 +++++++++++ sass/executive.scss | 305 ++++++++++++++++++++++++++++++++++++-- single-person.php | 33 +++++ user-people.php | 220 +++++++++++++++++++++++++++ 7 files changed, 1109 insertions(+), 13 deletions(-) create mode 100644 inc/people-grid.php create mode 100644 inc/person-no-about.php create mode 100644 inc/person-with-about.php create mode 100644 single-person.php create mode 100644 user-people.php diff --git a/css/executive.css b/css/executive.css index cf42b8a..c81e99b 100644 --- a/css/executive.css +++ b/css/executive.css @@ -10376,7 +10376,7 @@ input[type="button"]#footers.btn-block { #mega-menu-wrap-primary #mega-menu-primary > li.mega-menu-megamenu > ul.mega-sub-menu { background-color: rgba(30, 96, 146, 0.95); - margin-top: 6px; + margin-top: 16px; padding: 15px 20px !important; } @@ -10999,9 +10999,18 @@ input[type="button"]#footers.btn-block { color: white; font-size: 20px; } +#footers #mega-footer .widget.widget_black_studio_tinymce .textwidget ul { + padding-left: 2px; +} +#footers #mega-footer .widget.widget_black_studio_tinymce .textwidget ul li { + list-style-type: none !important; +} #footers #mega-footer .widget.simple-social-icons ul { margin-top: 13px !important; } +#footers #mega-footer .uc-cal { + padding-left: 40px !important; +} #footers #mega-footer .uc-cal-item { margin: 1.5em 0 !important; } @@ -11009,10 +11018,10 @@ input[type="button"]#footers.btn-block { color: white !important; } #footers #mega-footer .uc-cal-item .uc-cal-event-date { - color: white !important; + color: #20a1da !important; margin-top: -4px !important; - padding: 3px 13px 0 !important; - background-color: #282828 !important; + padding: 3px 15px 0 !important; + /*background-color:#282828 !important;*/ width: auto !important; border: 1px solid #333 !important; } @@ -11125,3 +11134,236 @@ h1.entry-title { .btn { padding: 8px 12px 4px; } + +/* ----------------------------- UC People ----------------------------- */ +#page-userlist { + background-color: white; +} +#page-userlist #page-sidebar { + padding-top: 8px; + padding-left: 52px; +} +@media (max-width: 767px) { + #page-userlist #page-sidebar { + padding: 0px 20px; + } +} +#page-userlist .col-sm-9 #main { + padding: 50px; + padding-left: 0px; + padding-top: 0px; +} +@media (max-width: 767px) { + #page-userlist .col-sm-9 #main { + padding: 20px; + } +} +#page-userlist .col-sm-12 #main { + padding: 0px 50px; +} +@media (max-width: 767px) { + #page-userlist .col-sm-12 #main { + padding: 20px; + } +} +#page-userlist .col-sm-12 #main table .person-title strong { + font-weight: normal; +} +#page-userlist .col-sm-12 #main table .person-department strong { + font-weight: normal; +} +#page-userlist .col-sm-12 #main .uc-people { + overflow: auto; +} +#page-userlist .widget_nav_menu .current-menu-item { + background-color: #428BCA; +} +#page-userlist .widget_nav_menu .current-menu-item a { + color: white !important; +} +#page-userlist .widget_nav_menu a { + display: block; + padding: 7px 15px 4px; + position: relative; +} +#page-userlist .person { + min-height: 175px; +} +#page-userlist .person .person-image { + position: absolute; +} +@media (max-width: 600px) { + #page-userlist .person .person-image { + position: relative; + } +} +#page-userlist .person .person-details-wrapper { + padding-left: 165px; +} +@media (max-width: 600px) { + #page-userlist .person .person-details-wrapper { + padding-left: 0px; + } +} +#page-userlist .person .person-name { + font-weight: bold; + font-size: 17px !important; + margin-bottom: 5px; +} +#page-userlist .person .person-email { + word-wrap: break-word; +} +#page-userlist .person p { + margin-bottom: 5px; +} +#page-userlist ol.breadcrumb { + padding-left: 50px; + padding-top: 50px; +} +@media (max-width: 767px) { + #page-userlist ol.breadcrumb { + padding-left: 20px; + padding-bottom: 0px; + } +} + +.single-person #main { + border: 1px solid #eee; + margin-top: 20px; +} +.single-person #main .col-sm-8 { + padding: 30px 30px 30px 60px; +} +@media (max-width: 767px) { + .single-person #main .col-sm-8 { + padding-top: 5px; + padding-left: 30px; + padding-right: 30px; + } +} +.single-person #main .col-sm-8 h1 { + margin-bottom: 5px; +} +.single-person #main .col-sm-4 { + padding-top: 30px; +} +.single-person #main .col-sm-4 table { + margin-top: 20px; + margin-bottom: 5px; +} +.single-person #main .col-sm-4 a.person-cv { + margin-bottom: 20px; +} +@media (max-width: 767px) { + .single-person #main .col-sm-4 a.person-cv { + margin-left: 5px; + } +} +.single-person #main .text-muted { + margin-bottom: 5px !important; +} +.single-person #main .col-sm-2.col-sm-offset-2 { + padding-top: 40px; +} +@media (max-width: 767px) { + .single-person #main .col-sm-2.col-sm-offset-2 { + padding-top: 20px; + padding-left: 30px; + } +} +.single-person #main .col-sm-6 { + margin-top: 20px; +} +@media (max-width: 767px) { + .single-person #main .col-sm-6 { + padding-left: 30px; + padding-right: 30px; + } +} +.single-person #main .col-sm-6 h1 { + margin-bottom: 5px; +} +.single-person #main .col-sm-6 table { + margin-top: 20px; + margin-bottom: 5px; +} +.single-person #main .col-sm-6 .text-muted { + margin-bottom: 5px !important; +} +.single-person #main .col-sm-6 a.person-cv { + margin-bottom: 20px; +} +@media (max-width: 767px) { + .single-person #main .col-sm-6 a.person-cv { + margin-left: 5px; + } +} + +/* ----------------------------- UC People Archive Page ----------------------------- */ +#page-archive .col-sm-9 #main { + padding: 20px 40px 30px; +} +#page-archive .col-sm-9 #main h1.page-title { + border-bottom: 1px solid #ddd; + margin-bottom: 35px; + padding-bottom: 10px; +} +#page-archive .col-sm-9 #main h2 { + margin-top: 0px; + margin-bottom: 5px; + font-size: 17px; +} +#page-archive .col-sm-9 #main .entry-content { + margin-top: 0px; +} +#page-archive .col-sm-9 #main .entry-content p { + margin-bottom: 5px; +} +#page-archive .col-sm-9 #main hr { + margin-bottom: 0px; +} +#page-archive .col-sm-9 #main .navigation.paging-navigation { + border-top: 1px solid #ddd; + margin-top: 30px; + padding-top: 30px; +} +@media (max-width: 767px) { + #page-archive .col-sm-9 #main .col-sm-10 { + margin-top: 20px; + } +} +#page-archive #page-sidebar .widget-head { + padding-left: 0px; + margin-bottom: 15px; + margin-top: 30px; +} +#page-archive #page-sidebar .screen-reader-text { + display: none; +} + +/* ----------------------------- Search Results Page ----------------------------- */ +#page-search #main { + padding: 20px 40px 30px; +} +#page-search #main h1.page-title { + border-bottom: 1px solid #ddd; + margin-bottom: 35px; + padding-bottom: 10px; +} +#page-search #main h3 { + font-size: 17px; + line-height: 1.35em; +} +#page-search #main .navigation.paging-navigation { + border-top: 1px solid #ddd; + margin-top: 30px; + padding-top: 30px; +} +#page-search #page-sidebar .widget-head { + padding-left: 0px; + margin-bottom: 15px; + margin-top: 30px; +} +#page-search #page-sidebar .screen-reader-text { + display: none; +} diff --git a/inc/people-grid.php b/inc/people-grid.php new file mode 100644 index 0000000..9f88ddc --- /dev/null +++ b/inc/people-grid.php @@ -0,0 +1,144 @@ +have_posts() ) { ?> + +
+ have_posts() ) { + $the_query->the_post(); + ?> + +
+
+ '; + + if (in_array('photo', $information_to_display)) { + echo '
'; + the_post_thumbnail('thumbnail'); + echo '
'; + }; + echo ''; + + echo '
'; + echo ''; + if (in_array('first_name', $information_to_display) || in_array('middle_name', $information_to_display) || in_array('last_name', $information_to_display)){ + echo '

'; + if (in_array('first_name', $information_to_display)) { + the_field('first_name'); + echo ' '; + }; + if (in_array('middle_name', $information_to_display)) { + the_field('middle_name'); + echo ' '; + }; + if (in_array('last_name', $information_to_display)) { + the_field('last_name'); + }; + echo '

'; + }; + + echo '
'; + + if (in_array('title', $information_to_display)) { + echo '

'; + $titlePieces = explode(";", get_field('title')); + foreach( $titlePieces as $t ){ + echo ( !empty($t) ? "{$t}
": "" ); + } + echo '

'; + }; + if (in_array('department', $information_to_display)) { + echo '

'; + $departmentPieces = explode(";", get_field('department')); + foreach( $departmentPieces as $d ){ + echo ( !empty($d) ? "{$d}
": "" ); + } + echo '

'; + }; + if (in_array('about', $information_to_display)) { + echo '
'; + the_field('about'); + echo '
'; + }; + if (in_array('file', $information_to_display)) { + $file = get_field('file'); + $urlLength = strlen($file['url']); + if ($urlLength > 0){ + echo '

'; + echo ''.$file['title'].''; + echo '

'; + } + }; + if (in_array('email', $information_to_display)) { + echo '

'; + echo ''.get_field('email').''; + echo '

'; + }; + if (in_array('phone', $information_to_display)) { + echo '

'; + the_field('phone'); + echo '

'; + }; + if (in_array('phone_(alternate)', $information_to_display)) { + echo '

'; + the_field('phone_(alternate)'); + echo '

'; + }; + if (in_array('fax', $information_to_display)) { + echo '

'; + the_field('fax'); + echo '

'; + }; + if (in_array('mailing_address', $information_to_display)) { + echo '

'; + echo str_replace(';','
',get_field('mailing_address')); + echo '

'; + }; + if (in_array('office_location', $information_to_display)) { + echo '

'; + the_field('office_location'); + echo '

'; + }; + if (in_array('campus', $information_to_display)) { + echo '

'; + the_field('campus'); + echo '

'; + }; + if (in_array('office_hours', $information_to_display)) { + echo '

'; + the_field('office_hours'); + echo '

'; + }; + if (in_array('courses', $information_to_display)) { + echo '

'; + the_field('courses'); + echo '

'; + }; + if (in_array('url', $information_to_display)) { + echo '

'.get_field('url').'

'; + }; + + echo '
'; + ?> + + +
+
+ +
'; + } + $person_count++; + } //end of posts?> +
+ + \ No newline at end of file diff --git a/inc/person-no-about.php b/inc/person-no-about.php new file mode 100644 index 0000000..80dc205 --- /dev/null +++ b/inc/person-no-about.php @@ -0,0 +1,82 @@ +
+ '; + the_post_thumbnail(); + echo '
'; + };?> +
+
+

+

+ '.$t.'

': '' ); + } + $departmentPieces = explode(";", get_field('department')); + foreach( $departmentPieces as $d ){ + echo ( !empty($d) ? '

'.$d.'

': '' ); + } + ?> + + Contact Information + '; + echo ''; + } + } + displayField('email'); + displayField('phone'); + displayField('phone_(alternate)'); + displayField('fax'); + displayField('mailing_address'); + displayField('office_location'); + displayField('campus'); + displayField('office_hours'); + displayField('courses'); + displayField('url'); + ?> +
'.$field_label.''; + if ($field == 'email'){ + echo ''; + the_field($field); + echo ''; + } else if ($field == 'file'){ + $file = get_field($field); + $url= $file['url']; + echo ' '; + echo $file['title']; + echo ''; + } else if ($field == 'url'){ + echo ''.get_field($field).''; + } else if ($field == 'mailing_address'){ + echo str_replace(';','
',get_field('mailing_address')); + } else { + the_field($field); + } + echo '
+ '; + echo 'Download CV'; + echo ''; + } + ?> +
diff --git a/inc/person-with-about.php b/inc/person-with-about.php new file mode 100644 index 0000000..2b41221 --- /dev/null +++ b/inc/person-with-about.php @@ -0,0 +1,88 @@ +
+

+

+ '.$t.'

': '' ); + } + $departmentPieces = explode(";", get_field('department')); + foreach( $departmentPieces as $d ){ + echo ( !empty($d) ? '

'.$d.'

': '' ); + } + + ?> +
+ +
+
+ '; + the_post_thumbnail(); + echo '
'; + };?> +
+ + Contact Information + '; + echo ''; + } + } + displayField('email'); + displayField('phone'); + displayField('phone_(alternate)'); + displayField('fax'); + displayField('mailing_address'); + displayField('office_location'); + displayField('campus'); + displayField('office_hours'); + displayField('courses'); + displayField('url'); + + ?> +
'.$field_label.''; + if ($field == 'email'){ + echo ''; + the_field($field); + echo ''; + } else if ($field == 'file'){ + $file = get_field($field); + $url= $file['url']; + echo ' '; + echo $file['title']; + echo ''; + } else if ($field == 'url'){ + echo ''.get_field($field).''; + } else if ($field == 'mailing_address'){ + echo str_replace(';','
',get_field('mailing_address')); + } else { + the_field($field); + } + echo '
+ '; + echo 'Download CV'; + echo ''; + } + ?> +
+ \ No newline at end of file diff --git a/sass/executive.scss b/sass/executive.scss index 5315f53..eb51a23 100644 --- a/sass/executive.scss +++ b/sass/executive.scss @@ -453,7 +453,7 @@ $lightgrey: rgba($lightgrey_hex, $transparency); #mega-menu-wrap-primary #mega-menu-primary > li.mega-menu-megamenu > ul.mega-sub-menu { background-color:rgba(#1e6092, .95); - margin-top:6px; + margin-top:16px; padding:15px 20px !important; } @@ -757,6 +757,17 @@ $widget-head-padding:20px 20px 0; font-size:20px; } } + + .widget.widget_black_studio_tinymce { + .textwidget { + ul { + padding-left:2px; + li { + list-style-type: none !important; + } + } + } + } .widget.simple-social-icons { ul { @@ -764,19 +775,21 @@ $widget-head-padding:20px 20px 0; } } - + .uc-cal { + padding-left:40px !important; + } .uc-cal-item { margin:1.5em 0 !important; a.uc-cal-event { color:white !important; } .uc-cal-event-date { - color:white !important; - margin-top: -4px !important; - padding: 3px 13px 0 !important; - background-color:#282828 !important; - width:auto !important; - border:1px solid #333 !important; + color:#20a1da !important; + margin-top: -4px !important; + padding: 3px 15px 0 !important; + /*background-color:#282828 !important;*/ + width:auto !important; + border:1px solid #333 !important; } } @@ -892,4 +905,278 @@ margin-top:10px .btn { padding:8px 12px 4px -} \ No newline at end of file +} + +/* ----------------------------- UC People ----------------------------- */ + +#page-userlist { + background-color:white; + + #page-sidebar { + padding-top:8px; + padding-left:52px; + + @media (max-width:767px) { + padding:0px 20px; + } + } + + .col-sm-9 { + #main { + padding:50px; + padding-left:0px; + padding-top:0px; + + @media (max-width:767px) { + padding:20px; + } + } + } + + .col-sm-12 { + #main { + padding:0px 50px; + + @media (max-width:767px) { + padding:20px; + } + + table { + .person-title { + strong { + font-weight: normal; + } + } + .person-department { + strong { + font-weight: normal; + } + } + } + + .uc-people { + overflow:auto; + } + } + } + .widget_nav_menu { + .current-menu-item { + background-color:#428BCA; + a { + color:white !important; + } + } + a { + display: block; + padding: 7px 15px 4px; + position: relative; + } + } + .person { + min-height:175px; + + .person-image { + position:absolute; + @media (max-width:600px) { + position:relative; + } + } + .person-details-wrapper { + padding-left: 165px; + @media (max-width:600px) { + padding-left: 0px; + } + } + .person-name { + font-weight: bold; + font-size:17px !important; + margin-bottom:5px; + } + .person-email { + word-wrap:break-word; + } + p { + margin-bottom:5px; + } + } + + ol.breadcrumb { + padding-left:50px; + padding-top:50px; + + @media (max-width:767px) { + padding-left:20px; + padding-bottom:0px; + } + } +} + +.single-person { + #main { + border: 1px solid #eee; + margin-top: 20px; + + .col-sm-8 { + padding:30px 30px 30px 60px; + + @media (max-width:767px) { + padding-top:5px; + padding-left:30px; + padding-right:30px; + } + h1 { + margin-bottom:5px; + } + } + .col-sm-4 { + padding-top:30px; + + table { + margin-top:20px; + margin-bottom:5px; + } + + a.person-cv { + margin-bottom:20px; + + @media (max-width:767px) { + margin-left:5px; + } + } + } + .text-muted { + margin-bottom:5px !important; + } + .col-sm-2.col-sm-offset-2 { + padding-top: 40px; + + @media (max-width:767px) { + padding-top:20px; + padding-left: 30px; + } + } + .col-sm-6 { + margin-top:20px; + + @media (max-width:767px) { + padding-left: 30px; + padding-right: 30px; + } + + + h1 { + margin-bottom:5px; + } + + table { + margin-top:20px; + margin-bottom:5px; + } + + .text-muted { + margin-bottom:5px !important; + } + a.person-cv { + margin-bottom:20px; + + @media (max-width:767px) { + margin-left:5px; + } + } + } + } +} + +/* ----------------------------- UC People Archive Page ----------------------------- */ + +#page-archive { + .col-sm-9 { + #main { + padding:20px 40px 30px; + + h1.page-title { + border-bottom: 1px solid #ddd; + margin-bottom: 35px; + padding-bottom: 10px; + } + + h2 { + margin-top:0px; + margin-bottom:5px; + font-size:17px; + } + + .entry-content { + margin-top:0px; + + p { + margin-bottom:5px; + } + } + + hr { + margin-bottom:0px; + } + .navigation.paging-navigation { + border-top: 1px solid #ddd; + margin-top: 30px; + padding-top: 30px; + } + + @media (max-width:767px) { + .col-sm-10 { + margin-top:20px; + } + } + } + } + #page-sidebar { + + .widget-head { + padding-left:0px; + margin-bottom:15px; + margin-top: 30px; + } + .screen-reader-text { + display:none; + } + } + +} + + +/* ----------------------------- Search Results Page ----------------------------- */ + +#page-search { + #main { + padding:20px 40px 30px; + h1.page-title { + border-bottom: 1px solid #ddd; + margin-bottom: 35px; + padding-bottom: 10px; + } + h3 { + font-size:17px; + line-height:1.35em; + } + + .navigation.paging-navigation { + border-top: 1px solid #ddd; + margin-top: 30px; + padding-top: 30px; + } + } + #page-sidebar { + + .widget-head { + padding-left:0px; + margin-bottom:15px; + margin-top: 30px; + } + .screen-reader-text { + display:none; + } + } +} + + diff --git a/single-person.php b/single-person.php new file mode 100644 index 0000000..f31ceb1 --- /dev/null +++ b/single-person.php @@ -0,0 +1,33 @@ + + +
+ + +
+
+
+
+
+ 0){ + include('inc/person-with-about.php'); + } else { + include('inc/person-no-about.php'); + } + ?> +
+
+
+
+ +
+ + +
+ diff --git a/user-people.php b/user-people.php new file mode 100644 index 0000000..ff8dc9d --- /dev/null +++ b/user-people.php @@ -0,0 +1,220 @@ + +
+ + + + +
+ +
+
+
+
> +
+ ', '' ); ?> +
+
+ +
+ ', '' ); ?> +
+
+ -1, + 'post_type' => 'person', + 'meta_key' => 'last_name', + 'orderby' => 'menu_order meta_value title', + 'order' => 'ASC', + ); + + + + // Settings + + $layout = get_field( "layout" ); + $people_to_display = get_field( "people_to_display" ); + $break_into_groups = get_field( "break_into_groups" ); + $specific_people = get_field( "specific_people" ); + $specific_groups = get_field( "specific_groups" ); + $specific_tags = get_field( "specific_tags" ); + $information_to_display = get_field( "information_to_display" ); + + function createTextCell($setting, $field){ + global $information_to_display; + if (in_array($setting, $information_to_display)) { + echo ''; + the_field($field); + echo ''; + } + }; + + function sort_group_by_order( $a, $b ){ + // Getting the order for groups $a and $b + $groupA = get_term_by('slug', $a, 'group')->term_id; + $array_orderGroupA = get_option( "taxonomy_{$groupA}" ); + $orderGroupA = $array_orderGroupA['group_order']; + + $groupB = get_term_by('slug', $b, 'group')->term_id; + $array_orderGroupB = get_option( "taxonomy_{$groupB}" ); + $orderGroupB = $array_orderGroupB['group_order']; + + $r = strnatcasecmp( $orderGroupA, $orderGroupB ); + if( $r === 0 ){ + $r = strnatcasecmp( $a, $b ); + } + return $r; + } + + if ($specific_people){ + global $specific_people; + global $args; + $post__in = array(); + foreach($specific_people as &$value){ + //array_push($post__in, $value->ID); + array_push($post__in, $value); + } + $args[post__in]= $post__in; + } + + // do we need a tax query? + if ($specific_groups != false || $specific_tags != false){ + + $tax_query = array(); + $isTagSet = false; + + if ($specific_groups != false) { + $group_query = array( + 'taxonomy' => 'group', + 'field' => 'term_id', + 'terms' => $specific_groups + ); + array_push($tax_query, $group_query); + } + if ($specific_tags != false) { + $isTagSet = true; + $tag_query = array( + 'taxonomy' => 'persontag', + 'field' => 'term_id', + 'terms' => $specific_tags + ); + array_push($tax_query, $tag_query); + } + $args[tax_query] = $tax_query; + + } + if ($break_into_groups == 1 ){ + //echo '

Break into Groups

'; + + // get all the people + $the_query = new WP_Query( $args ); + + // focusing on just the people, not the rest of the query. + $people = $the_query->posts; + + // look at each person, and see each group used, use that to create a list of terms. + $groups_in_use = array(); + + foreach($people as $value){ + //$id = $value->ID; + $id = $value; + $terms = get_the_terms($id, 'group'); + if (is_array($terms)){ + foreach($terms as $key => $value){ + //duplicates will overwrite themselves... + $slug = $value->slug; + $groups_in_use[$slug]= $slug; + } + }; + } + if(!empty($specific_groups) && is_array($specific_groups)){ + $groups_in_use = array(); + foreach($specific_groups as $group){ + $group = get_term_by('id', $group, 'group'); + $groups_in_use[] = $group->slug; + } + } + // sort the groups in use alphabetically + //sort($groups_in_use); + usort($groups_in_use, 'sort_group_by_order' ); + + // for each item in the list of terms, do a new query, but this time we're going to limit it to ONLY items from that one group. + foreach($groups_in_use as $value){ + + // this sets up the query we'll need, and will overwrite any group queries from the original settings. + $tax_query = array(); + $group_query = array( + 'taxonomy' => 'group', + 'field' => 'slug', + 'terms' => $value + ); + array_push($tax_query, $group_query); + if( $isTagSet != false ){ + array_push($tax_query, $tag_query); + } + $args['tax_query'] = $tax_query; + + // with $arg updated, let's do a new query. + echo '

'.get_term_by('slug', $value, 'group')->name.'

'; + + if ($layout == 'grid') { + include('inc/people-grid.php'); + } + if ($layout == 'table') { + include(get_template_directory().'/inc/people-table.php'); + } + + } + + } else { + + if ($layout == 'grid') { + include('inc/people-grid.php'); + } + if ($layout == 'table') { + include(get_template_directory().'/inc/people-table.php'); + } + + } + ?> + + +
+
+
+
+
+
+ +
+ + +
+ + \ No newline at end of file