Commit 7b7e6346 authored by Simonas's avatar Simonas

Search main functionality complete

parent 36742b59
......@@ -17,10 +17,10 @@
- check if dev.biuro.lt, dev.biuro.lv, dev.biuro.ee works
### DB backup
- `C:\web\dev.biuro> docker exec -i mysql mysqldump -uroot -pIiIjnsLi2wR9i1kWVbVpUAzP --default-character-set=utf8 wordpress > docker/mariadb/db_010.sql`
- `C:\web\dev.biuro> docker exec -i mysql mysqldump -uroot -pIiIjnsLi2wR9i1kWVbVpUAzP --default-character-set=utf8 wordpress > docker/mariadb/db_011.sql`
### DB restore
- `C:\web\dev.biuro> docker exec -i mysql mysql -uroot -pIiIjnsLi2wR9i1kWVbVpUAzP --default-character-set=utf8 wordpress < docker/mariadb/db_009.sql`
- `C:\web\dev.biuro> docker exec -i mysql mysql -uroot -pIiIjnsLi2wR9i1kWVbVpUAzP --default-character-set=utf8 wordpress < docker/mariadb/db_010.sql`
## Development
- `C:\web\dev.biuro\wordpress>npm install`
......@@ -35,14 +35,18 @@
### Plugins
#### Akismet Anti-Spam
#### Gutenberg
#### Cookies warning
#### Data controller
#### Gutenberg (not yet)
#### Permalink Manager Lite
#### Pods - Custom Content Types and Fields
#### Polylang
#### Yoast SEO
### SEO
- https://docs.google.com/document/d/1FiwVoiLvGGmi9V-HPBgJ3gsh3wGswt27csgvfdTU24w/edit?usp=sharing
- https://docs.google.com/spreadsheets/d/1ggnqKuGxFFkLgI6NDZq4PXpRY_whdHX0kjZj7pCP_fk/edit?ts=5b5eaa62#gid=0
- https://docs.google.com/spreadsheets/d/1dXP0dh_v2sFajrcwR2_9HONMadCdZQW4Y2dVXvhxG3E/edit?ts=5b5eaa6b#gid=748245000
- [Biuro SEO auditas](https://docs.google.com/document/d/1FiwVoiLvGGmi9V-HPBgJ3gsh3wGswt27csgvfdTU24w/edit?usp=sharing)
- [Biuro raktinių žodžių analizė](https://docs.google.com/spreadsheets/d/1ggnqKuGxFFkLgI6NDZq4PXpRY_whdHX0kjZj7pCP_fk/edit?ts=5b5eaa62#gid=0)
- [Biuro.lt SEO issues](https://docs.google.com/spreadsheets/d/1dXP0dh_v2sFajrcwR2_9HONMadCdZQW4Y2dVXvhxG3E/edit?ts=5b5eaa6b#gid=748245000)
p.s. might not be shared with everyone
......
This diff is collapsed.
......@@ -216,3 +216,10 @@ function init_biuro_theme() {
pll_register_string('biuro-job-search', 'Job search', 'Biuro');
}
add_action('init', 'init_biuro_theme');
$l = get_nav_menu_locations();
$m = $l ? wp_get_nav_menu_object( $l[ 'main-menu' ] ) : null;
$items = $m ? wp_get_nav_menu_items( $m->term_id, array( 'order' => 'DESC' ) ) : array();
$searchPageURL = $items[0] ? $items[0]->url : '/';
......@@ -36,8 +36,6 @@
</symbol>
</svg>
<div id="main" class="main">
<div id="top">
......@@ -51,13 +49,13 @@
</div>
<div id="topsearch">
<form role="form" id="top-search-form" action="/darbo-pasiulymai/" method="get" enctype="application/x-www-form-urlencoded">
<label for="search"><?php pll_e('Job search'); ?></label>
<div id="search-input-block">
<input type="text" name="search" id="search" value="" class="input text nolabel" />
<input aria-label="Ieškoti" type="submit" id="filter-action" name="action_results" value="" class="submit action" />
</div>
</form>
<?php
global $searchPageURL;
if ( get_permalink() != $searchPageURL ):
get_search_form();
endif;
?>
</div>
<?php
......
......@@ -19,9 +19,6 @@ get_header(); ?>
<?php
// Use for search
// https://pods.io/docs/code/pods/find/
while ( have_posts() ) :
the_post();
......
<?php
/**
* Template Name: Search Page
*
* @link https://codex.wordpress.org/Template_Hierarchy
*
* @package WordPress
* @subpackage Biuro
* @since 1.0
* @version 1.0
*/
?>
<?php
get_header();
$search = get_query_var('search');
$cityID = get_query_var('city');
$periodID = get_query_var('period');
$fieldID = get_query_var('field');
$typeID = get_query_var('type');
// function print()
// $cities = get_terms( 'city', array(
// 'hide_empty' => false,
// ));
// debug($cityID)
// if ( ! empty( $terms ) && ! is_wp_error( $terms ) ){
// echo '<ul>';
// foreach ( $terms as $term ) {
// echo '<li>' . $term->name . '</li>';
// }
// echo '</ul>';
// }
?>
<form id="filter-form" action="<?php echo esc_url( $searchPageURL ); ?>" method="get" enctype="application/x-www-form-urlencoded">
<ul class="search_box">
<li>
<label for="label">Paieška:</label>
<div id="search-input-block">
<input type="text" name="search" id="search" value="<?php echo $search; ?>" class="input text nolabel" />
<button aria-label="Ieškoti" type="submit" id="filter-action" class="submit action" ></button>
</div>
<a href="/darbo-pasiulymai/#" id="filter-expand" class="url close">Išplėstinė paieška</a></li>
<li class="filter-additional">
<label for="city">Miestas:</label>
<select name="city" id="city" class="el_130">
<option value="">Visi miestai</option>
<?php
$cities = get_terms( 'city', array(
'hide_empty' => false,
));
if ( ! empty( $cities ) && ! is_wp_error( $cities ) ):
foreach ( $cities as $city ):
$name = $city->name;
$termID = $city->term_id;
$selected = ($cityID == $termID) ? 'selected="selected"' : '';
?>
<option value="<?php echo $termID; ?>" <?php echo $selected; ?>><?php echo $name; ?></option>
<?php
endforeach;
endif;
?>
</select>
<label for="period" style="opacity: 0.45">Laikotarpis:</label>
<select name="period" id="period" class="el_130" style="opacity: 0.45">
<option value="">Nesvarbu</option>
<option value="1">Šiandienos</option>
<option value="7">Savaitės</option>
<option value="30">Mėnesio</option>
</select>
</li>
<li class="filter-additional">
<label for="field">Darbo sritis:</label>
<select name="field" id="field" class="el_130">
<option value="">Visos sritys</option>
<?php
$fields = get_terms( 'field', array(
'hide_empty' => false,
));
if ( ! empty( $fields ) && ! is_wp_error( $fields ) ):
foreach ( $fields as $field ):
$name = $field->name;
$termID = $field->term_id;
$selected = ($fieldID == $termID) ? 'selected="selected"' : '';
?>
<option value="<?php echo $termID; ?>" <?php echo $selected; ?>><?php echo $name; ?></option>
<?php
endforeach;
endif;
?>
</select>
<label for="type">Darbo rūšis:</label>
<select name="type" id="type" class="el_130">
<option value="">Visos rūšys</option>
<?php
$types = get_terms( 'type', array(
'hide_empty' => false,
));
if ( ! empty( $types ) && ! is_wp_error( $types ) ):
foreach ( $types as $type ):
$name = $type->name;
$termID = $type->term_id;
$selected = ($typeID == $termID) ? 'selected="selected"' : '';
?>
<option value="<?php echo $termID; ?>" <?php echo $selected; ?>><?php echo $name; ?></option>
<?php
endforeach;
endif;
?>
</select>
<input type="button" value="Ieškoti" name="find" id="find" class="filter-button">
<input type="button" value="Išvalyti" name="find" data-href="<?php echo esc_url( $searchPageURL ); ?>" id="reset-filter" class="filter-button">
</li>
</ul>
</form>
<?php
// Use for search
// https://pods.io/docs/code/pods/find/
$where = 't.post_title LIKE "%' . $search . '%"';
// 'where' => 't.post_title LIKE "%' . $keyword . '%" OR my_field.meta_value LIKE "%' . $keyword . '%"'
if ($cityID):
$where = $where . ' AND city.term_id = ' . $cityID;
endif;
if ($fieldID):
$where = $where . ' AND field.term_id = ' . $fieldID;
endif;
if ($typeID):
$where = $where . ' AND type.term_id = ' . $typeID;
endif;
$params = array(
'where' => $where,
'limit' => -1
);
$jobs = pods( 'job', $params );
if ( 0 < $jobs->total() ):
$i = 0;
?>
<table cellspacing="0" cellpadding="0" class="advert_table">
<tr>
<th>Pozicija </th>
<th>Vietovė</th>
<th>Data</th>
<th>Rūšis</th>
</tr>
<?php
while ( $jobs->fetch() ) :
$i++;
?>
<tr <?php if ( $i % 2 == 0 ) { echo 'class="bg"'; } ?>>
<td>
<a href="<?php echo get_post_permalink( $jobs->display( 'ID' ) ); ?>" target="_blank" title="<?php echo $jobs->display( 'name' ); ?>">
<strong><?php echo $jobs->display( 'name' ); ?></strong>
</a>
</td>
<td>
<span style="opacity: 0.25;">Šiauliai</span>
</td>
<td>
<span style="opacity: 0.25;">Paskelbta: 2018 11 30 <br> Galioja iki: 2018 12 28</span>
</td>
<td>
<span style="opacity: 0.25;">Nuolatinis darbas</span>
</td>
</tr>
<?php
endwhile;
?>
</table>
<?php
endif;
?>
<?php get_footer();
<?php
/**
* Template for displaying search form in Biuro
*
* @package WordPress
* @subpackage Biuro
* @since 1.0
* @version 1.0
*/
global $searchPageURL
?>
<form role="search" id="top-search-form" action="<?php echo esc_url( $searchPageURL ); ?>" method="get">
<label for="search"><?php pll_e('Job search'); ?></label>
<div id="search-input-block">
<input type="text" name="search" id="search" value="" class="input text nolabel" />
<button aria-label="Ieškoti" type="submit" id="filter-action" class="submit action" ></button>
</div>
</form>
......@@ -28,8 +28,6 @@ get_header('job'); ?>
<p>BIURO - padedame, kai labiausiai reikia. Paprastas ir greitas laikinasis įdarbinimas.</p>
</div><!-- .biuro-header -->
<?php
while ( have_posts() ) :
?>
......
import gulp from 'gulp'
import browser from 'browser-sync'
import webpack from 'webpack'
import gulp from 'gulp';
import browser from 'browser-sync';
import webpack from 'webpack';
import webpackDevMiddleware from 'webpack-dev-middleware'
import webpackDevMiddleware from 'webpack-dev-middleware';
import webpackHotMiddleware from 'webpack-hot-middleware'
import webpackHotMiddleware from 'webpack-hot-middleware';
import { config } from './webpack'
import { config } from './webpack';
const bs = browser.create()
import { serveHTML } from './serve-html';
const bundler = webpack(config)
import { servePHP } from './serve-php';
import { serveHTML } from './serve-html'
import { serveImages } from './serve-images';
import { servePHP } from './serve-php'
import { serveOur, serveRoot } from './serve-source';
import { serveImages } from './serve-images'
import { serveCoreCSS } from './serve-css--core';
import { serveOur, serveRoot } from './serve-source'
import { serveMainCSS } from './serve-css--main';
import { serveCoreCSS } from './serve-css--core'
import { serveMainCSS } from './serve-css--main'
const bs = browser.create();
const bundler = webpack(config);
// import modRewrite from 'connect-modrewrite';
export function server() {
// "browserSync": "browser-sync start --proxy 'local.dev:3000' --open 'external' --host 'local.dev' --port 3001 --files 'source' 'admin' 'public' --color"
export function server () {
bs.init({
// server: '../wp-content/themes/biuro',
proxy: 'https://dev.biuro.lt',
......@@ -41,44 +36,39 @@ export function server() {
// // cert: '../../certs/live/dev.biuro.lt/certificate.pem'
// cert: '../../certs/dev/fullchain.crt'
// },
host: 'dev.biuro.lt',
open: false,
port: 2000,
ui: false,
middleware: [
webpackDevMiddleware(bundler, { /* options */
publicPath: '../wp-content/themes/biuro',
publicPath: '../wp-content/themes/biuro'
}),
webpackHotMiddleware(bundler),
webpackHotMiddleware(bundler)
// modRewrite([
// '^[^\\.]*$ /index.html [L]',
// // '^/wp-json/our-wp-api/v1/(.*)$ https://town.ourdemo.eu/wp-json/our-wp-api/v1/$1 [P]',
// // '^http://town.loc.al/wp-content/uploads/2018/03/(.*)$ https://town.ourdemo.eu/wp-content/uploads/2018/03/$1 [P]',
// ]),
]
})
// http://town.loc.al/wp-json/our-wp-api/v1/menus
});
gulp.watch('./i/**/*.*', gulp.series(serveImages));
gulp.watch('./i/**/*.*', { usePolling: true }, gulp.series(serveImages));
gulp.watch(['./source/biuro/**/*.*', './source/root/**/*.*'], gulp.series(serveOur, serveRoot));
gulp.watch(['./source/biuro/**/*.*', './source/root/**/*.*'], { usePolling: true }, gulp.series(serveOur, serveRoot));
gulp.watch('./php/**/*.php', gulp.series(servePHP));
gulp.watch('./php/**/*.php', { usePolling: true }, gulp.series(servePHP));
// gulp.watch(['./*.html', './source/**/*.*', '!./source/biuro/**/*.*', '!./source/root/**/*.*', '../wp-content/themes/biuro/css/core.min.css'], gulp.series(serveHTML));
gulp.watch(['./source/**/*.*', '!./source/biuro/**/*.*', '!./source/root/**/*.*', '../wp-content/themes/biuro/css/core.min.css'], gulp.series(servePHP));
gulp.watch(['./source/**/*.*', '!./source/biuro/**/*.*', '!./source/root/**/*.*', '../wp-content/themes/biuro/css/core.min.css'], { usePolling: true }, gulp.series(servePHP));
gulp.watch(['./*.html', './source/content/*.*', '../wp-content/themes/biuro/css/core.min.css'], gulp.series(serveHTML));
gulp.watch(['./*.html', './source/content/*.*', '../wp-content/themes/biuro/css/core.min.css'], { usePolling: true }, gulp.series(serveHTML));
gulp.watch(['./css/**/*.css'], gulp.parallel(serveCoreCSS, serveMainCSS));
gulp.watch(['./css/**/*.css'], { usePolling: true }, gulp.parallel(serveCoreCSS, serveMainCSS));
gulp.watch('../wp-content/themes/biuro/**/*.php').on('change', () => bs.reload() );
gulp.watch('../wp-content/themes/biuro/**/*.php').on('change', () => bs.reload());
gulp.watch('../wp-content/themes/biuro/js/*.js').on('change', () => bs.reload() );
gulp.watch('../wp-content/themes/biuro/js/*.js').on('change', () => bs.reload());
gulp.watch('../wp-content/themes/biuro/css/main.min.css').on('change', () => bs.reload('*.css'));
}
......@@ -1362,4 +1362,4 @@ msgstr "Спам"
#: wp-admin/includes/class-wp-ms-sites-list-table.php:39
#: wp-admin/network/site-info.php:173
msgid "Archived"
msgstr "Заархивирован"
msgstr "Заархивирован"
\ No newline at end of file
......@@ -2,7 +2,7 @@
# This file is distributed under the same license as the Plugins - Yoast SEO - Stable (latest release) package.
msgid ""
msgstr ""
"PO-Revision-Date: 2018-11-20 09:16:32+0000\n"
"PO-Revision-Date: 2018-11-30 15:45:30+0000\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
......@@ -2442,7 +2442,7 @@ msgstr "Активирован"
#. translators: %1$s expands to Yoast
#: admin/views/sidebar.php:16
msgid "%1$s recommendations for you"
msgstr "%1s рекомендаций для вас"
msgstr "%1$s рекомендует"
#: admin/class-meta-columns.php:231
msgid "All Readability Scores"
......
......@@ -12635,4 +12635,4 @@ msgstr "Похоже, на вашем сайте ещё нет никакого
#: wp-includes/class-wp-customize-manager.php:5282
msgid "Screen reader users: when in forms mode, you may need to press the escape key twice."
msgstr "Пользователям программ чтения с экрана: в режиме форм вам возможно придётся нажать кнопку Esc дважды."
msgstr "Пользователям программ чтения с экрана: в режиме форм вам возможно придётся нажать кнопку Esc дважды."
\ No newline at end of file
this.wp=this.wp||{},this.wp.blockSerializationDefaultParser=function(n){var t={};function r(e){if(t[e])return t[e].exports;var u=t[e]={i:e,l:!1,exports:{}};return n[e].call(u.exports,u,u.exports,r),u.l=!0,u.exports}return r.m=n,r.c=t,r.d=function(n,t,e){r.o(n,t)||Object.defineProperty(n,t,{configurable:!1,enumerable:!0,get:e})},r.r=function(n){Object.defineProperty(n,"__esModule",{value:!0})},r.n=function(n){var t=n&&n.__esModule?function(){return n.default}:function(){return n};return r.d(t,"a",t),t},r.o=function(n,t){return Object.prototype.hasOwnProperty.call(n,t)},r.p="",r(r.s=339)}({25:function(n,t,r){"use strict";var e=r(35);var u=r(34);function o(n,t){return Object(e.a)(n)||function(n,t){var r=[],e=!0,u=!1,o=void 0;try{for(var i,c=n[Symbol.iterator]();!(e=(i=c.next()).done)&&(r.push(i.value),!t||r.length!==t);e=!0);}catch(n){u=!0,o=n}finally{try{e||null==c.return||c.return()}finally{if(u)throw o}}return r}(n,t)||Object(u.a)()}r.d(t,"a",function(){return o})},339:function(n,t,r){"use strict";r.r(t),r.d(t,"parse",function(){return f});var e,u,o,i,c=r(25),s=/<!--\s+(\/)?wp:([a-z][a-z0-9_-]*\/)?([a-z][a-z0-9_-]*)\s+({(?:[^}]+|}+(?=})|(?!}\s+-->)[^])*?}\s+)?(\/)?-->/g;function l(n,t,r,e,u){return{blockName:n,attrs:t,innerBlocks:r,innerHTML:e,innerContent:u}}function a(n){return l(null,{},[],n,[n])}var f=function(n){e=n,u=0,o=[],i=[],s.lastIndex=0;do{}while(p());return o};function p(){var n=function(){var n=s.exec(e);if(null===n)return["no-more-tokens"];var t=n.index,r=Object(c.a)(n,6),u=r[0],o=r[1],i=r[2],l=r[3],a=r[4],f=r[5],p=u.length,b=!!o,v=!!f,h=(i||"core/")+l,k=!!a,d=k?function(n){try{return JSON.parse(n)}catch(n){return null}}(a):{};if(v)return["void-block",h,d,t,p];if(b)return["block-closer",h,null,t,p];return["block-opener",h,d,t,p]}(),t=Object(c.a)(n,5),r=t[0],f=t[1],p=t[2],k=t[3],d=t[4],O=i.length,g=k>u?u:null;switch(r){case"no-more-tokens":if(0===O)return b(),!1;if(1===O)return h(),!1;for(;0<i.length;)h();return!1;case"void-block":return 0===O?(null!==g&&o.push(a(e.substr(g,k-g))),o.push(l(f,p,[],"",[])),u=k+d,!0):(v(l(f,p,[],"",[]),k,d),u=k+d,!0);case"block-opener":return i.push(function(n,t,r,e,u){return{block:n,tokenStart:t,tokenLength:r,prevOffset:e||t+r,leadingHtmlStart:u}}(l(f,p,[],"",[]),k,d,k+d,g)),u=k+d,!0;case"block-closer":if(0===O)return b(),!1;if(1===O)return h(k),u=k+d,!0;var y=i.pop(),w=e.substr(y.prevOffset,k-y.prevOffset);return y.block.innerHTML+=w,y.block.innerContent.push(w),y.prevOffset=k+d,v(y.block,y.tokenStart,y.tokenLength,k+d),u=k+d,!0;default:return b(),!1}}function b(n){var t=n||e.length-u;0!==t&&o.push(a(e.substr(u,t)))}function v(n,t,r,u){var o=i[i.length-1];o.block.innerBlocks.push(n);var c=e.substr(o.prevOffset,t-o.prevOffset);c&&(o.block.innerHTML+=c,o.block.innerContent.push(c)),o.block.innerContent.push(null),o.prevOffset=u||t+r}function h(n){var t=i.pop(),r=t.block,u=t.leadingHtmlStart,c=t.prevOffset,s=t.tokenStart,l=n?e.substr(c,n-c):e.substr(c);l&&(r.innerHTML+=l,r.innerContent.push(l)),null!==u&&o.push(a(e.substr(u,s-u))),o.push(r)}},34:function(n,t,r){"use strict";function e(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}r.d(t,"a",function(){return e})},35:function(n,t,r){"use strict";function e(n){if(Array.isArray(n))return n}r.d(t,"a",function(){return e})}});
\ No newline at end of file
this.wp=this.wp||{},this.wp.blockSerializationDefaultParser=function(n){var t={};function r(e){if(t[e])return t[e].exports;var u=t[e]={i:e,l:!1,exports:{}};return n[e].call(u.exports,u,u.exports,r),u.l=!0,u.exports}return r.m=n,r.c=t,r.d=function(n,t,e){r.o(n,t)||Object.defineProperty(n,t,{configurable:!1,enumerable:!0,get:e})},r.r=function(n){Object.defineProperty(n,"__esModule",{value:!0})},r.n=function(n){var t=n&&n.__esModule?function(){return n.default}:function(){return n};return r.d(t,"a",t),t},r.o=function(n,t){return Object.prototype.hasOwnProperty.call(n,t)},r.p="",r(r.s=339)}({25:function(n,t,r){"use strict";var e=r(35);var u=r(34);function o(n,t){return Object(e.a)(n)||function(n,t){var r=[],e=!0,u=!1,o=void 0;try{for(var i,c=n[Symbol.iterator]();!(e=(i=c.next()).done)&&(r.push(i.value),!t||r.length!==t);e=!0);}catch(n){u=!0,o=n}finally{try{e||null==c.return||c.return()}finally{if(u)throw o}}return r}(n,t)||Object(u.a)()}r.d(t,"a",function(){return o})},339:function(n,t,r){"use strict";r.r(t),r.d(t,"parse",function(){return f});var e,u,o,i,c=r(25),s=/<!--\s+(\/)?wp:([a-z][a-z0-9_-]*\/)?([a-z][a-z0-9_-]*)\s+({(?:(?=([^}]+|}+(?=})|(?!}\s+\/?-->)[^])*)\5|[^]*?)}\s+)?(\/)?-->/g;function l(n,t,r,e,u){return{blockName:n,attrs:t,innerBlocks:r,innerHTML:e,innerContent:u}}function a(n){return l(null,{},[],n,[n])}var f=function(n){e=n,u=0,o=[],i=[],s.lastIndex=0;do{}while(p());return o};function p(){var n=function(){var n=s.exec(e);if(null===n)return["no-more-tokens"];var t=n.index,r=Object(c.a)(n,7),u=r[0],o=r[1],i=r[2],l=r[3],a=r[4],f=r[6],p=u.length,b=!!o,v=!!f,h=(i||"core/")+l,k=!!a,d=k?function(n){try{return JSON.parse(n)}catch(n){return null}}(a):{};if(v)return["void-block",h,d,t,p];if(b)return["block-closer",h,null,t,p];return["block-opener",h,d,t,p]}(),t=Object(c.a)(n,5),r=t[0],f=t[1],p=t[2],k=t[3],d=t[4],O=i.length,g=k>u?u:null;switch(r){case"no-more-tokens":if(0===O)return b(),!1;if(1===O)return h(),!1;for(;0<i.length;)h();return!1;case"void-block":return 0===O?(null!==g&&o.push(a(e.substr(g,k-g))),o.push(l(f,p,[],"",[])),u=k+d,!0):(v(l(f,p,[],"",[]),k,d),u=k+d,!0);case"block-opener":return i.push(function(n,t,r,e,u){return{block:n,tokenStart:t,tokenLength:r,prevOffset:e||t+r,leadingHtmlStart:u}}(l(f,p,[],"",[]),k,d,k+d,g)),u=k+d,!0;case"block-closer":if(0===O)return b(),!1;if(1===O)return h(k),u=k+d,!0;var y=i.pop(),w=e.substr(y.prevOffset,k-y.prevOffset);return y.block.innerHTML+=w,y.block.innerContent.push(w),y.prevOffset=k+d,v(y.block,y.tokenStart,y.tokenLength,k+d),u=k+d,!0;default:return b(),!1}}function b(n){var t=n||e.length-u;0!==t&&o.push(a(e.substr(u,t)))}function v(n,t,r,u){var o=i[i.length-1];o.block.innerBlocks.push(n);var c=e.substr(o.prevOffset,t-o.prevOffset);c&&(o.block.innerHTML+=c,o.block.innerContent.push(c)),o.block.innerContent.push(null),o.prevOffset=u||t+r}function h(n){var t=i.pop(),r=t.block,u=t.leadingHtmlStart,c=t.prevOffset,s=t.tokenStart,l=n?e.substr(c,n-c):e.substr(c);l&&(r.innerHTML+=l,r.innerContent.push(l)),null!==u&&o.push(a(e.substr(u,s-u))),o.push(r)}},34:function(n,t,r){"use strict";function e(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}r.d(t,"a",function(){return e})},35:function(n,t,r){"use strict";function e(n){if(Array.isArray(n))return n}r.d(t,"a",function(){return e})}});
\ No newline at end of file
== Changelog ==
= 4.6.1 =
* Parser: Make attribute parsing possessive (Fix High CPU usage).
= 4.6.0 =
* Fix issue with drag-and-drop in columns.
* Fix TinyMCE list plugin registration.
* Fix IE11 flexbox alignment when min-width is set.
* Fix IE11 focus loss after TinyMCE init. Add IE check.
* Fix getSelectedBlockClientId selector.
* Fix issue where unregistering a block type would cause blocks that convert to it to break.
* Fix Classic block not showing galleries on a grid.
* Fix visual issues with Button block text wrap.
* Fix modals in Edge.
* Fix Categories block filter effect on the front-end.
* Fix an issue where the block toolbar would cause an image to jump downwards when the wide or full - alignments were activated.
* Apply IE11 input fix only when mounting TinyMCE.
* Improve block preview styling.
* Make the Image Link URL field readonly.
* Disable HTML edit from Media & Text block.
* Avoid loading theme editor styles if not existing (RTL languages).
* Improve scoping of nested paragraph right-padding CSS rule.
* Add e2e tests for the format API.
* Merge similar text strings for i18n.
* Move editor specific styles from style.scss to editor.scss in Cover block.
* Simplify sidebar tabs aria-labels.
* Remove onSplit from RichText docs.
* Remove textdomain from the block library.
* Avoid rendering AdminNotices compatibility component.
* Avoid changing default wpautop priority.
* Change @package names to WordPress.
* Update published packages changelogs.
= 4.5.1 =
* Raw Handling: fix consecutive lists with one item
......
......@@ -3,15 +3,15 @@
* Plugin Name: Gutenberg
* Plugin URI: https://github.com/WordPress/gutenberg
* Description: Printing since 1440. This is the development plugin for the new block editor in core.
* Version: 4.5.1
* Version: 4.6.1
* Author: Gutenberg Team
*
* @package gutenberg
*/
### BEGIN AUTO-GENERATED DEFINES
define( 'GUTENBERG_VERSION', '4.5.1' );
define( 'GUTENBERG_GIT_COMMIT', '66d901e641423d7259894d3d2664f9f8872e3d85' );
define( 'GUTENBERG_VERSION', '4.6.1' );
define( 'GUTENBERG_GIT_COMMIT', '7e27b6438841d57ef71b8897ad2a205ec78166e1' );
### END AUTO-GENERATED DEFINES
gutenberg_pre_init();
......
......@@ -187,6 +187,7 @@ $generated_i18n_strings = array(
__( 'Columns', 'gutenberg' ),
// Reference: packages/block-library/build-module/cover/index.js:283
// Reference: packages/block-library/build-module/media-text/media-container.js:46
__( 'Edit media', 'gutenberg' ),
// Reference: packages/block-library/build-module/cover/index.js:289
......@@ -684,9 +685,6 @@ $generated_i18n_strings = array(
// Reference: packages/block-library/build-module/media-text/index.js:69
__( 'Set media and words side-by-side for a richer layout.', 'gutenberg' ),
// Reference: packages/block-library/build-module/media-text/media-container.js:46
__( 'Edit Media', 'gutenberg' ),
// Reference: packages/block-library/build-module/media-text/media-container.js:89
__( 'Media area', 'gutenberg' ),
......@@ -1402,14 +1400,14 @@ $generated_i18n_strings = array(
// Reference: packages/edit-post/build-module/plugins/keyboard-shortcuts-help-menu-item/index.js:19
__( 'Keyboard Shortcuts', 'gutenberg' ),
// Reference: packages/edit-post/build-module/components/layout/index.js:60
// Reference: packages/edit-post/build-module/components/layout/index.js:59
/* translators: accessibility text for the publish landmark region. */
__( 'Editor publish', 'gutenberg' ),
// Reference: packages/edit-post/build-module/components/layout/index.js:70
// Reference: packages/edit-post/build-module/components/layout/index.js:69
__( 'Editor content', 'gutenberg' ),
// Reference: packages/edit-post/build-module/components/layout/index.js:94
// Reference: packages/edit-post/build-module/components/layout/index.js:93
__( 'Open publish panel', 'gutenberg' ),
// Reference: packages/edit-post/build-module/components/options-modal/index.js:40
......@@ -1475,24 +1473,17 @@ $generated_i18n_strings = array(
// Reference: packages/edit-post/build-module/components/sidebar/post-visibility/index.js:15
__( 'Visibility', 'gutenberg' ),
// Reference: packages/edit-post/build-module/components/sidebar/settings-header/index.js:20
__( 'Block', 'gutenberg' ),
// Reference: packages/edit-post/build-module/components/sidebar/settings-header/index.js:23
/* translators: ARIA label for the Document Settings sidebar tab, selected. */
__( 'Document settings (selected)', 'gutenberg' ),
// Reference: packages/edit-post/build-module/components/sidebar/settings-header/index.js:24
/* translators: ARIA label for the Document Settings sidebar tab, not selected. */
__( 'Document settings', 'gutenberg' ),
/* translators: ARIA label for the Document sidebar tab, selected. */
__( 'Document (selected)', 'gutenberg' ),
// Reference: packages/edit-post/build-module/components/sidebar/settings-header/index.js:30
/* translators: ARIA label for the Block Settings sidebar tab, selected. */
__( 'Block settings (selected)', 'gutenberg' ),
/* translators: ARIA label for the Block sidebar tab, selected. */
__( 'Block (selected)', 'gutenberg' ),
// Reference: packages/edit-post/build-module/components/sidebar/settings-header/index.js:31
/* translators: ARIA label for the Block Settings sidebar tab, not selected. */
__( 'Block settings', 'gutenberg' ),
/* translators: ARIA label for the Block sidebar tab, not selected. */
__( 'Block', 'gutenberg' ),
// Reference: packages/edit-post/build-module/components/sidebar/settings-header/index.js:38
__( 'Close settings', 'gutenberg' ),
......
......@@ -242,6 +242,7 @@ msgid "Columns"
msgstr ""
#: packages/block-library/build-module/cover/index.js:283
#: packages/block-library/build-module/media-text/media-container.js:46
msgid "Edit media"
msgstr ""
......@@ -904,10 +905,6 @@ msgstr ""
msgid "Set media and words side-by-side for a richer layout."
msgstr ""
#: packages/block-library/build-module/media-text/media-container.js:46
msgid "Edit Media"
msgstr ""
#: packages/block-library/build-module/media-text/media-container.js:89
msgid "Media area"
msgstr ""
......@@ -1873,15 +1870,15 @@ msgid "Keyboard Shortcuts"
msgstr ""
# accessibility text for the publish landmark region.
#: packages/edit-post/build-module/components/layout/index.js:60
#: packages/edit-post/build-module/components/layout/index.js:59
msgid "Editor publish"
msgstr ""
#: packages/edit-post/build-module/components/layout/index.js:70
#: packages/edit-post/build-module/components/layout/index.js:69
msgid "Editor content"
msgstr ""
#: packages/edit-post/build-module/components/layout/index.js:94
#: packages/edit-post/build-module/components/layout/index.js:93
msgid "Open publish panel"
msgstr ""
......@@ -1967,28 +1964,19 @@ msgstr ""
msgid "Visibility"
msgstr ""
#: packages/edit-post/build-module/components/sidebar/settings-header/index.js:20
msgid "Block"
msgstr ""
# ARIA label for the Document Settings sidebar tab, selected.
# ARIA label for the Document sidebar tab, selected.
#: packages/edit-post/build-module/components/sidebar/settings-header/index.js:23
msgid "Document settings (selected)"
msgid "Document (selected)"
msgstr ""
# ARIA label for the Document Settings sidebar tab, not selected.
#: packages/edit-post/build-module/components/sidebar/settings-header/index.js:24
msgid "Document settings"
msgstr ""
# ARIA label for the Block Settings sidebar tab, selected.
# ARIA label for the Block sidebar tab, selected.
#: packages/edit-post/build-module/components/sidebar/settings-header/index.js:30
msgid "Block settings (selected)"
msgid "Block (selected)"
msgstr ""
# ARIA label for the Block Settings sidebar tab, not selected.
# ARIA label for the Block sidebar tab, not selected.
#: packages/edit-post/build-module/components/sidebar/settings-header/index.js:31
msgid "Block settings"
msgid "Block"
msgstr ""
#: packages/edit-post/build-module/components/sidebar/settings-header/index.js:38
......
......@@ -174,6 +174,13 @@ if ( ! function_exists( 'do_blocks' ) ) {
* @return string Updated post content.
*/
function do_blocks( $content ) {
// If there are blocks in this content, we shouldn't run wpautop() on it later.
$priority = has_filter( 'the_content', 'wpautop' );
if ( false !== $priority && doing_filter( 'the_content' ) && has_blocks( $content ) ) {
remove_filter( 'the_content', 'wpautop', $priority );
add_filter( 'the_content', '_restore_wpautop_hook', $priority + 1 );
}
$blocks = gutenberg_parse_blocks( $content );
$output = '';
......@@ -187,6 +194,28 @@ if ( ! function_exists( 'do_blocks' ) ) {
add_filter( 'the_content', 'do_blocks', 7 ); // BEFORE do_shortcode() and oembed.
}
if ( ! function_exists( '_restore_wpautop_hook' ) ) {
/**
* If do_blocks() needs to remove wpautop() from the `the_content` filter,
* this re-adds it afterwards, for subsequent `the_content` usage.
*
* @access private
*
* @since 4.6.0
*
* @param string $content The post content running through this filter.
* @return string The unmodified content.
*/
function _restore_wpautop_hook( $content ) {
$current_priority = has_filter( 'the_content', '_restore_wpautop_hook' );
add_filter( 'the_content', 'wpautop', $current_priority - 1 );
remove_filter( 'the_content', '_restore_wpautop_hook', $current_priority );
return $content;
}
}
if ( ! function_exists( 'strip_dynamic_blocks' ) ) {
/**
* Remove all dynamic blocks from the given content.
......
......@@ -87,6 +87,8 @@ if ( ! function_exists( 'register_tinymce_scripts' ) ) {
gutenberg_override_script( 'wp-tinymce-root', includes_url( 'js/tinymce/' ) . "tinymce{$mce_suffix}.js", array(), $tinymce_version );
gutenberg_override_script( 'wp-tinymce', includes_url( 'js/tinymce/' ) . "plugins/compat3x/plugin{$suffix}.js", array( 'wp-tinymce-root' ), $tinymce_version );
}
gutenberg_override_script( 'wp-tinymce-lists', includes_url( 'js/tinymce/' ) . "plugins/lists/plugin{$suffix}.js", array( 'wp-tinymce' ), $tinymce_version );
}
}
......@@ -620,12 +622,6 @@ function gutenberg_register_vendor_scripts() {
'https://unpkg.com/moment@2.22.1/' . $moment_script,
array()
);
$tinymce_version = '4.7.11';
gutenberg_register_vendor_script(
'tinymce-latest-lists',
'https://unpkg.com/tinymce@' . $tinymce_version . '/plugins/lists/plugin' . $suffix . '.js',
array( 'wp-tinymce' )
);
gutenberg_register_vendor_script(
'lodash',
'https://unpkg.com/lodash@4.17.5/lodash' . $suffix . '.js'
......@@ -1215,10 +1211,7 @@ function gutenberg_editor_scripts_and_styles( $hook ) {
),
);
/*
* Set a locale specific default font.
* Translators: Use this to specify the CSS font family for the default font
*/
/* Translators: Use this to specify the CSS font family for the default font */
$locale_font_family = esc_html_x( 'Noto Serif', 'CSS Font Family for Editor Font', 'gutenberg' );
$styles[] = array(
'css' => "body { font-family: '$locale_font_family' }",
......@@ -1231,11 +1224,13 @@ function gutenberg_editor_scripts_and_styles( $hook ) {
'css' => file_get_contents( $style ),
);
} else {
$file = get_theme_file_path( $style );
$styles[] = array(
'css' => file_get_contents( get_theme_file_path( $style ) ),
'baseURL' => get_theme_file_uri( $style ),
);
$file = get_theme_file_path( $style );
if ( file_exists( $file ) ) {
$styles[] = array(
'css' => file_get_contents( $file ),
'baseURL' => get_theme_file_uri( $style ),
);
}
}
}
}
......
......@@ -99,23 +99,6 @@ function gutenberg_add_rest_nonce_to_heartbeat_response_headers( $response ) {
}
add_filter( 'wp_refresh_nonces', 'gutenberg_add_rest_nonce_to_heartbeat_response_headers' );
/**
* As a substitute for the default content `wpautop` filter, applies autop
* behavior only for posts where content does not contain blocks.
*
* @param string $content Post content.
* @return string Paragraph-converted text if non-block content.
*/
function gutenberg_wpautop( $content ) {
if ( has_blocks( $content ) ) {
return $content;
}
return wpautop( $content );
}
remove_filter( 'the_content', 'wpautop' );
add_filter( 'the_content', 'gutenberg_wpautop', 6 );
/**
* Check if we need to load the block warning in the Classic Editor.
*
......
......@@ -134,7 +134,7 @@ return array(
'wp-editor' => array(
'jquery',
'lodash',
'tinymce-latest-lists',
'wp-tinymce-lists',
'wp-a11y',
'wp-api-fetch',
'wp-blob',
......
......@@ -206,6 +206,11 @@ function gutenberg_add_permalink_template_to_posts( $response, $post, $request )
return $response;
}
$post_type_obj = get_post_type_object( $post->post_type );
if ( ! is_post_type_viewable( $post_type_obj ) || ! $post_type_obj->public ) {
return $response;
}
if ( ! function_exists( 'get_sample_permalink' ) ) {
require_once ABSPATH . '/wp-admin/includes/post.php';
}
......
......@@ -2,7 +2,7 @@
/**
* Server-side rendering of the `core/archives` block.
*
* @package gutenberg
* @package WordPress
*/
/**
......@@ -32,7 +32,7 @@ function render_block_core_archives( $attributes ) {
$class .= ' wp-block-archives-dropdown';
$dropdown_id = esc_attr( uniqid( 'wp-block-archives-' ) );
$title = __( 'Archives', 'default' );
$title = __( 'Archives' );
/** This filter is documented in wp-includes/widgets/class-wp-widget-archives.php */
$dropdown_args = apply_filters(
......@@ -50,19 +50,19 @@ function render_block_core_archives( $attributes ) {
switch ( $dropdown_args['type'] ) {
case 'yearly':
$label = __( 'Select Year', 'default' );
$label = __( 'Select Year' );
break;
case 'monthly':
$label = __( 'Select Month', 'default' );
$label = __( 'Select Month' );
break;
case 'daily':
$label = __( 'Select Day', 'default' );
$label = __( 'Select Day' );
break;
case 'weekly':
$label = __( 'Select Week', 'default' );
$label = __( 'Select Week' );
break;
default:
$label = __( 'Select Post', 'default' );
$label = __( 'Select Post' );
break;
}
......@@ -101,7 +101,7 @@ function render_block_core_archives( $attributes ) {
$block_content = sprintf(
'<div class="%1$s">%2$s</div>',
$classnames,
__( 'No archives to show.', 'default' )
__( 'No archives to show.' )
);
} else {
......
......@@ -2,7 +2,7 @@
/**
* Server-side rendering of the `core/block` block.
*
* @package gutenberg
* @package WordPress
*/
/**
......
......@@ -2,7 +2,7 @@
/**
* Server-side rendering of the `core/categories` block.
*
* @package gutenberg
* @package WordPress
*/
/**
......@@ -27,7 +27,7 @@ function render_block_core_categories( $attributes ) {
if ( ! empty( $attributes['displayAsDropdown'] ) ) {
$id = 'wp-block-categories-' . $block_id;
$args['id'] = $id;
$args['show_option_none'] = __( 'Select Category', 'default' );
$args['show_option_none'] = __( 'Select Category' );
$wrapper_markup = '<div class="%1$s">%2$s</div>';
$items_markup = wp_dropdown_categories( $args );
$type = 'dropdown';
......
......@@ -2,7 +2,7 @@
/**
* Server-side rendering of the `core/latest-comments` block.
*
* @package gutenberg
* @package WordPress
*/
if ( ! function_exists( 'gutenberg_draft_or_post_title' ) ) {
......@@ -29,7 +29,7 @@ if ( ! function_exists( 'gutenberg_draft_or_post_title' ) ) {
function gutenberg_draft_or_post_title( $post = 0 ) {
$title = get_the_title( $post );
if ( empty( $title ) ) {
$title = __( '(no title)', 'default' );
$title = __( '(no title)' );
}
return esc_html( $title );
}
......@@ -98,7 +98,7 @@ function gutenberg_render_block_core_latest_comments( $attributes = array() ) {
$list_items_markup .= sprintf(
/* translators: 1: author name (inside <a> or <span> tag, based on if they have a URL), 2: post title related to this comment */
__( '%1$s on %2$s', 'default' ),
__( '%1$s on %2$s' ),
$author_markup,
$post_title
);
......@@ -143,7 +143,7 @@ function gutenberg_render_block_core_latest_comments( $attributes = array() ) {
) : sprintf(
'<div class="%1$s">%2$s</div>',
$classnames,
__( 'No comments to show.', 'default' )
__( 'No comments to show.' )
);
return $block_content;
......
......@@ -2,7 +2,7 @@
/**
* Server-side rendering of the `core/latest-posts` block.
*
* @package gutenberg
* @package WordPress
*/
/**
......@@ -21,7 +21,7 @@ function render_block_core_latest_posts( $attributes ) {
);
if ( isset( $attributes['categories'] ) ) {
$args['categories'] = $attributes['categories'];
$args['category'] = $attributes['categories'];
}
$recent_posts = wp_get_recent_posts( $args );
......@@ -33,7 +33,7 @@ function render_block_core_latest_posts( $attributes ) {
$title = get_the_title( $post_id );
if ( ! $title ) {
$title = __( '(Untitled)', 'default' );
$title = __( '(Untitled)' );
}
$list_items_markup .= sprintf(
'<li><a href="%1$s">%2$s</a>',
......
......@@ -2,7 +2,7 @@
/**
* Server-side rendering of the `core/shortcode` block.
*
* @package gutenberg
* @package WordPress
*/
/**
......
......@@ -359,6 +359,7 @@ class WP_Block_Parser {
*
* @internal
* @since 3.8.0
* @since 4.6.1 fixed a bug in attribute parsing which caused catastrophic backtracking on invalid block comments
* @return array
*/
function next_token() {
......@@ -373,13 +374,18 @@ class WP_Block_Parser {
* match back in PHP to see which one it was.
*/
$has_match = preg_match(
'/<!--\s+(?<closer>\/)?wp:(?<namespace>[a-z][a-z0-9_-]*\/)?(?<name>[a-z][a-z0-9_-]*)\s+(?<attrs>{(?:[^}]+|}+(?=})|(?!}\s+-->).)*?}\s+)?(?<void>\/)?-->/s',
'/<!--\s+(?<closer>\/)?wp:(?<namespace>[a-z][a-z0-9_-]*\/)?(?<name>[a-z][a-z0-9_-]*)\s+(?<attrs>{(?:(?:[^}]+|}+(?=})|(?!}\s+\/?-->).)*+)?}\s+)?(?<void>\/)?-->/s',
$this->document,
$matches,
PREG_OFFSET_CAPTURE,
$this->offset
);
// if we get here we probably have catastrophic backtracking or out-of-memory in the PCRE
if ( false === $has_match ) {
return array( 'no-more-tokens', null, null, null, null );
}
// we have no more tokens
if ( 0 === $has_match ) {
return array( 'no-more-tokens', null, null, null, null );
......
......@@ -2,7 +2,7 @@
Contributors: matveb, joen, karmatosed
Requires at least: 4.9.8
Tested up to: 4.9
Stable tag: 4.5.0
Stable tag: 4.6.0
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
......@@ -81,12 +81,4 @@ See also <a href="https://github.com/WordPress/gutenberg/blob/master/CONTRIBUTIN
= Latest =
* Raw Handling: fix consecutive lists with one item
* Avoid showing draft revert message on autosaves
* Honor the Disable Visual Editor setting in the Gutenberg editor page
* Docs: Fix dead links in CONTRIBUTING.md
* Fix undefined index warnings in Latest Comments & Latest Posts
* Add `react-native` module property to html-entities package.json
* RichText: List: Sync DOM after editor command
* Fix RichText infinte rerendering
* Fix keycodes package missing i18n dependencies
\ No newline at end of file
* Parser: Make attribute parsing possessive (Fix High CPU usage).
......@@ -216,3 +216,10 @@ function init_biuro_theme() {
pll_register_string('biuro-job-search', 'Job search', 'Biuro');
}
add_action('init', 'init_biuro_theme');
$l = get_nav_menu_locations();
$m = $l ? wp_get_nav_menu_object( $l[ 'main-menu' ] ) : null;
$items = $m ? wp_get_nav_menu_items( $m->term_id, array( 'order' => 'DESC' ) ) : array();
$searchPageURL = $items[0] ? $items[0]->url : '/';
......@@ -36,8 +36,6 @@
</symbol>
</svg>
<div id="main" class="main">
<div id="top">
......@@ -51,13 +49,13 @@
</div>
<div id="topsearch">
<form role="form" id="top-search-form" action="/darbo-pasiulymai/" method="get" enctype="application/x-www-form-urlencoded">
<label for="search"><?php pll_e('Job search'); ?></label>
<div id="search-input-block">
<input type="text" name="search" id="search" value="" class="input text nolabel" />
<input aria-label="Ieškoti" type="submit" id="filter-action" name="action_results" value="" class="submit action" />
</div>
</form>
<?php
global $searchPageURL;
if ( get_permalink() != $searchPageURL ):
get_search_form();
endif;
?>
</div>
<?php
......
......@@ -19,9 +19,6 @@ get_header(); ?>
<?php
// Use for search
// https://pods.io/docs/code/pods/find/
while ( have_posts() ) :
the_post();
......
<?php
/**
* Template Name: Search Page
*
* @link https://codex.wordpress.org/Template_Hierarchy
*
* @package WordPress
* @subpackage Biuro
* @since 1.0
* @version 1.0
*/
?>
<?php
get_header();
$search = get_query_var('search');
$cityID = get_query_var('city');
$periodID = get_query_var('period');
$fieldID = get_query_var('field');
$typeID = get_query_var('type');
// function print()
// $cities = get_terms( 'city', array(
// 'hide_empty' => false,
// ));
// debug($cityID)
// if ( ! empty( $terms ) && ! is_wp_error( $terms ) ){
// echo '<ul>';
// foreach ( $terms as $term ) {
// echo '<li>' . $term->name . '</li>';
// }
// echo '</ul>';
// }
?>
<form id="filter-form" action="<?php echo esc_url( $searchPageURL ); ?>" method="get" enctype="application/x-www-form-urlencoded">
<ul class="search_box">
<li>
<label for="label">Paieška:</label>
<div id="search-input-block">
<input type="text" name="search" id="search" value="<?php echo $search; ?>" class="input text nolabel" />
<button aria-label="Ieškoti" type="submit" id="filter-action" class="submit action" ></button>
</div>
<a href="/darbo-pasiulymai/#" id="filter-expand" class="url close">Išplėstinė paieška</a></li>
<li class="filter-additional">
<label for="city">Miestas:</label>
<select name="city" id="city" class="el_130">
<option value="">Visi miestai</option>
<?php
$cities = get_terms( 'city', array(
'hide_empty' => false,
));
if ( ! empty( $cities ) && ! is_wp_error( $cities ) ):
foreach ( $cities as $city ):
$name = $city->name;
$termID = $city->term_id;
$selected = ($cityID == $termID) ? 'selected="selected"' : '';
?>
<option value="<?php echo $termID; ?>" <?php echo $selected; ?>><?php echo $name; ?></option>
<?php
endforeach;
endif;
?>
</select>
<label for="period" style="opacity: 0.45">Laikotarpis:</label>
<select name="period" id="period" class="el_130" style="opacity: 0.45">
<option value="">Nesvarbu</option>
<option value="1">Šiandienos</option>
<option value="7">Savaitės</option>
<option value="30">Mėnesio</option>
</select>
</li>
<li class="filter-additional">
<label for="field">Darbo sritis:</label>
<select name="field" id="field" class="el_130">
<option value="">Visos sritys</option>
<?php
$fields = get_terms( 'field', array(
'hide_empty' => false,
));
if ( ! empty( $fields ) && ! is_wp_error( $fields ) ):
foreach ( $fields as $field ):
$name = $field->name;
$termID = $field->term_id;
$selected = ($fieldID == $termID) ? 'selected="selected"' : '';
?>
<option value="<?php echo $termID; ?>" <?php echo $selected; ?>><?php echo $name; ?></option>
<?php
endforeach;
endif;
?>
</select>
<label for="type">Darbo rūšis:</label>
<select name="type" id="type" class="el_130">
<option value="">Visos rūšys</option>
<?php
$types = get_terms( 'type', array(
'hide_empty' => false,
));
if ( ! empty( $types ) && ! is_wp_error( $types ) ):
foreach ( $types as $type ):
$name = $type->name;
$termID = $type->term_id;
$selected = ($typeID == $termID) ? 'selected="selected"' : '';
?>
<option value="<?php echo $termID; ?>" <?php echo $selected; ?>><?php echo $name; ?></option>
<?php
endforeach;
endif;
?>
</select>
<input type="button" value="Ieškoti" name="find" id="find" class="filter-button">
<input type="button" value="Išvalyti" name="find" data-href="<?php echo esc_url( $searchPageURL ); ?>" id="reset-filter" class="filter-button">
</li>
</ul>
</form>
<?php
// Use for search
// https://pods.io/docs/code/pods/find/
$where = 't.post_title LIKE "%' . $search . '%"';
// 'where' => 't.post_title LIKE "%' . $keyword . '%" OR my_field.meta_value LIKE "%' . $keyword . '%"'
if ($cityID):
$where = $where . ' AND city.term_id = ' . $cityID;
endif;
if ($fieldID):
$where = $where . ' AND field.term_id = ' . $fieldID;
endif;
if ($typeID):
$where = $where . ' AND type.term_id = ' . $typeID;
endif;
$params = array(
'where' => $where,
'limit' => -1
);
$jobs = pods( 'job', $params );
if ( 0 < $jobs->total() ):
$i = 0;
?>
<table cellspacing="0" cellpadding="0" class="advert_table">
<tr>
<th>Pozicija </th>
<th>Vietovė</th>
<th>Data</th>
<th>Rūšis</th>
</tr>
<?php
while ( $jobs->fetch() ) :
$i++;
?>
<tr <?php if ( $i % 2 == 0 ) { echo 'class="bg"'; } ?>>
<td>
<a href="<?php echo get_post_permalink( $jobs->display( 'ID' ) ); ?>" target="_blank" title="<?php echo $jobs->display( 'name' ); ?>">
<strong><?php echo $jobs->display( 'name' ); ?></strong>
</a>
</td>
<td>
<span style="opacity: 0.25;">Šiauliai</span>
</td>
<td>
<span style="opacity: 0.25;">Paskelbta: 2018 11 30 <br> Galioja iki: 2018 12 28</span>
</td>
<td>
<span style="opacity: 0.25;">Nuolatinis darbas</span>
</td>
</tr>
<?php
endwhile;
?>
</table>
<?php
endif;
?>
<?php get_footer();
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