Commit fca6839c authored by Simonas's avatar Simonas

release 1.4.1

parent 1ca4e3f0
......@@ -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.4.0 .` (update version number)
- build new image `docker build -t biuro/web:1.4.1 .` (update version number)
- login to biuro docker account `docker login --username=biuro --password=9Ndtjd2vKsLvGuFOeFq1KdJs`
- push image to docker repository - `docker push biuro/web:1.4.0`
- push image to docker repository - `docker push biuro/web:1.4.1`
## Production
- update biuro/web image version in .env file (staging or www)
......
{
"name": "biuro",
"version": "1.4.0",
"version": "1.4.1",
"description": "Biuro WP theme",
"scripts": {
"dev": "gulp --require @babel/register --gulpfile tasks",
......
......@@ -568,22 +568,22 @@ add_action( 'rest_api_init', function () {
)
));
// register_rest_route( 'api/v1', '/contacts', array(
// 'methods' => WP_REST_Server::READABLE,
// 'callback' => 'Biuro_Contacts_Public::getContacts',
// 'args' => [
// 'from' => [
// 'validate_callback' => function($param, $request, $key) {
// return is_string( $param );
// }
// ],
// 'by' => [
// 'validate_callback' => function($param, $request, $key) {
// return is_string( $param );
// }
// ]
// ]
// ));
register_rest_route( 'api/v1', '/contacts', array(
'methods' => WP_REST_Server::READABLE,
'callback' => 'Biuro_Contacts_Public::getContacts',
'args' => [
'from' => [
'validate_callback' => function($param, $request, $key) {
return is_string( $param );
}
],
'by' => [
'validate_callback' => function($param, $request, $key) {
return is_string( $param );
}
]
]
));
});
......
......@@ -74,12 +74,88 @@ $date_format = get_option( 'date_format' );
<?php
function getPaginationURL($i) {
$pathname = preg_replace('/[?|^&]pg=\\d+/', '', $_SERVER['REQUEST_URI']);
if ($i === 1) {
return $pathname;
}
$append = '?';
if ( false !== strpos( $pathname, '?' ) ) {
$append = '&';
}
return $pathname . $append . 'pg=' . $i;
}
function getPaginationPage($i, $page) {
if ($i == $page):
echo '<span aria-current="page" class="page-numbers current">' . $i . '</span>';
else:
echo '<a class="page-numbers" href="' . getPaginationURL($i) . '">' . $i . '</a>';
endif;
}
if ( !is_front_page() ):
echo $jobs->pagination( array(
'type' => 'paginate' ,
'prev_text' => ' ',
'next_text' => ' '
) );
$total = ceil($jobs->total_found()/$jobs->limit);
$page = $jobs->page;
$prev = ($total > 7 && $page > 3) ? true : false;
$next = ($total > 7 && $page < ($total - 3) ) ? true : false;
if ($total > 1) :
echo '<span class="pods-pagination-paginate ">';
if ($page > 1):
echo '<a class="prev page-numbers" href="' . getPaginationURL($page-1) . '"> </a>';
endif;
getPaginationPage(1, $page);
if ($prev):
echo '<a class="page-numbers dots" href="' . getPaginationURL($page-3) . '">...</a>';
endif;
if ($total < 8):
for ($i = 2; $i < $total; $i++):
getPaginationPage($i, $page);
endfor;
else:
if ($page < 4):
for ($i = 2; $i <= 5; $i++):
getPaginationPage($i, $page);
endfor;
elseif ($page > ($total - 4)):
for ($i = $total - 4; $i < $total; $i++):
getPaginationPage($i, $page);
endfor;
else:
for ($i = $page - 1; $i <= $page + 1; $i++):
getPaginationPage($i, $page);
endfor;
endif;
endif;
if ($next):
echo '<a class="page-numbers dots" href="' . getPaginationURL($page+3) . '">...</a>';
endif;
getPaginationPage($total, $page);
if ($page < $total):
echo '<a class="next page-numbers" href="' . getPaginationURL($page+1) . '"> </a>';
endif;
echo '</span>';
endif;
// echo $jobs->pagination( array(
// 'type' => 'paginate' ,
// 'prev_text' => ' ',
// 'next_text' => ' '
// ) );
endif;
?>
......@@ -44,7 +44,7 @@ if ( is_search()) :
endif;
else:
elseif ( !$searchQuery['city'] || !$searchQuery['s'] ) :
?>
<meta name="robots" content="noindex" />
<?php
......
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