Skip to content

Commit

Permalink
Merge pull request #1179 from visual-framework/intranet-updates
Browse files Browse the repository at this point in the history
Intranet updates
  • Loading branch information
kasprzyk-sz authored Nov 11, 2022
2 parents e8f0d8f + 65c3d8d commit 5208234
Show file tree
Hide file tree
Showing 11 changed files with 177 additions and 664 deletions.
2 changes: 1 addition & 1 deletion wp-content/plugins/vf-hero-container/template.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ class="vf-search__button | vf-button vf-button--primary">
<p><span class="vf-text-body vf-text-body--3 | vf-u-margin__right--100">Directories:</span>
<span><a class="vf-badge vf-badge--tertiary | vf-u-margin__right--100 | intranet-directory-badge" href="/internal-information/people">People</a></span>
<span><a class="vf-badge vf-badge--tertiary | vf-u-margin__right--100 | intranet-directory-badge" href="/internal-information/documents">Documents</a></span>
<span><a class="vf-badge vf-badge--tertiary | intranet-directory-badge" href="/internal-information/seminars">Seminars</a></span></p>
<span><a class="vf-badge vf-badge--tertiary | intranet-directory-badge" href="https://hd-tqportal.embl.de/EMBL_LIVE_thankQ_Web/public/network/results.aspx">Alumni</a></span></p>

<?php }
else { ?>
Expand Down
34 changes: 34 additions & 0 deletions wp-content/themes/vf-wp-intranet/acf-json/insites.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,40 @@
"ui": 1,
"ui_on_text": "",
"ui_off_text": ""
},
{
"key": "field_636cfd3f32f8f",
"label": "Newcomers start date",
"name": "newcomers_start_date",
"type": "date_picker",
"instructions": "",
"required": 0,
"conditional_logic": 0,
"wrapper": {
"width": "50",
"class": "",
"id": ""
},
"display_format": "d-M-Y",
"return_format": "d-M-Y",
"first_day": 1
},
{
"key": "field_636cfe718f756",
"label": "Newcomers end date",
"name": "newcomers_end_date",
"type": "date_picker",
"instructions": "",
"required": 0,
"conditional_logic": 0,
"wrapper": {
"width": "50",
"class": "",
"id": ""
},
"display_format": "d-M-Y",
"return_format": "d-M-Y",
"first_day": 1
}
],
"location": [
Expand Down
4 changes: 2 additions & 2 deletions wp-content/themes/vf-wp-intranet/archive-people.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,15 +151,15 @@ class="embl-grid embl-grid--has-centered-content | vf-u-padding__top--800 vf-u-p
<article class="vf-card vf-card--brand vf-card--bordered">
<div class="vf-card__content | vf-stack vf-stack--400">
<h3 class="vf-card__heading"><a class="vf-card__link"
href="https://www.embl.org/search/">Alumni search<svg
href="https://hd-tqportal.embl.de/EMBL_LIVE_thankQ_Web/public/network/results.aspx">Alumni directory<svg
aria-hidden="true" class="vf-card__heading__icon | vf-icon vf-icon-arrow--inline-end" width="1em"
height="1em" xmlns="http://www.w3.org/2000/svg">
<path
d="M0 12c0 6.627 5.373 12 12 12s12-5.373 12-12S18.627 0 12 0C5.376.008.008 5.376 0 12zm13.707-5.209l4.5 4.5a1 1 0 010 1.414l-4.5 4.5a1 1 0 01-1.414-1.414l2.366-2.367a.25.25 0 00-.177-.424H6a1 1 0 010-2h8.482a.25.25 0 00.177-.427l-2.366-2.368a1 1 0 011.414-1.414z"
fill="currentColor" fill-rule="nonzero"></path>
</svg>
</a></h3>
<p class="vf-card__text">Search for EMBL Alumni on embl.org</p>
<p class="vf-card__text">Find alumni from EMBL</p>
</div>
</article>
<p><a href="https://www.embl.org/internal-information/departments-and-teams/">Departments and teams
Expand Down
7 changes: 5 additions & 2 deletions wp-content/themes/vf-wp-intranet/partials/search-filter.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<form class="vf-stack vf-stack-400 | vf-u-margin__bottom--400">
<fieldset class="vf-form__fieldset vf-stack vf-stack--400">
<fieldset id="checkbox-container" class="vf-form__fieldset vf-stack vf-stack--400">
<div class="vf-form__item vf-form__item--checkbox">
<input id="page" type="checkbox" data-jplist-control="checkbox-text-filter"
data-path=".page" data-group="data-group-1" data-name="name3" data-or="name3"
data-path=".page" data-group="data-group-1" data-name="name1" data-or="name1"
value="Page"
data-id="page" class="vf-form__checkbox">
<label for="page" class="vf-form__label">Page&nbsp;<span
Expand Down Expand Up @@ -72,3 +72,6 @@
</div>
</fieldset>
</form>
<script>
</script>
2 changes: 1 addition & 1 deletion wp-content/themes/vf-wp-intranet/partials/vf-profile.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
class="vf-profile__link vf-profile__link--secondary"><?php echo esc_attr($email); ?></a>
</p>
<p class="vf-profile__phone">
<a href="<?php echo esc_attr($telephone); ?>"
<a href="tel:<?php echo esc_attr($telephone); ?>"
class="vf-profile__link vf-profile__link--secondary"><?php echo esc_attr($telephone); ?></a>
</p>
<?php if (!empty($room)) { ?>
Expand Down
12 changes: 8 additions & 4 deletions wp-content/themes/vf-wp-intranet/partials/vf-summary--page.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,19 @@
?>
</p>

<?php if (!empty($redirect_url)) { ?>
<?php
if ( (get_post_type() == 'page') || (get_post_type() == 'teams')) {
if (!empty($redirect_url)) { ?>
<div class="vf-summary__meta"><a href="<?php echo esc_url($redirect_url); ?>"
class="vf-summary__author vf-summary__link"><?php echo esc_url($redirect_url); ?></a></div>
<?php }
else { ?>
<div class="vf-summary__meta"><?php $uri = get_page_uri(); echo '<a class="vf-summary__author vf-summary__link" href="' . get_the_permalink() . '">' . '/' . esc_html__($uri ) . '</a>'; ?></div>
<?php } ?>
<div class="vf-summary__meta"><?php
$uri = get_page_uri();
echo '<p class="vf-summary__author">' . esc_html__($uri ) . '</p>'; ?></div>
<?php } }?>
<?php
if ( get_post_type() == 'page' ) {
if ((get_post_type() == 'page') || (get_post_type() == 'teams')) {
echo '<p class="page vf-u-display-none | used-for-filtering">Page</p>';
}
elseif ( get_post_type() == 'people') {
Expand Down
126 changes: 126 additions & 0 deletions wp-content/themes/vf-wp-intranet/template-newcomers.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
<?php

/*
Template Name: Newcomers
Template Post Type: insites
*/


$title = esc_html(get_the_title());
$user_id = get_the_author_meta('ID');
$tags = get_the_tags($post->ID);
$intro = get_field('article_intro');
$topic_terms = get_field('topic');
$show = get_field('show_featured_image');
$locations = get_field('embl_location');

get_header();

?>

<section class="embl-grid embl-grid--has-centered-content | vf-u-padding__top--200 | vf-u-margin__bottom--0">
<div>
<div class="vf-article-meta-information">
<div class="vf-author | vf-article-meta-info__author">
<p class="vf-author__name">
<a class="vf-link"
href="<?php echo get_author_posts_url( get_the_author_meta( 'ID' ) ); ?>"><?php the_author(); ?></a>
</p>
<a class="vf-author--avatar__link | vf-link"
href="<?php echo get_author_posts_url( get_the_author_meta( 'ID' ) ); ?>">
<?php echo get_avatar( get_the_author_meta( 'ID' ), 48, '', '', array('class' => 'vf-author--avatar')); ?>
</a>
</div>
<div class="vf-meta__details | vf-stack vf-stack--400">
<p class="vf-meta__date"><time title="<?php the_time('c'); ?>"
datetime="<?php the_time('c'); ?>"><?php the_time(get_option('date_format')); ?></time></p>
<?php if (($topic_terms)) { ?>
<p class="vf-meta__topics | vf-u-margin__top--600"><span style="color: #000;">Topic:</span>
<?php
if( $topic_terms ) {
$topics_list = array();
foreach( $topic_terms as $term ) {
$topics_list[] = '<span style="color: #707372;" href="' . esc_url(get_term_link( $term )) . '">' . strtoupper(esc_html( $term->name )) . '</span>'; }
echo implode(', ', $topics_list); } ?>
</p>
<?php }
if (($locations)) { ?>
<p class="vf-meta__topics"><span style="color: #000;">EMBL site:</span>
<?php $location_list = [];
foreach( $locations as $location ) {
$location_list[] = $location->name; }
echo implode(', ', $location_list); ?>
</p>
<?php } ?>
</div>
</div>
</div>

<div class="vf-content | vf-u-padding__bottom--800">
<h1><?php the_title(); ?></h1>
<p class="vf-lede | vf-u-padding__top--400 | vf-u-padding__bottom--800">
<?php echo get_post_meta($post->ID, 'article_intro', true); ?>
</p>
<?php if ( $show == '1' ) {} //not displaying
else { ?>
<figure class="vf-figure">
<?php the_post_thumbnail('full', array('class' => 'vf-figure__image')); ?>
<figcaption class="vf-figure__caption">
<?php echo wp_kses_post(get_post(get_post_thumbnail_id())->post_excerpt); ?>
</figcaption>
</figure>
<?php } ?>


<?php
$newcomers_start = get_field('newcomers_start_date');
$newcomers_end = get_field('newcomers_end_date');
$request = wp_remote_get( 'https://xs-db.embl.de/v2/newcomers/' . $newcomers_start . '/' . $newcomers_end );

if( is_wp_error( $request ) ) {
return false; // Bail early
}

$body = wp_remote_retrieve_body( $request );
$data = json_decode( $body );

if( ! empty( $data ) ) {
foreach ($data as $person) {
$title = $person->displayName; ?>

<p><?php echo $title; ?></p>
<?php }} ?>
</div>
<div>
<?php if (is_active_sidebar('sidebar-blog')) { ?>
<?php vf_sidebar('sidebar-blog'); ?>
<?php } ?>
</div>
</section>

<hr class="vf-divider">

<div
class="vf-news-container vf-news-container--featured | vf-u-margin__bottom--100 | vf-u-padding__top--400 | vf-u-fullbleed">
<h2 class="vf-section-header__heading vf-u-margin__bottom--400">Latest stories</h2>
<div class="vf-news-container__content vf-grid vf-grid__col-4">
<?php
$args = array(
'post_type' => 'insites',
'posts_per_page' => 4,
'post__not_in' => array( get_the_ID() ),
'no_found_rows' => true,
);
$featured = new WP_Query ($args);
while ($featured->have_posts()) : $featured->the_post();
include(locate_template('partials/vf-summary-insites-latest.php', false, false)); ?>
<?php endwhile;?>
<?php wp_reset_postdata(); ?>
</div>
</div>

<?php

get_footer();

?>
102 changes: 0 additions & 102 deletions wp-content/themes/vf-wp-intranet/template-test.php

This file was deleted.

Loading

0 comments on commit 5208234

Please sign in to comment.