Commit c3bb2896 authored by Simonas's avatar Simonas

in progress

parent cea9a943
/*eslint-disable */
function initializeBiuroMaps() {
;
(function($) {
......
......@@ -2,14 +2,10 @@
/* critical:start */
.l-aside { }
.l-aside--job {
.l-aside {
@media (--min--small) {
flex: 0 0 25%;
flex: 0 0 16.25em;
}
}
.l-aside--page { padding: 1.25em 0; }
/* critical:end */
......@@ -6,11 +6,11 @@ rich design UI styling. Class names here are more specific. This layer usually h
c-: Signify that something is a Component. This is a concrete, implementation-specific piece of UI. All of the changes you make to its styles should be detectable in the context you’re currently looking at. Modifying these styles should be safe and have no side effects.
========================================================================== */
@import '_component--agencies.css';
@import '_component--breadcrumbs.css';
@import '_component--cookies-warning.css';
@import '_component--copy.css';
@import '_component--data-controller.css';
@import '_component--divisions.css';
@import '_component--job.css';
@import '_component--jobs-list.css';
@import '_component--jobs-pagination.css';
......
/* ------------- Component: agencies ------------- */
/* critical:start */
/* critical:end */
.c-agencies--list { display: flex; flex-wrap: wrap; margin-bottom: 16px; }
.c-agencies--list-item { margin-right: 10px; padding: 0 12px; font-weight: var(--typo--weight-regular); line-height: 1.5; cursor: pointer; }
.is-agencies--list-item-active { background: #ccc; font-weight: var(--typo--weight-bold); }
......@@ -4,4 +4,4 @@
/* critical:end */
.c-copy { padding: 15px 0; }
.c-copy { padding-top: 0.75em; text-align: center; }
/* ------------- Component: divisions ------------- */
/* critical:start */
/* critical:end */
.c-divisions--list { display: flex; flex-wrap: wrap; margin-bottom: 16px; }
.c-divisions--list-item { margin-right: 10px; padding: 0 12px; font-weight: var(--typo--weight-regular); line-height: 1.5; cursor: pointer; }
.is-divisions--list-item-active { background: #ccc; font-weight: var(--typo--weight-bold); }
......@@ -4,4 +4,4 @@
/* critical:end */
.c-share { /* margin: 20px 0 15px; */ }
.c-share { /* text-align: center; */ }
:root{--color--gray:#4d4d4d;--color--green:#006957;--typo--font-family:-apple-system,BlinkMacSystemFont,"Segoe UI Light","Roboto","Oxygen","Ubuntu","Cantarell","Fira Sans","Droid Sans","Helvetica Neue",sans-serif;--typo--font-size:1.8rem;--typo--weight-slim:100;--typo--weight-regular:400;--typo--weight-bold:600;--typo--line-height:1.2;--typo--font-face:"PT Sans Narrow",sans-serif;--typo--font-face-additional:"Bebas Neue",sans-serif;--layout-width:63em}html{line-height:1.15;-webkit-text-size-adjust:100%}body{margin:0}html{-webkit-box-sizing:border-box;box-sizing:border-box}*,:after,:before{-webkit-box-sizing:inherit;box-sizing:inherit}a,body{color:#4d4d4d;color:var(--color--gray)}body{font-size:1.8rem;font-size:var(--typo--font-size);line-height:1.2;line-height:var(--typo--line-height)}html{min-height:100%;font-size:62.5%;-webkit-tap-highlight-color:rgba(0,0,0,0)}.l-content,.l-footer,.l-header,.l-inner{max-width:63em;max-width:var(--layout-width);margin-right:auto;margin-left:auto;padding-right:1em;padding-left:1em}.l-header{padding-top:15px;padding-bottom:15px}.l-aside--page{padding:1.25em 0}.o-nav{margin:0;padding:0;list-style:none}.c-cookies-warning{display:none}.c-data-controller{padding:0 1em;text-align:center;font-size:88%}.c-data-controller p{margin-bottom:0}.c-jobs-list{width:100%;margin:0 0 20px}.c-jobs-list--head{padding:10px}.c-jobs-list--col{padding:0 10px}.c-logo--svg{display:block}.c-nav--sub,.u-hidden{display:none}@media (min-width:48em){:root{--typo--font-size:1.6rem;--typo--line-height:1.3}body{font-family:PT Sans Narrow,sans-serif;font-family:var(--typo--font-face)}.l-header{-webkit-box-align:center;-ms-flex-align:center;align-items:center}.l-content,.l-header{display:-webkit-box;display:-ms-flexbox;display:flex}.l-aside--job{-webkit-box-flex:0;-ms-flex:0 0 25%;flex:0 0 25%}.l-main,.l-nav{-webkit-box-flex:1;-ms-flex:1 1 100%;flex:1 1 100%}.c-nav--main{display:-webkit-box;display:-ms-flexbox;display:flex;padding-left:2em}}@media (max-width:47.999em){body{font-family:-apple-system,BlinkMacSystemFont,Segoe UI Light,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;font-family:var(--typo--font-family);letter-spacing:-.08rem}}@media (min-width:30em){.c-jobs-list--col{padding:10px}}@media (max-width:29.999em){.c-jobs-list--col-position{padding-top:10px}}
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
</main><!-- .l-main -->
<?php
if ( !searchQuery && !cityID && get_post_type() == 'job' ):
?>
<aside class="l-aside">
<?php
get_template_part( 'template-parts/layout/aside', 'job' );
?>
</aside><!-- .l-aside -->
<?php
endif;
?>
</div><!-- .l-content -->
<footer class="l-footer">
......@@ -12,6 +22,20 @@
?>
<div class="l-footer--inner">
<div class="l-footer--section">
<ul class="o-nav">
<li><a href="https://dev.biuro.lt/personalo-nuomos-paslaugos/idarbinimo-agentura/" title="Įdarbinimo agentūra" class=" ">Apie įdarbinimo agentūrą</a></li>
<li><a href="https://dev.biuro.lt/personalo-nuomos-paslaugos/darbuotoju-paieska-ir-atranka/" title="Darbuotojų paieška ir atranka" class=" ">Tarptautinis tinklas</a></li>
<li><a href="https://dev.biuro.lt/personalo-nuomos-paslaugos/naryste-lietuvoje/" title="Narystė lietuvoje" class=" ">Narystė lietuvoje</a></li>
<li><a href="https://dev.biuro.lt/personalo-nuomos-paslaugos/etikos-kodeksas/" title="Etikos kodeksas" class=" ">Etikos kodeksas</a></li>
<li><a href="https://dev.biuro.lt/personalo-nuomos-paslaugos/antikorupcines-priemones/" title="Antikorupcinės priemonės" class=" ">Antikorupcinės priemonės</a></li>
</ul>
</div>
<div class="l-footer--section">
<?php
get_template_part( 'template-parts/menus/menu', 'region' );
?>
</div>
<div class="l-footer--section">
<div class="c-share">
<?php
......@@ -20,6 +44,7 @@
if ($social['facebook_site']) :
?>
<a href="https://www.facebook.com/biuro.lietuva" class="icon icon-blue-dark icon-facebook" title="Facebook" target="_blank" rel="noopener" onclick="dataLayer.push({'event': 'socialClick', 'socialLabel': 'FB click'});"></a>
<br>
<?php
endif;
......@@ -29,21 +54,12 @@
<?php
endif;
?>
</div><!-- .c-share -->
<div class="c-copy">&copy; <strong>2012-<?php echo date('Y'); ?> BIURO.</strong></div><!-- .c-copy -->
</div><!-- .l-footer--section -->
<div class="l-footer--section">
<?php
get_template_part( 'template-parts/menus/menu', 'region' );
?>
</div><!-- .l-footer--section -->
<div class="l-footer--section">
</div>
</div>
</div><!-- inner -->
</div><!-- .l-footer--section -->
<div class="c-copy">&copy; <strong>2012-<?php echo date('Y'); ?> BIURO.</strong></div>
</div><!-- .l-footer--inner -->
</footer><!-- .l-footer -->
......@@ -65,6 +81,6 @@
endif;
?>
<script src="/wp-content/themes/biuro/js/main-bd2575b3.min.js" async></script>
<script src="/wp-content/themes/biuro/js/main.min.js" async></script>
</body>
</html>
......@@ -331,3 +331,63 @@ function getSiteTree($taxonomy)
echo '</ul>';
endif;
}
function getDivisions ( $request ) {
$res = array();
$params = $request->get_params();
if ( !$params ) {
exit;
}
$lang = (string) $params['lang'];
$divisions = pods( 'division', array(
'limit' => -1
) );
if ( 0 < $divisions->total() ):
while ( $divisions->fetch() ) :
$slug = $divisions->display( 'city.slug' );
if ($lang != pll_get_post_language( $divisions->display( 'ID' ) ) || !$divisions->display( 'lat' ) || !$divisions->display( 'lng' )):
continue;
endif;
if ( !$res[ $slug ] ) :
$res[ $slug ] = array();
endif;
array_push($res[ $slug ], array(
'title' => $divisions->display( 'title' ),
'content' => $divisions->display( 'content' ),
'lat' => $divisions->display( 'lat' ),
'lng' => $divisions->display( 'lng' ),
) );
endwhile;
endif;
return new WP_REST_Response( $res, 200 );
}
add_action( 'rest_api_init', function () {
register_rest_route( 'biuro-api/v1', '/divisions', array(
'methods' => WP_REST_Server::READABLE,
'callback' => 'getDivisions',
'args' => array(
'lang' => array(
'validate_callback' => function($param, $request, $key) {
return is_string( $param );
}
)
)
));
});
// echo '<h1>Lorem 11: ' . pll_current_language() . '</h1>';
......@@ -31,16 +31,16 @@ define('cityID', $cityID);
get_template_part( 'template-parts/meta/canonical');
?>
<style><?php include 'css/core-69d6ceb7cb.min.css'; ?></style>
<style><?php include 'css/core.min.css'; ?></style>
<link rel="preload" href="/wp-content/themes/biuro/css/main-35c949f725.min.css" as="style" onload="this.rel='stylesheet'">
<link rel="preload" href="/wp-content/themes/biuro/css/main.min.css" as="style" onload="this.rel='stylesheet'">
<link rel="preload" href="/wp-content/themes/biuro/fonts/pt_sans_narrow.woff2" as="font" type="font/woff2" crossorigin>
<link rel="preload" href="/wp-content/themes/biuro/fonts/pt_sans_narrow_bold.woff2" as="font" type="font/woff2" crossorigin>
<link rel="preload" href="/wp-content/themes/biuro/fonts/bebas-neue.woff2" as="font" type="font/woff2" crossorigin>
<noscript>
<link rel="stylesheet" href="/wp-content/themes/biuro/css/main-35c949f725.min.css">
<link rel="stylesheet" href="/wp-content/themes/biuro/css/main.min.css">
</noscript>
<?php wp_head(); ?>
......@@ -73,7 +73,7 @@ define('cityID', $cityID);
?>
</header>
<div class="l-inner" style="box-shadow: inset 0 0 0 1px blue; padding: 1em 0;">
<div class="l-inner" style="box-shadow: inset 0 0 0 1px blue; padding-top: 1em; padding-bottom: 1em;">
<?php
get_search_form();
......@@ -82,17 +82,4 @@ define('cityID', $cityID);
</div>
<div id="main" class="l-content">
<?php
if ( !searchQuery && !cityID && get_post_type() == 'job' ):
?>
<aside class="l-aside">
<?php
get_template_part( 'template-parts/layout/aside', 'job' );
?>
</aside><!-- .l-aside -->
<?php
endif;
?>
<main id="content" class="l-main">
!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/",n(n.s=0)}([function(e,t,n){e.exports=n(1)},function(e,t,n){!function(e){var t=document.getElementById("cookie-warning"),n=document.getElementById("cookie-agree"),r=document.getElementById("cookie-close"),o=!!u()&&localStorage.getItem("biuro-agree");function u(){try{return localStorage.setItem("a","a"),localStorage.removeItem("a"),!0}catch(e){return!1}}t&&n&&r&&!o&&(t.style.display="block",n.addEventListener("click",function(){u()&&localStorage.setItem("biuro-agree","true"),t.style.display="none"}),r.addEventListener("click",function(){t.style.display="none"}))}(window)}]);
\ No newline at end of file
......@@ -57,3 +57,87 @@
if (module.hot) {
module.hot.accept();
}
(global => {
const node = document.getElementById('js-divisions-map');
if (!node) {
return;
}
fetch('/wp-json/biuro-api/v1/divisions?lang=' + node.dataset.lang)
.then((t) => t.json())
.then((data) => {
initDivisionsMap(node, data);
});
})(window);
function setMarkers (map, divisions) {
var info;
var bounds = new window.google.maps.LatLngBounds();
for (var i = 0; i < divisions.length; i++) {
const division = divisions[i];
const pos = new window.google.maps.LatLng(division.lat, division.lng);
var marker = new window.google.maps.Marker({
position: pos,
map: map,
icon: '/wp-content/themes/biuro/i/maps/pin.png',
title: division.title
});
bounds.extend(pos);
marker['content'] = division.content;
window.google.maps.event.addListener(marker, 'click', function () {
if (info) {
info.close();
}
info = new window.google.maps.InfoWindow({
content: this.content
});
info.open(map, this);
});
}
map.fitBounds(bounds);
}
function initDivisionsMap (node, data) {
if (!window.google) {
setTimeout(() => { initDivisionsMap(node, data); }, 250);
return;
}
const map = new window.google.maps.Map(node, {
mapTypeId: window.google.maps.MapTypeId.ROADMAP
});
window.google.maps.event.addListenerOnce(map, 'bounds_changed', function () {
if (this.getZoom() > 15) {
this.setZoom(14);
}
});
let divisions = [];
const region = document.querySelector('.js-active-region');
const ID = (region && region.dataset.id) ? region.dataset.id : '';
if (data[ID]) {
divisions = data[ID];
} else {
Object.keys(data).forEach((key) => {
const division = data[key];
if (key.substr(0, 4) === 'city' ) {
divisions = divisions.concat(division);
}
});
}
setMarkers(map, divisions.filter((d) => { return d.lat && d.lng; }));
}
This source diff could not be displayed because it is too large. You can view the blob instead.
<?php
/**
* Template Name: Agencies listing
* Template Name: Divisions page
*
* This is the page for a Agencies listing with google map
* This is the page for a divisions listing with google map
*
* @link https://codex.wordpress.org/Template_Hierarchy
*
......@@ -49,13 +49,36 @@ get_header(); ?>
if ( 0 < $divisions->total() ):
$cities = array();
?>
<ul class="o-nav c-agencies--list">
<ul class="o-nav c-divisions--list">
<?php
if ( 1 < $divisions->total() ):
$divisionsPage = new WP_Query( array(
'numberposts' => 1,
'post_type' => 'page',
'meta_key' => 'divisions-page',
'meta_value' => 'master'
) );
?>
<li class="js-division c-divisions--list-item <?php if ( $total == 0 ) { echo 'is-divisions--list-item-active'; } ?>" >
<?php
if ( $divisionsPage->have_posts() ) :
while( $divisionsPage->have_posts() ) :
$divisionsPage->the_post();
?>
<a href="<?php the_permalink(); ?>">Visi</a>
<?php
endwhile;
else:
?>
<li class="js-agency c-agencies--list-item <?php if ( $total == 0 ) { echo 'is-agencies--list-item-active'; } ?>" >Visi</li>
Visi
<?php
endif;
?>
</li>
<?php
wp_reset_query();
endif;
while ( $divisions->fetch() ) :
......@@ -64,7 +87,7 @@ get_header(); ?>
if ( !in_array($slug, $cities) && $divisions->display( 'name' ) ) :
$page = $divisions->field( 'page-id' );
?>
<li class="js-agency c-agencies--list-item <?php if ( $pageID == $page['ID'] ) { echo 'is-agencies--list-item-active'; } ?>" data-id="<?php echo $slug; ?>">
<li class="js-division c-divisions--list-item <?php if ( $pageID == $page['ID'] ) { echo 'is-divisions--list-item-active js-active-region'; } ?>" data-id="<?php echo $slug; ?>">
<?php
if ( !empty( $page ) ):
?>
......@@ -85,7 +108,8 @@ get_header(); ?>
endwhile;
?>
</ul>
<div id="js-agencies-map" style="border: 1px solid #666; min-height: 450px;"></div>
<div id="js-divisions-map" data-lang="<?php echo pll_current_language(); ?>" class="" style="border: 1px solid #666; min-height: 450px;"></div>
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyBQjPQnLGLeICbpTTu8kLjVRrLUYYCTS2M" async defer></script>
<?php
endif;
......
......@@ -25,8 +25,6 @@
// 'hide_empty' => false,
));
debug($cities);
if ( ! empty( $cities ) && ! is_wp_error( $cities ) ):
foreach ( $cities as $city ):
$name = $city->name;
......@@ -57,7 +55,11 @@
<input type="text" name="s" id="search" value="<?php echo searchQuery; ?>" />
<input type="submit" value="Ieškoti" class="filter-button" />
<?php
/*
<a href="<?php echo pll_home_url(); ?>" class="filter-button"><?php pll_e('Clear'); ?></a>
*/
?>
</form>
<?php
......
......@@ -41,8 +41,8 @@ get_header();
while ( have_posts() ) :
?>
<div class="biuro-title">
<h1><span><?php the_title(); ?></span></h1>
</div><!-- .biuro-title -->
<h1><?php the_title(); ?></h1>
</div>
<?php
the_post();
......
<h2>Svetainės medis:</h2>
<h3>Darbas + Miestas</h3>
<?php
getSiteTree( 'city' );
?>
<h3>Darbas + Tag'as</h3>
<ul>
<li style="color: red">ToDo: aptarti kaip turi būti LIVAS</li>
</ul>
<h3>Darbas + Sritis</h3>
<br>
<br>
<?php
getSiteTree( 'field' );
?>
<h3>Darbas + Įmonė</h3>
<?php
/*
getSiteTree( 'company' );
*/
?>
</aside><!-- .l-aside -->
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