Commit d9949852 authored by Simon's avatar Simon

job breadcrumbs and sections added

parent d8883b1a
......@@ -16,4 +16,6 @@
.l-main--regions { flex: 1 1 600px;}
.l-main--position { overflow: hidden; }
/* critical:end */
......@@ -11,6 +11,7 @@ c-: Signify that something is a Component. This is a concrete, implementation-sp
@import '_component--awesomplete.css';
@import '_component--breadcrumbs.css';
@import '_component--btn.css';
@import '_component--categories.css';
@import '_component--cookies-warning.css';
@import '_component--contact.css';
@import '_component--contact-landing-1.css';
......
......@@ -2,6 +2,17 @@
/* critical:start */
.c-breadcrumbs { display: flex; list-style: none; margin: 0; padding: 0; width: 100%; font-size: 13px; height: 40px; margin-top: -40px; color: #868C93; overflow: hidden;
li { overflow: hidden; flex: 0 0 auto;
&:last-child { flex: 1 1 auto; }
}
a { display: block; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; text-decoration: none;
&:hover { text-decoration: underline; }
}
}
/* critical:end */
.c-breadcrumbs { padding-top: 1em; }
.c-breadcrumb--sep { padding: 0 7px; }
.c-breadcrumb--active { color: #069980; }
/* ------------- Component: categories ------------- */
/* critical:start */
.c-categories { display: flex; list-style: none; margin: 0; padding: 0; width: 100%; font-size: 13px; height: 20px; margin-top: -20px; color: #868C93; overflow: hidden;
li { overflow: hidden; flex: 0 0 auto;
&:last-child { flex: 1 1 auto; }
}
a { display: block; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; text-decoration: none;
&:hover { text-decoration: underline; }
}
}
.c-categories--sep { padding: 0 7px; }
/* critical:end */
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -21,13 +21,157 @@ get_header();
<div class="l-content--position-inner">
<main id="main" class="l-main">
<main id="main" class="l-main l-main--position">
<?php
$ID = get_the_id();
while ( have_posts() ) :
?>
<ul class="c-breadcrumbs">
<li>
<a href="<?php echo pll_home_url(); ?>" ><?php _e('Main page', 'biuro'); ?></a>
</li>
<li class="c-breadcrumb--sep">
<svg width="4px" height="9.376px" class="c-ico--right">
<use xlink:href="#ico--right-slim"></use>
</svg>
</li>
<?php
global $positionsPage;
if ($positionsPage):
?>
<li>
<a href="<?php echo $positionsPage; ?>"><?php _e('Job offers', 'biuro'); ?></a>
</li>
<li class="c-breadcrumb--sep">
<svg width="4px" height="9.376px" class="c-ico--right">
<use xlink:href="#ico--right-slim"></use>
</svg>
</li>
<?php
endif;
?>
<li class="c-breadcrumb--active">
<a href="<?php echo the_permalink(); ?>"><?php the_title(); ?></a>
</li>
</ul>
<h1 class="c-job--title"><?php the_title(); ?></h1>
<?php
function getCategory($ID, $str) {
$res = array(
'name' => '',
'pageURL' => '',
);
$terms = get_post_meta($ID, "_yoast_wpseo_primary_{$str}");
if (isset($terms) && isset($terms[0])) {
$pages = getOptions($str);
$termID = $terms[0];
$options = array_filter($pages, function ($pages) use ($termID) { return ($pages['termID'] == $termID); } );
foreach ($options as &$page) :
if (isset($page['name'])):
$res['name'] = $page['name'];
endif;
if (isset($page['pageID'])):
$res['pageURL'] = get_page_link( $page['pageID'] );
else:
$res['pageURL'] = ($str == 'city') ? '/?city=' . $res['name'] . '&s=' : '/?city=&s=' . $res['name'];
endif;
endforeach;
}
return $res;
}
// delog('type');
// $fields = get_post_meta($ID, '_yoast_wpseo_primary_type');
// debug($fields);
?>
<ul class="c-categories">
<?php
$city = getCategory($ID, 'city');
if ($city['name'] != ''):
?>
<li>
<a href="<?php echo $city['pageURL']; ?>" ><?php echo $city['name']; ?></a>
</li>
<?php
endif;
$field = getCategory($ID, 'field');
if ($field['name'] != ''):
if ($city['name'] != ''):
?>
<li class="c-categories--sep">/</li>
<?php
endif;
?>
<li>
<a href="<?php echo $field['pageURL']; ?>" ><?php echo $field['name']; ?></a>
</li>
<?php
endif;
$types = wp_get_post_terms( $ID, 'type', array('orderby' => 'count', 'order' => 'DESC'));
$options = getOptions('type');
usort($options, function($a, $b) {
return $a['no'] < $b['no'];
});
$type = array(
'name' => '',
'pageURL' => '',
);
foreach ($options as &$option) :
foreach ($types as &$page) :
if ($page->term_id == $option['termID']):
if (isset($page->name)):
$type['name'] = $page->name;
endif;
if (isset($option['pageID'])):
$type['pageURL'] = get_page_link( $option['pageID'] );
else:
$type['pageURL'] = '/?city=&s=' . $type['name'];
endif;
break 2;
endif;
endforeach;
endforeach;
if ($type['name'] != ''):
if ($field['name'] != '' || $city['name'] != ''):
?>
<li class="c-categories--sep">/</li>
<?php
endif;
?>
<li>
<a href="<?php echo $type['pageURL']; ?>" ><?php echo $type['name']; ?></a>
</li>
<?php
endif;
?>
</ul>
<div class="c-job--content">
<?php
the_post();
......
......@@ -37,6 +37,12 @@
<symbol id="ico--down" viewBox="0 0 13 8">
<path class="u-fill--inherit" d="M12.884,0.776c0.138,0.138,0.138,0.36,0,0.498L6.749,7.409c-0.138,0.138-0.36,0.138-0.498,0 L0.116,1.274c-0.138-0.138-0.138-0.36,0-0.498l0.58-0.58c0.138-0.138,0.36-0.138,0.498,0L6.5,5.49l5.306-5.294 c0.138-0.138,0.36-0.138,0.498,0L12.884,0.776z"/>
</symbol>
<symbol id="ico--right" viewBox="0.02 0.687 5.585 9.376">
<path class="u-fill--inherit" d="M5.502,5.624L1.201,9.96c-0.138,0.138-0.36,0.138-0.498,0l-0.58-0.58 c-0.138-0.138-0.138-0.36,0-0.498l3.472-3.507L0.123,1.868c-0.138-0.138-0.138-0.36,0-0.498l0.58-0.58 c0.138-0.138,0.36-0.138,0.498,0l4.301,4.336C5.64,5.264,5.64,5.486,5.502,5.624z"/>
</symbol>
<symbol id="ico--right-slim" viewBox="0.813 0.687 4 9.376">
<path class="u-fill--inherit" d="M4.739,5.624L1.659,9.96c-0.099,0.138-0.258,0.138-0.357,0L0.886,9.38 c-0.099-0.138-0.099-0.36,0-0.498l2.486-3.507L0.886,1.868c-0.099-0.138-0.099-0.36,0-0.498l0.415-0.58 c0.099-0.138,0.258-0.138,0.357,0l3.08,4.336C4.837,5.264,4.837,5.486,4.739,5.624z"/>
</symbol>
<symbol id="ico--time" viewBox="0 0 24 24">
<path fill="#2A3644" d="M0.931,1.117h0.464c0.307,0,0.556,0.249,0.556,0.556v4.388c2.003-3.412,5.715-5.699,9.96-5.686 c6.324,0.02,11.473,5.194,11.463,11.518c-0.01,6.343-5.155,11.482-11.5,11.482c-2.964,0-5.667-1.122-7.706-2.963 c-0.237-0.214-0.248-0.582-0.022-0.808l0.328-0.328c0.209-0.209,0.545-0.219,0.764-0.021c1.757,1.581,4.083,2.544,6.636,2.544 c5.46,0,9.923-4.421,9.923-9.923c0-5.46-4.421-9.923-9.923-9.923c-3.842,0-7.175,2.183-8.824,5.379h4.558 c0.307,0,0.556,0.249,0.556,0.556v0.464c0,0.307-0.249,0.556-0.556,0.556H0.931c-0.307,0-0.556-0.249-0.556-0.556V1.673 C0.375,1.366,0.624,1.117,0.931,1.117z M15.847,15.735c-0.181,0.249-0.529,0.303-0.777,0.123l-3.936-2.863V5.383 c0-0.307,0.249-0.556,0.556-0.556h0.371c0.307,0,0.556,0.249,0.556,0.556v6.856l3.325,2.418c0.249,0.181,0.303,0.529,0.123,0.777 L15.847,15.735z"/>
</symbol>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment