Commit 2e6736d9 authored by Simon's avatar Simon

Merge branch 'release-1.2.0'

parents 397eeb38 286a0fda
......@@ -20,9 +20,9 @@
## Production
- build CSS & JS assets - `C:\web\dev.biuro\ npm run build`
- build new image `docker build -t biuro/web:1.1.1 .` (update version number)
- build new image `docker build -t biuro/web:1.2.0 .` (update version number)
- login to biuro docker account `docker login --username=biuro --password=9Ndtjd2vKsLvGuFOeFq1KdJs`
- push image to docker repository - `docker push biuro/web:1.1.1`
- push image to docker repository - `docker push biuro/web:1.2.0`
## Production
- update biuro/web image version in .env file (staging or www)
......
......@@ -77,7 +77,17 @@ if ( ! defined( 'WPINC' ) ) die;
<div class="c-form--row">
<div class="c-form--submit-wrap">
<?php
if (isset($attr['page']) && $attr['page'] == 'landing-1'):
?>
<button type="submit" class="o-btn c-btn--main c-btn--fill" name="s" value="1" onclick="ga('send', 'event', 'ContactFormLanding1', 'Button', 'SendContactFormLanding1');"><?php _e('Get a job offer', 'biuro'); ?></button>
<?php
else:
?>
<button type="submit" class="o-btn c-btn--main c-btn--fill" name="s" value="1" onclick="ga('send', 'event', 'ContactFormEmployee', 'Button', 'SendContactFormEmployee');"><?php _e('Submit', 'biuro-contacts'); ?></button>
<?php
endif;
?>
</div>
</div><!-- .c-form--row -->
......
......@@ -42,6 +42,19 @@ if ( ! defined( 'WPINC' ) ) die;
<div class="c-form--row">
<div class="c-form--submit-wrap">
<?php
if (isset($attr['page']) && $attr['page'] == 'landing-1'):
?>
<button type="submit" class="o-btn c-btn--main c-btn--fill" name="s" value="2" onclick="ga('send', 'event', 'ContactFormLanding1', 'Button', 'UpdateContactFormLanding1');"><?php _e('Submit', 'biuro-contacts'); ?></button>
<?php
else:
?>
<button type="submit" class="o-btn c-btn--main c-btn--fill" name="s" value="2" onclick="ga('send', 'event', 'ContactFormEmployee', 'Button', 'UpdateContactFormEmployee');"><?php _e('Submit', 'biuro-contacts'); ?></button>
<?php
endif;
?>
</div>
</div><!-- .c-form--row -->
......@@ -60,8 +60,22 @@ if ( ! defined( 'WPINC' ) ) die;
</div>
<script>
window.dataLayer = window.dataLayer || [];
</script>
<?php
if (isset($attr['page']) && $attr['page'] == 'landing-1'):
?>
<script>
dataLayer.push({'event': 'b2c_form_submit_success_validated', 'label': 'Landing page 1'});
</script>
<?php
else:
?>
<script>
dataLayer.push({'event': 'b2c_form_submit_success_validated', 'label': 'Contact page'});
</script>
<?php
endif;
?>
<?php
unset($_SESSION['employees--s']);
}
......@@ -93,9 +107,22 @@ if ( ! defined( 'WPINC' ) ) die;
</div>
<script>
window.dataLayer = window.dataLayer || [];
</script>
<?php
if (isset($attr['page']) && $attr['page'] == 'landing-1'):
?>
<script>
dataLayer.push({'event': 'b2c_form_update_success_validated', 'label': 'Landing page 1'});
</script>
<?php
else:
?>
<script>
dataLayer.push({'event': 'b2c_form_update_success_validated', 'label': 'Contact page'});
</script>
<?php
endif;
?>
<?php
unset($_SESSION['employees--s']);
}
......
......@@ -37,7 +37,7 @@ class Biuro_HTML extends WP_Widget {
</p>
<p>
<label for="<?php echo esc_attr( $this->get_field_id( 'content' ) ); ?>"><?php _e( 'Content:', 'biuro' ); ?></label>
<textarea class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'content' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'content' ) ); ?>" rows="12"><?php echo wp_kses_post( $content ); ?></textarea>
<textarea class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'content' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'content' ) ); ?>" rows="12"><?php echo $content; ?></textarea>
</p>
<?php }
......@@ -46,7 +46,7 @@ class Biuro_HTML extends WP_Widget {
public function update( $new_instance, $old_instance ) {
$instance = $old_instance;
$instance['title'] = isset( $new_instance['title'] ) ? wp_strip_all_tags( $new_instance['title'] ) : '';
$instance['content'] = isset( $new_instance['content'] ) ? wp_kses_post( $new_instance['content'] ) : '';
$instance['content'] = isset( $new_instance['content'] ) ? $new_instance['content'] : '';
return $instance;
}
......
......@@ -5,6 +5,7 @@ Layout styles (e.g. container, header, main, footer, grid systems etc)
l-: layout classes
========================================================================== */
@import '_layout--body.css';
@import '_layout--inner.css';
@import '_layout--header.css';
@import '_layout--content.css';
......@@ -14,6 +15,3 @@ l-: layout classes
@import '_layout--map.css';
@import '_layout--nav.css';
@import '_layout--section.css';
/* ------------- Layout: body ------------- */
/* critical:start */
.l-body--langing { padding-top: 0 !important;
.u-fill--logo { fill: #fff !important; }
}
/* critical:end */
......@@ -19,9 +19,9 @@
}
&:before { content: ''; position: absolute; top: 0; left: 0; height: 244px; width: 100%; background: linear-gradient(358.45deg, #3C7E9E 0%, #1FB299 100%); }
}
.l-content--position-inner { position: relative; max-width: 970px; margin: 0 auto; border-radius: 3px; background-color: #FFFFFF;
.l-content--position-inner { position: relative; max-width: 970px; margin: 0 auto; border-radius: 3px; background-color: #FFFFFF; box-shadow: 0 1px 31px -23px #6A7481;
@media (--min--medium) {
display: flex; margin: 0 auto 140px; box-shadow: 0 1px 47px 0 #ECF5FF;
display: flex; margin: 0 auto 140px;
}
.l-main { padding: 20px;
......
......@@ -11,4 +11,10 @@
.l-header { position: fixed; top: 0; left: 0; width: 100%; z-index: 300; }
.l-header--langing { position: fixed; top: 0; left: 0; width: 100%; height: 70px; z-index: 300; }
/* critical:end */
.l-header {
.customize-support & { top: 32px; }
}
......@@ -31,11 +31,18 @@
.l-section--inner { max-width: 1030px; margin: 0 auto; }
.l-section--inner { width: 100%; max-width: 1030px; margin: 0 auto; }
.l-section--landing-1 { display: flex; align-items: flex-end; padding: 0 !important; background-color: #515e70; height: 240px;
@media (--min--medium) {
height: 348px;
}
}
/* critical:end */
.l-section { background-repeat: no-repeat; background-position: 50% 50%; background-size: cover; }
.l-section--search-page { background-image: url(/wp-content/themes/biuro/i/search-page.png); }
......@@ -65,39 +72,9 @@
.l-section--sales-page { background-image: url(/wp-content/themes/biuro/i/sales-page.webp); }
}
/*@supports (background-image: -webkit-image-set(url(/wp-content/themes/biuro/i/front-page.webp) 1x)) {
.l-section--search-page { background-image: url(/wp-content/themes/biuro/i/search-page.webp); }
.l-section--vdb { background-image: url(/wp-content/themes/biuro/i/vdb/section.webp); }
.l-section--front-page { background-image: url(/wp-content/themes/biuro/i/front-page.webp); }
.l-section--sales-page { background-image: url(/wp-content/themes/biuro/i/sales-page.webp); }
}*/
/*
.l-section--search-page { background-image: url(/wp-content/themes/biuro/i/search-page.png); }
@supports (background-image: -webkit-image-set(url(/wp-content/themes/biuro/i/search-page.webp) 1x)) {
.l-section--search-page { background-image: url(/wp-content/themes/biuro/i/search-page.webp); }
.l-section--landing-1 { background-image: url(/wp-content/themes/biuro/i/sections/landing-1.jpg); background-position: 0 50%; }
@supports (background-image: -webkit-image-set(url(/wp-content/themes/biuro/i/sections/landing-1.webp) 1x)) {
.l-section--landing-1 { background-image: url(/wp-content/themes/biuro/i/sections/landing-1.webp); }
}
.l-section--vdb { background-image: url(/wp-content/themes/biuro/i/vdb/section.png); }
@supports (background-image: -webkit-image-set(url(/wp-content/themes/biuro/i/vdb/section.webp) 1x)) {
.l-section--vdb { background-image: url(/wp-content/themes/biuro/i/vdb/section.webp); }
}
.l-section--front-page { background-image: url(/wp-content/themes/biuro/i/front-page.png); background-size: 200%;
@media (--min--small) {
background-size: 150%;
}
@media (--min--medium) {
background-size: cover;
}
}
@supports (background-image: -webkit-image-set(url(/wp-content/themes/biuro/i/front-page.webp) 1x)) {
.l-section--front-page { background-image: url(/wp-content/themes/biuro/i/front-page.webp);
}
.l-section--sales-page { background-image: url(/wp-content/themes/biuro/i/sales-page.png); }
@supports (background-image: -webkit-image-set(url(/wp-content/themes/biuro/i/sales-page.webp) 1x)) {
.l-section--sales-page { background-image: url(/wp-content/themes/biuro/i/sales-page.webp); }
}
*/
......@@ -13,6 +13,7 @@ c-: Signify that something is a Component. This is a concrete, implementation-sp
@import '_component--btn.css';
@import '_component--cookies-warning.css';
@import '_component--contact.css';
@import '_component--contact-landing-1.css';
@import '_component--copyright.css';
@import '_component--data-controller.css';
@import '_component--divisions.css';
......
/* ------------- Component: contact section ------------- */
/* critical:start */
.c-contact-landing-1 { padding: 10px 0;
@media (--max--medium) {
max-width: 440px; margin: 0 auto;
}
@media (--min--medium) {
padding: 30px 0 40px;
}
}
.c-contact-landing-1--inner { max-width: 1000px; padding: 0 10px ;margin: 0 auto;
@media (--min--medium) {
display: flex; justify-content: space-between;
}
}
.c-contact-landing-1--content { color: #2A3644; font-weight: 500; line-height: 29px; padding: 15px 0 20px 15px;
@media (--min--medium) {
flex: 1 1 40%; max-width: 500px; padding: 0 0 0 90px;
}
img { max-width: 100%; height: auto; }
}
.c-contact-landing-1--img { margin-top: 40px; }
.c-contact-landing-1--form { max-width: 420px;
@media (--min--medium) {
flex: 1 1 40%; margin-top: -200px;
}
}
/* critical:end */
......@@ -33,4 +33,20 @@
}
}
.c-heading--landing-1 {
h1 { max-width: 230px; color: #fff; font-size: 21px; line-height: 32px; padding: 0 20px;
@media (--min--medium) {
max-width: 500px; font-size: 31px; line-height: 45px;
/*max-width: 117px; color: #fff;*/
}
}
@media (--max--medium) {
max-width: 440px; margin: 0 auto;
}
@media (--min--medium) {
padding-left: 110px;
}
}
/* critical:end */
......@@ -16,4 +16,12 @@
.c-ico--filter { float: left; margin: 3px 15px 0 3px; }
.c-ico--time { float: left; margin: 2px 20px 0 0; }
.c-ico--offer { float: left; margin: 1px 23px 0 0; }
.c-ico--easy { float: left; margin: 0 21px 0 0; }
/* critical:end */
......@@ -29,13 +29,13 @@
.c-jobs-section--list { margin: 0; padding: 0; list-style: none; }
/* critical:end */
.c-jobs-section--item { line-height: 33px; }
.c-jobs-section--item { /* line-height: 33px; */ }
.c-jobs-section--item-active {
.c-jobs-section--anchor { color: #1FB299; }
}
.c-jobs-section--anchor { color: #939393; font-size: 14px; text-decoration: none;
.c-jobs-section--anchor { display: block; color: #939393; font-size: 14px; text-decoration: none; padding: 7px 0; line-height: 19px;
&:hover { text-decoration: underline; }
}
......
......@@ -24,13 +24,14 @@
}
}
.c-search--col { position: relative; flex: 1 1 auto; background-color: #FFFFFF;
@media (--max--medium) {
flex: 0 0 60px;
}
.awesomplete { position: absolute; top: 0; right: 0; left: 0; height: 100%; display: flex; flex-direction: column; }
ul { top: 60px; padding-top: 10px; }
ul { top: 57px; padding-top: 10px; overflow-x: hidden; max-height: 350px; overflow-y: auto; }
li { padding: 10px 15px; margin-bottom: 10px; cursor: pointer;
&:hover { color: #000; }
}
......
......@@ -13,6 +13,8 @@
.u-fill--inherit { fill: currentColor; }
.u-fill--logo { fill: #149A83; }
/* critical:end */
/*
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
<?php
/**
* Template Name: Employees Landing Page I
*
* The employees landing page template file
* Learn more: https://codex.wordpress.org/Template_Hierarchy
*
* @package WordPress
* @subpackage Biuro
* @since 1.0
* @version 1.0
*/
get_header('langing');
?>
<div class="l-section l-section--landing-1">
<div class="l-section--inner">
<?php
while ( have_posts() ) :
?>
<div class="c-heading--landing-1">
<?php
the_post();
the_content();
?>
</div>
<?php
endwhile;
?>
</div>
</div>
<div id="content">
<main id="main" class="l-main">
<div class="c-contact-landing-1">
<div class="c-contact-landing-1--inner">
<div class="c-contact-landing-1--content">
<?php
if ( is_active_sidebar( 'landing_page_employees_1' ) ) :
dynamic_sidebar( 'landing_page_employees_1' );
endif;
?>
<?php
/*
<p>
<svg width="24px" height="24px" class="c-ico--time">
<use xlink:href="#ico--time"></use>
</svg> Kandidatuok per 30 sekundžių
</p>
<p>
<svg width="23px" height="21px" class="c-ico--offer">
<use xlink:href="#ico--offer"></use>
</svg> Gauk darbo pasiūlymą
</p>
<p>
<svg width="23px" height="23px" class="c-ico--easy">
<use xlink:href="#ico--easy"></use>
</svg> Greita, paprasta ir patogu
</p>
*/
?>
<div class="c-contact-landing-1--img">
<picture>
<source srcset="/wp-content/themes/biuro/i/contact.webp" type="image/jpeg">
<img src="/wp-content/themes/biuro/i/contact.png" alt="" width="328" height="95">
</picture>
</div>
</div>
<div class="c-contact-landing-1--form">
<?php
echo do_shortcode('[biuro-contacts--employees page="landing-1"]');
?>
</div>
</div><!-- .c-contact-landing-1--inner -->
</div><!-- .c-contact-landing-1 -->
<?php
if ( is_active_sidebar( 'front_page_feedbacks' ) ) :
dynamic_sidebar( 'front_page_feedbacks' );
endif;
?>
</main><!-- .l-main -->
</div><!-- #content -->
<?php get_footer();
......@@ -59,6 +59,7 @@
&copy; 2012-<?php echo date('Y'); ?> BIURO.
</div>
</div><!-- l-inner -->
</footer><!-- .l-footer -->
<?php
......@@ -87,8 +88,12 @@
<?php
endif;
?>
<script src="/wp-content/themes/biuro/js/main-63c39ea0.min.js" async></script>
<script src="/wp-content/themes/biuro/js/main-ef4b0946.min.js" async></script>
<?php
// global $time_start;
// delog((microtime(true) - $time_start), 'Lorem ipsum');
?>
<?php wp_footer(); ?>
</body>
</html>
......@@ -223,6 +223,24 @@ function biuro_widger_areas() {
'before_title' => '',
'after_title' => '',
) );
register_sidebar( array(
'name' => 'Landing page: Employees 1',
'id' => 'landing_page_employees_1',
'before_widget' => '',
'after_widget' => '',
'before_title' => '',
'after_title' => '',
) );
register_sidebar( array(
'name' => 'Landing page: Employees 2',
'id' => 'landing_page_employees_2',
'before_widget' => '',
'after_widget' => '',
'before_title' => '',
'after_title' => '',
) );
}
add_action( 'widgets_init', 'biuro_widger_areas' );
......@@ -460,7 +478,7 @@ function start_session() {
session_start();
}
if(!isset($_SESSION['referer']) && $_SERVER['HTTP_REFERER'] != null) {
if(!isset($_SESSION['referer']) && $_SERVER['HTTP_REFERER'] !== null) {
$_SESSION['referer'] = $_SERVER['HTTP_REFERER'];
}
}
......@@ -484,7 +502,7 @@ function getDivisions ( $request ) {
while ( $divisions->fetch() ) :
$slug = $divisions->display( 'city.slug' );
if ($lang != pll_get_post_language( $divisions->display( 'ID' ) ) || !$divisions->display( 'lat' ) || !$divisions->display( 'lng' )):
if ($lang !== pll_get_post_language( $divisions->display( 'ID' ) ) || !$divisions->display( 'lat' ) || !$divisions->display( 'lng' )):
continue;
endif;
......@@ -572,11 +590,11 @@ function getPageTerm($keys) {
$val = trim($value);
$taxonomy = substr($val, 20);
if ( '_' == $val{0} || substr($val, 0, 20) != 'built_in_taxonomies_' || !$taxonomy):
if ( '_' == $val{0} || substr($val, 0, 20) !== 'built_in_taxonomies_' || !$taxonomy):
continue;
endif;
$res = get_post_custom_values( $val, $ID );
$res = get_post_custom_values( $val );
if ( !$res ) :
continue;
......@@ -602,7 +620,7 @@ function template_include($template) {
wp_parse_str( $query_string, $searchQuery );
if (!$searchQuery || !$searchQuery['s']):
if (!$searchQuery || !isset($searchQuery['s'])):
return $template;
endif;
......@@ -615,14 +633,13 @@ function template_include($template) {
return $template;
}
// Redirect to single job page by LIVAS Job ID
function livas_job_id_redirect() {
global $query_string;
wp_parse_str( $query_string, $searchQuery );
if ($searchQuery['name'] == 'livas-id' && is_numeric($searchQuery['page'])):
if (isset($searchQuery['name']) && $searchQuery['name'] == 'livas-id' && isset($searchQuery['page']) && is_numeric($searchQuery['page'])):
$jobs = pods( 'job', array(
'where' => 'livas-id.meta_value = "' . $searchQuery['page'] . '"',
......@@ -665,7 +682,7 @@ function jobs_livas_id_search( $wp ) {
global $pagenow;
// If it's not the post listing return
if( 'edit.php' != $pagenow )
if( 'edit.php' !== $pagenow )
return;
// If it's not a search return
......@@ -673,7 +690,7 @@ function jobs_livas_id_search( $wp ) {
return;
// If it's a search but there's no prefix, return
if( '#' != substr( $wp->query_vars['s'], 0, 1 ) )
if( '#' !== substr( $wp->query_vars['s'], 0, 1 ) )
return;
// Validate the numeric value
......@@ -722,3 +739,79 @@ endif;
wp_reset_query();
define('positionsPage', $positionsPage);
function getOptions($taxonomy, $location = '', $str = '') {
global $query_string;
$term = '';
$termID = '';
wp_parse_str( $query_string, $searchQuery );
$pageTerms = getPageTerm(get_post_custom_keys());
if ($pageTerms):
if ($pageTerms->taxonomy === 'city' && ($taxonomy == 'type' || $taxonomy == 'field') || $taxonomy == 'city' && ($pageTerms->taxonomy == 'type' || $pageTerms->taxonomy == 'field')):
return getResults($taxonomy, $pageTerms->taxonomy, $pageTerms->term_id);
endif;
endif;
$location = $location || isset($searchQuery['city']) ? preg_replace('/[\+]/', ' ', $searchQuery['city']) : '';
$search = $str || isset($searchQuery['s']) ? preg_replace('/[\+]/', ' ', $searchQuery['s']) : '';
if ( $location !== '' && $taxonomy !== 'city') :
$city = get_term_by( 'name', $location, 'city' );
if ($city):
return getResults($taxonomy, $city->taxonomy, $city->term_id);
endif;
elseif ( $search !== '' && $taxonomy !== 'field' && $taxonomy !== 'type') :
$field = get_term_by( 'name', $search, 'field' );
if ($field):
return getResults($taxonomy, $field->taxonomy, $field->term_id);
endif;
$type = get_term_by( 'name', $search, 'type' );
if ($type):
return getResults($taxonomy, $type->taxonomy, $type->term_id);
endif;
endif;
return getResults($taxonomy, $term, $termID);
}
function getResults($taxonomy, $term, $termID) {
global $wpdb;
$condition = ($term && $termID) ? " AND `" . $term . "`.`term_id` = " . $termID : '';
$structure = ($term && $termID) ? " LEFT JOIN `wp_term_relationships` AS `rel_term2` ON `rel_term2`.`object_id` = `t`.`ID`
INNER JOIN `wp_term_taxonomy` AS `rel_tt_term2` ON `rel_tt_term2`.`taxonomy` = '" . $term . "' AND `rel_tt_term2`.`term_taxonomy_id` = `rel_term2`.`term_taxonomy_id`
LEFT JOIN `wp_terms` AS `" . $term . "` ON `" . $term . "`.`term_id` = `rel_tt_term2`.`term_id` " : '';
$langs = pll_the_languages(array('raw'=>1));
$langID = $langs[pll_current_language('slug')]['id'];
$prefix = $wpdb->prefix;
$today = date('Y-m-d');
$order = ($taxonomy == 'city') ? 'no DESC' : 'total DESC';
$sql = "SELECT * FROM (SELECT term.name, count(*) as total, CAST(`termmeta`.`meta_value` as INT) as no, `termpage`.`meta_value` as pageID, `term`.`term_id` as termID, `pages`.`post_title` as title, `pages`.`post_status` as status
FROM `{$prefix}posts` AS `t`
LEFT JOIN `{$prefix}postmeta` AS `valid` ON `valid`.`meta_key` = 'valid' AND `valid`.`post_id` = `t`.`ID`
LEFT JOIN `{$prefix}term_relationships` AS `rel_term` ON `rel_term`.`object_id` = `t`.`ID`
INNER JOIN `{$prefix}term_taxonomy` AS `rel_tt_term` ON `rel_tt_term`.`taxonomy` = '{$taxonomy}' AND `rel_tt_term`.`term_taxonomy_id` = `rel_term`.`term_taxonomy_id`
LEFT JOIN `{$prefix}terms` AS `term` ON `term`.`term_id` = `rel_tt_term`.`term_id`
LEFT JOIN `{$prefix}termmeta` AS `termmeta` ON termmeta.term_id = term.term_id AND termmeta.meta_key = 'order'
LEFT JOIN `{$prefix}termmeta` AS `termpage` ON termpage.term_id = term.term_id AND termpage.meta_key = 'page-id'
LEFT JOIN `{$prefix}posts` AS `pages` ON `pages`.`ID` = `termpage`.`meta_value`
{$structure}
LEFT JOIN `{$prefix}term_relationships` AS `polylang_languages` ON `polylang_languages`.`object_id` = `t`.`ID` AND `polylang_languages`.`term_taxonomy_id` = $langID
WHERE ( ( `valid`.`meta_value` >= '{$today}' {$condition} ) AND ( `t`.`post_type` = 'job' ) AND ( `polylang_languages`.`object_id` IS NOT NULL ) AND ( `t`.`post_status` IN ( 'publish' ) ) )
GROUP BY term.name) records
ORDER BY $order, name ASC";
return $wpdb->get_results($sql, ARRAY_A);
}
<?php
// global $time_start;
// $time_start = microtime(true);
?><!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>">
<meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title><?php wp_title(''); ?> | Biuro</title>
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
<link rel="manifest" href="/site.webmanifest">
<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#006957">
<meta name="msapplication-TileColor" content="#ffffff">
<meta name="theme-color" content="#ffffff">
<meta name="google-site-verification" content="Xlpzg6WVpXXrivwjXrOaEzjxZQcPP2x0oCoUizYyCDM" />
<link rel="profile" href="http://gmpg.org/xfn/11">
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>">
<?php
get_template_part( 'template-parts/meta/canonical');
?>
<link rel="preload" as="font" type="font/woff2" href="/wp-content/themes/biuro/fonts/roboto-v19-cyrillic_latin_cyrillic-ext_latin-ext-500.woff2" crossorigin="anonymous" >
<link rel="preload" as="font" type="font/woff2" href="/wp-content/themes/biuro/fonts/roboto-v19-cyrillic_latin_cyrillic-ext_latin-ext-regular.woff2" crossorigin="anonymous" >
<style><?php include 'css/core-bc59262ec6.min.css'; ?></style>
<link rel="preload" as="font" type="font/woff2" href="/wp-content/themes/biuro/fonts/roboto-v19-cyrillic_latin_cyrillic-ext_latin-ext-300.woff2" crossorigin="anonymous" >
<link rel="preload" as="font" type="font/woff2" href="/wp-content/themes/biuro/fonts/roboto-v19-cyrillic_latin_cyrillic-ext_latin-ext-700.woff2" crossorigin="anonymous" >
<link rel="preload" href="/wp-content/themes/biuro/css/main-8758766c96.min.css" as="style" onload="this.rel='stylesheet'">
<noscript>
<link rel="stylesheet" href="/wp-content/themes/biuro/css/main-8758766c96.min.css">
</noscript>
<?php wp_head(); ?>
</head>
<body class="l-body--langing">
<?php include 'template-parts/svg/icons.php'; ?>
<header class="l-header--langing">
<div class="l-inner l-inner--header">
<a href="<?php echo pll_home_url(); ?>" class="c-logo" title="<?php echo get_the_title( get_option('page_on_front') ); ?>">
<svg width="82px" height="49px" class="c-logo--svg">
<use xlink:href="#biuro-logo"></use>
</svg>
</a>
</div>
</header>
This diff is collapsed.
......@@ -250,49 +250,22 @@ function initDivisionsMap (node, data) {
return;
}
const search = document.getElementById('search');
const query = document.getElementById('search-query');
const cityBox = new Awesomplete(city, {
minChars: 0,
maxItems: 1000,
sort: false
// data: (item, input) => {
// console.error('----------');
// console.dir(item);
// console.dir(input);
// return { label: item.value, value: item.name };
// },
// replace: function(text) {
// console.error('text');
// console.dir(text);
// // var hidden = document.querySelector('[name="' + this.input.dataset.name + '"]');
// // this.input.value = text.label;
// // if (!hidden) {
// // return;
// // }
// // hidden.value = text.value;
// // if (hidden.classList.contains('js-trigger-datalist')) {
// // hidden.dispatchEvent(new Event('change', {
// // 'bubbles': true,
// // 'cancelable': true
// // }));
// // }
// // hidden.dispatchEvent(event);
// }
// });
});
city.addEventListener('focus', () => {
cityBox.evaluate();
});
const search = document.getElementById('search');
const query = document.getElementById('search-query');
const queryBox = new Awesomplete(query, {
minChars: 0,
maxItems: 1000,
sort: false
});
......@@ -312,8 +285,9 @@ function initDivisionsMap (node, data) {
})(window);
const swiper = new Swiper('.c-feedbacks--inner', {
speed: 900,
autoplay: {
delay: 4000,
delay: 6000,
disableOnInteraction: false
},
grabCursor: true,
......
......@@ -49,52 +49,18 @@ get_header(); ?>
<div class="c-divisions">
<?php
if ( 1 < $divisions->total() ):
/*
$divisionsPage = new WP_Query( array(
'numberposts' => 1,
'post_type' => 'page',
'meta_key' => 'page',
'meta_value' => 'employees-contacts'
) );
if ( $divisionsPage->have_posts() ) :
while( $divisionsPage->have_posts() ) :
$divisionsPage->the_post();
?>
<a class="c-division <?php if ( $total == 0 ) { echo 'c-division--active'; } ?>" href="<?php the_permalink(); ?>"><?php _e('All', 'biuro'); ?></a>
<?php
endwhile;
else:
*/
?>
<span class="js-division c-division"><?php _e('All', 'biuro'); ?></span>
<?php
/*
endif;
*/
wp_reset_query();
endif;
while ( $divisions->fetch() ) :
$slug = $divisions->display( 'city.slug' );
if ( !in_array($slug, $cities) && $divisions->display( 'name' ) ) :
/*
$page = $divisions->field( 'page-id' );
if ( !empty( $page ) ):
?>
<a class="js-division c-division <?php if ( $pageID == $page['ID'] ) { echo 'c-division--active'; } ?>" data-id="<?php echo $slug; ?>" href="<?php echo esc_url( get_permalink( $page['ID'] ) ); ?>"><?php echo $divisions->display( 'city' ); ?></a>
<?php
else:
*/
?>
<span class="js-division c-division" data-id="<?php echo $slug; ?>"><?php echo $divisions->display( 'city' ); ?></span>
<?php
/*
endif;
*/
array_push($cities, $slug);
endif;
endwhile;
......
......@@ -125,7 +125,7 @@ get_header(); ?>
continue;
endif;
$res = get_post_custom_values( $val, $ID );
$res = get_post_custom_values( $val );
if ( !$res ) :
continue;
......
......@@ -74,7 +74,6 @@ get_header(); ?>
<?php
global $query_string;
$ID = get_the_ID();
$keys = get_post_custom_keys();
$where = 'valid.meta_value > "' . date('Y-m-d', strtotime('-1 days')) . '"';
......@@ -120,7 +119,7 @@ get_header(); ?>
continue;
endif;
$res = get_post_custom_values( $val, $ID );
$res = get_post_custom_values( $val );
if ( !$res ) :
continue;
......
......@@ -26,211 +26,39 @@ if ( get_post_type() == 'page' ):
endif;
?>
<form id="search" class="c-search" action="<?php echo home_url(); ?>" method="get">
<?php
$cities = get_terms( array(
'taxonomy' => 'city',
'orderby' => 'count',
'order' => 'DESC'
));
$res = array();
?>
<div class="c-search--col c-search--col-location">
<svg xmlns="http://www.w3.org/2000/svg" width="15px" height="21px" viewBox="0 0 15 21" class="c-ico--location">
<path fill="#B8BCC1" d="M7.5,4.25c2.068,0,3.75,1.682,3.75,3.75s-1.682,3.75-3.75,3.75S3.75,10.068,3.75,8 S5.432,4.25,7.5,4.25z M7.5,10.5C8.878,10.5,10,9.379,10,8S8.878,5.5,7.5,5.5C6.121,5.5,5,6.622,5,8C5,9.379,6.121,10.5,7.5,10.5z M7.5,0.5C11.642,0.5,15,3.858,15,8c0,3.024-1.054,3.868-6.729,12.096c-0.373,0.538-1.169,0.538-1.542,0C1.054,11.868,0,11.024,0,8 C0,3.858,3.358,0.5,7.5,0.5z M7.5,19.013c5.442-7.87,6.25-8.494,6.25-11.013c0-1.669-0.65-3.239-1.831-4.419 C10.739,2.4,9.169,1.75,7.5,1.75S4.261,2.4,3.081,3.581C1.9,4.761,1.25,6.331,1.25,8C1.25,10.519,2.059,11.144,7.5,19.013z"/>
</svg>
<?php
if ( ! is_wp_error( $cities ) ):
foreach ( $cities as $city ):
$name = $city->name;
$termID = $city->term_id;
$where = 'valid.meta_value > "' . date('Y-m-d', strtotime('-1 days')) . '" AND city.term_id = ' . $termID;
$counter = $where;
if ( $searchQuery['s'] ) :
$field = get_term_by( 'name', preg_replace('/[\+]/', ' ', $searchQuery['s']), 'field' );
$type = get_term_by( 'name', preg_replace('/[\+]/', ' ', $searchQuery['s']), 'type' );
if ( $field ) :
$counter = $counter . ' AND field.term_id = ' . $field->term_id;
elseif ( $type ) :
$counter = $counter . ' AND type.term_id = ' . $type->term_id;
else:
$counter = $counter . ' AND (t.post_title LIKE "%' . $searchQuery['s'] . '%" OR t.post_content LIKE "%' . $searchQuery['s'] . '%")';
endif;
endif;
$params = array(
'where' => $where,
'limit' => -1
);
$jobsIn = pods( 'job', $params );
$custom = array(
'where' => $counter,
'limit' => -1
);
$jobsCounter = pods( 'job', $custom );
if ( 0 < $jobsIn->total() ):
$order = intval(get_term_meta( $termID, 'order', true));
array_push($res, array(
'name' => $name,
'order' => $order,
'total' => $jobsCounter->total()
));
endif;
endforeach;
usort($res, function($a, $b) {
$o = $b['order'] - $a['order'];
if ($o):
return $o;
endif;
return $a['name'] > $b['name'];
});
?>
<datalist id="search-cities">
<?php
foreach ( $res as $r ):
foreach ( getOptions('city') as $r ):
?>
<option value="<?php echo $r['name']; ?>"><?php echo $r['name']; ?> (<?php echo $r['total']; ?>)</option>
<?php
endforeach;
?>
</datalist>
<input list="search-cities" id="search-city" name="city" value="<?php echo ($searchQuery && $searchQuery['city']) ? trim(urldecode($searchQuery['city'])) : ''; ?>" placeholder="<?php _e('Locations', 'biuro'); ?>" class="c-search--input c-search--location" />
<?php
endif;
?>
<input list="search-cities" id="search-city" name="city" value="<?php echo (isset($searchQuery['city'])) ? trim(urldecode($searchQuery['city'])) : ''; ?>" placeholder="<?php _e('Locations', 'biuro'); ?>" class="c-search--input c-search--location" />
</div><!-- .c-search--col c-search--col-location -->
<?php
$options = array();
$types = get_terms( array(
'taxonomy' => 'type',
'orderby' => 'count',
'order' => 'DESC'
));
if ( ! empty( $types ) && ! is_wp_error( $types ) ):
foreach ( $types as $type ):
$name = $type->name;
$termID = $type->term_id;
$where = 'valid.meta_value > "' . date('Y-m-d', strtotime('-1 days')) . '" AND type.term_id = ' . $termID;
$counter = $where;
if ( $searchQuery['city'] ) :
$city = get_term_by( 'name', preg_replace('/[\+]/', ' ', $searchQuery['city']), 'city' );
if ( $city ) :
$counter = $counter . ' AND city.term_id = ' . $city->term_id;
endif;
endif;
$params = array(
'where' => $where,
'limit' => -1
);
$jobsIn = pods( 'job', $params );
$custom = array(
'where' => $counter,
'limit' => -1
);
$jobsTerms = pods( 'job', $custom );
if ( 0 < $jobsIn->total() ):
array_push( $options , array( 'name' => $name, 'total' => $jobsTerms->total() ) );
endif;
endforeach;
endif;
$fields = get_terms( array(
'taxonomy' => 'field',
'orderby' => 'count',
'order' => 'DESC'
));
?>
<div class="c-search--col c-search--col-keyword">
<svg xmlns="http://www.w3.org/2000/svg" width="20px" height="19px" viewBox="0 0 20 19" class="c-ico--area">
<path fill="#B8BCC1" d="M18.125,4.5C19.16,4.5,20,5.339,20,6.375v10c0,1.036-0.839,1.875-1.875,1.875H1.875 C0.839,18.25,0,17.411,0,16.375v-10C0,5.339,0.839,4.5,1.875,4.5H6.25V1.688c0-0.518,0.42-0.937,0.937-0.937h5.625 c0.518,0,0.938,0.42,0.938,0.937V4.5H18.125z M7.5,2v2.5h5V2H7.5z M18.75,16.375V10.75H12.5v1.562c0,0.518-0.42,0.937-0.938,0.937 H8.437c-0.518,0-0.938-0.42-0.938-0.937V10.75H1.25v5.625C1.25,16.72,1.53,17,1.875,17h16.25C18.47,17,18.75,16.72,18.75,16.375z M8.75,12h2.5v-1.25h-2.5V12z M18.75,9.5V6.375c0-0.345-0.28-0.625-0.625-0.625H1.875C1.53,5.75,1.25,6.03,1.25,6.375V9.5H18.75z"/>
</svg>
<?php
if ( ! is_wp_error( $fields ) ):
foreach ( $fields as $field ):
$name = $field->name;
$termID = $field->term_id;
$where = 'valid.meta_value > "' . date('Y-m-d', strtotime('-1 days')) . '" AND field.term_id = ' . $termID;
$counter = $where;
if ( $searchQuery['city'] ) :
$city = get_term_by( 'name', preg_replace('/[\+]/', ' ', $searchQuery['city']), 'city' );
if ( $city ) :
$counter = $counter . ' AND city.term_id = ' . $city->term_id;
endif;
endif;
$params = array(
'where' => $where,
'limit' => -1
);
$jobsIn = pods( 'job', $params );
$custom = array(
'where' => $counter,
'limit' => -1
);
$jobsFields = pods( 'job', $custom );
if ( 0 < $jobsIn->total() ):
array_push( $options , array( 'name' => $name, 'total' => $jobsFields->total() ) );
endif;
endforeach;
usort($options, function($a, $b) {
$t = $b['total'] - $a['total'];
if ($t):
return $t;
endif;
return $a['name'] > $b['name'];
});
?>
<datalist id="search-queries">
<?php
foreach ( $options as $option ):
foreach ( array_merge(getOptions('field'), getOptions('type')) as $option ):
?>
<option value="<?php echo $option['name']; ?>"><?php echo $option['name']; ?> (<?php echo $option['total']; ?>)</option>
<?php
endforeach;
?>
</datalist>
<input list="search-queries" id="search-query" name="s" value="<?php echo ($searchQuery && $searchQuery['s']) ? trim(urldecode($searchQuery['s'])) : ''; ?>" placeholder="<?php _e('Keyword', 'biuro'); ?>" class="c-search--input c-search--keyword" />
<?php
endif;
?>
<input list="search-queries" id="search-query" name="s" value="<?php echo (isset($searchQuery['s'])) ? trim(urldecode($searchQuery['s'])) : ''; ?>" placeholder="<?php _e('Keyword', 'biuro'); ?>" class="c-search--input c-search--keyword" />
</div><!-- .c-search--col c-search--col-keyword -->
<button class="o-btn c-btn--main <?php if ( is_front_page() ): ?>c-btn--search<?php else: ?>c-btn--search-small<?php endif; ?>" type="submit" value="1">
<svg xmlns="http://www.w3.org/2000/svg" width="17px" height="17px" viewBox="0 0 17 17" class="c-ico--search">
......
......@@ -17,6 +17,7 @@ global $jobs;
$i = 0;
while ( $jobs->fetch() ) :
$ID = $jobs->display( 'ID' );
$name = $jobs->display( 'name' );
//Primary city id
$primaryCities = get_post_meta($ID, '_yoast_wpseo_primary_city');
......@@ -25,7 +26,7 @@ global $jobs;
?>
<tr <?php if ( $i % 2 != 0 ) { echo 'class="c-jobs--row-odd"'; } ?>>
<td class="c-jobs--col c-jobs--col-position">
<a class="c-jobs--anchor" href="<?php echo get_post_permalink( $ID ); ?>" title="<?php echo $jobs->display( 'name' ); ?>"><?php echo $jobs->display( 'name' ); ?></a>
<a class="c-jobs--anchor" href="<?php echo get_post_permalink( $ID ); ?>" title="<?php echo $name; ?>"><?php echo $name; ?></a>
</td>
<td class="c-jobs--col c-jobs--col-city">
<?php
......
......@@ -16,112 +16,35 @@ function getPageURL($taxonomy, $pageURL, $searchQuery, $termID) {
return $pageURL;
}
function getSiteTree($taxonomy, $section, $searchQuery) {
$terms = get_terms( array(
'taxonomy' => $taxonomy,
'hide_empty' => false,
));
if ( !empty( $terms ) && ! is_wp_error( $terms ) ):
function getSiteTree($type, $section, $searchQuery, $term) {
$res = array();
$termID = $term != '' ? $term->term_id : '';
if ($searchQuery['city']):
$city = get_term_by( 'name', preg_replace('/[\+]/', ' ', $searchQuery['city']), 'city' );
endif;
if ($searchQuery['s']):
$field = get_term_by( 'name', preg_replace('/[\+]/', ' ', $searchQuery['s']), 'field' );
$type = get_term_by( 'name', preg_replace('/[\+]/', ' ', $searchQuery['s']), 'type' );
endif;
foreach ( $terms as $term ):
$termID = $term->term_id;
$active = false;
$where = 'valid.meta_value > "' . date('Y-m-d', strtotime('-1 days')) . '" AND ' . $taxonomy . '.term_id = ' . $termID;
$counter = $where;
if ($taxonomy == 'city'):
if ( $field ) :
$counter = $counter . ' AND field.term_id = ' . $field->term_id;
elseif ( $type ) :
$counter = $counter . ' AND type.term_id = ' . $type->term_id;
else:
$counter = $counter . ' AND (t.post_title LIKE "%' . $searchQuery['s'] . '%" OR t.post_content LIKE "%' . $searchQuery['s'] . '%")';
endif;
if ( $city && $city->term_id == $termID ) :
$active = true;
endif;
elseif ($taxonomy == 'type' || $taxonomy == 'field'):
if ( $city ) :
$counter = $counter . ' AND city.term_id = ' . $city->term_id;
endif;
if ( $field && $field->term_id == $termID || $type && $type->term_id == $termID) :
$active = true;
endif;
endif;
$params = array(
'where' => $where,
'limit' => -1
);
$jobsIn = pods( 'job', $params );
$custom = array(
'where' => $counter,
'limit' => -1
);
$jobsCounter = pods( 'job', $custom );
if ( 0 < $jobsIn->total() ):
$page = get_term_meta( $termID, 'page-id', true);
$order = intval(get_term_meta( $termID, 'order', true));
if ( $page && $page['post_status'] === 'publish') :
$pages = getOptions($type);
foreach ( $pages as $page ):
if ($page['pageID'] && $page['status'] == 'publish') :
array_push($res, array(
'name' => $page['post_title'],
'href' => getPageURL($taxonomy, get_page_link( $page['ID'] ), $searchQuery, $termID),
'order' => $order,
'total' => $jobsCounter->total(),
'active' => $active
'name' => $page['title'],
'href' => getPageURL($type, get_page_link( $page['pageID'] ), $searchQuery, $page['termID']),
'total' => $page['total'],
'active' => $page['termID'] == $termID ? true : false
));
endif;
endif;
endforeach;
if (count($res) == 0) {
$counter = count($res);
if ($counter == 0) {
return '';
}
usort($res, function($a, $b) {
$o = $b['order'] - $a['order'];
if ($o):
return $o;
endif;
$t = $b['total'] - $a['total'];
if ($t):
return $t;
endif;
return $a['name'] > $b['name'];
});
$classCSS = 'c-jobs-section';
$isClosed = count($res) > 6;
$isClosed = $counter > 3;
if ($isClosed):
$classCSS .= ' c-jobs-section--is-closed';
endif;
echo '<div class="' . $classCSS . '">';
......@@ -145,11 +68,8 @@ function getSiteTree($taxonomy, $section, $searchQuery) {
endif;
echo '</div>';
endif;
}
global $query_string;
wp_parse_str( $query_string, $searchQuery );
......@@ -164,16 +84,28 @@ function getSiteTree($taxonomy, $section, $searchQuery) {
endif;
endif;
$city = '';
$field = '';
$type = '';
if (isset($searchQuery['city'])):
$city = get_term_by( 'name', preg_replace('/[\+]/', ' ', $searchQuery['city']), 'city' );
endif;
if (isset($searchQuery['s'])):
$field = get_term_by( 'name', preg_replace('/[\+]/', ' ', $searchQuery['s']), 'field' );
$type = get_term_by( 'name', preg_replace('/[\+]/', ' ', $searchQuery['s']), 'type' );
endif;
getSiteTree( 'city', __('City', 'biuro'), $searchQuery );
getSiteTree( 'city', __('City', 'biuro'), $searchQuery, $city );
?>
<?php
getSiteTree( 'field', __('Job area', 'biuro'), $searchQuery );
getSiteTree( 'field', __('Job area', 'biuro'), $searchQuery, $field );
?>
<?php
getSiteTree( 'type', __('Job type', 'biuro'), $searchQuery );
getSiteTree( 'type', __('Job type', 'biuro'), $searchQuery, $type );
?>
<?php
......@@ -190,7 +122,7 @@ function getSiteTree($taxonomy, $section, $searchQuery) {
<?php
$VSD = get_term_by( 'slug', 'type-8-lt', 'type' );
$VSD = get_term_by( 'slug', 'type-8-lt', 'type' );
if ($VSD && $VSD->name == $searchQuery['s']): ?>
......
This diff is collapsed.
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