Commit 42e0311d authored by Simonas's avatar Simonas

Single step form & hide sharing

parent 5b3b4f46
file_uploads = On
memory_limit = 64M
upload_max_filesize = 64M
post_max_size = 64M
max_execution_time = 600
file_uploads = On
memory_limit = 64M
upload_max_filesize = 64M
post_max_size = 64M
max_execution_time = 60000
......@@ -878,6 +878,10 @@ class Biuro_Contacts_Public {
$job_id = $attr['job_id'];
endif;
if ($attr['step']):
$step = $attr['step'];
endif;
include_once('partials/biuro-contacts-public--position.php');
unset($_SESSION['position--step']);
......
......@@ -20,7 +20,7 @@
if ( ! defined( 'WPINC' ) ) die;
?>
<form name="form-position" action="<?php echo esc_url( admin_url('admin-post.php') ); ?>" method="post" enctype="multipart/form-data" class="c-form <?php if ($_SESSION['position--step']): ?>c-form--position<?php endif; ?>">
<form name="form-position" action="<?php echo esc_url( admin_url('admin-post.php') ); ?>" method="post" enctype="multipart/form-data" class="c-form <?php if ($_SESSION['position--step'] || isset($step)): ?>c-form--position<?php endif; ?>">
<div id="action" class="c-form--action c-form--action-position"></div>
<?php
......@@ -33,11 +33,15 @@ if ( ! defined( 'WPINC' ) ) die;
<?php
unset($_SESSION['position--captcha-status']);
endif;
?>
else:
if (isset($step)) :
?>
<h2 class="c-form--header"><?php _e('Apply now', 'biuro-contacts'); ?></h2>
<?php
endif;
endif;
if ( !$_SESSION['position--step'] ):
if ( !$_SESSION['position--step'] && !isset($step) ):
include_once('biuro-contacts-public--position--step-1.php');
else:
include_once('biuro-contacts-public--position--step-2.php');
......
......@@ -19,8 +19,8 @@
&:hover { background: var(--color--green-darker); border-color: var(--color--green-darker); }
}
.c-btn--disabled { background: #6f7479; border-color: #6f7479; outline: none; pointer-events: none; user-select: none;
&:hover { background: #6f7479; cursor: not-allowed; border-color: #6f7479;}
.c-btn--disabled { color: #bbb; background: #6f7479; border-color: #6f7479; outline: none; pointer-events: none; user-select: none;
&:hover { color: #bbb; background: #6f7479; cursor: not-allowed; border-color: #6f7479;}
}
.c-btn--vdb { color: #fff; background: #ff7046; border-color: #ff7046;
......@@ -59,3 +59,27 @@
}
/* critical:end */
.c-btn--loading {
position: relative;
&:before {
content: '';
box-sizing: border-box;
position: absolute;
top: 50%;
left: 50%;
width: 20px;
height: 20px;
margin-top: -10px;
margin-left: -10px;
border-radius: 50%;
border: 2px solid #fff;
border-top-color: var(--color--green);
animation: spinner .8s linear infinite;
}
}
@keyframes spinner {
to {transform: rotate(360deg);}
}
......@@ -4,6 +4,19 @@
.c-form { position: relative }
.c-form--header {
color: #069980;
font-size: 21px;
font-weight: 700;
margin: -8px 0 20px;
padding: 0;
@media (--min--medium) {
font-size: 24px;
}
}
.c-form--action { position: absolute; top: -88px; left: -9999px; width: 1px;
@media (--min--medium) {
top: -128px;
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -218,6 +218,7 @@ if (document.querySelector('.js-modal--close')) {
const submitContactsFrom = (form) => {
if (form.querySelector('[type="submit"]')) {
form.querySelector('[type="submit"]').classList.add('c-btn--disabled');
form.querySelector('[type="submit"]').classList.add('c-btn--loading');
}
};
......@@ -236,6 +237,7 @@ if (document.querySelector('#submit-recommend')) {
}
e.currentTarget.classList.add('c-btn--disabled');
e.currentTarget.classList.add('c-btn--loading');
button.click();
});
......@@ -252,6 +254,7 @@ if (document.querySelector('.js-submit-employees-form')) {
e.preventDefault();
e.currentTarget.classList.add('c-btn--disabled');
e.currentTarget.classList.add('c-btn--loading');
button.click();
});
......
This diff is collapsed.
......@@ -3,7 +3,16 @@
$pod = pods( 'job', $ID );
echo do_shortcode('[biuro-contacts--position job_id="' . $pod->field( 'livas-id' ) . '"]');
$livasID = $pod->field( 'livas-id' );
$step = 0;
if ($pod->field( 'single-step' ) && !isset($_SESSION['position--s'])):
$_SESSION['position--s'] = 1;
$step = 2;
endif;
echo do_shortcode('[biuro-contacts--position step="' . $step . '" job_id="' . $livasID . '"]');
$requestURL = get_post_permalink( $ID );
......@@ -39,42 +48,46 @@
</symbol>
</svg>
<div class="c-share">
<p class="c-share--heading"><?php _e('Suggest a friend', 'biuro'); ?></p>
<div class="c-share--options">
<a rel="noopener" href="https://www.facebook.com/dialog/share?app_id=<?php echo $appID; ?>&display=popup&amp;href=<?php echo urlencode($requestURL . '?utm_source=facebook_share_button_job_page'); ?>&redirect_uri=<?php echo $requestURL; ?>" class="gtm-share-click js-share-facebook c-share--option c-share--option-facebook" data-label="Facebook">
<svg width="9px" height="18px" class="c-ico--share-facebook">
<use xlink:href="#ico--job-facebook"></use>
</svg>
</a>
<a rel="noopener" href="https://www.facebook.com/dialog/send?app_id=<?php echo $appID; ?>&amp;link=<?php echo urlencode($requestURL . '?utm_source=messenger_share_button_job_page'); ?>&redirect_uri=<?php echo $requestURL; ?>" class="gtm-share-click js-share-messenger c-share--option c-share--option-messenger" data-label="Messenger" data-id="<?php echo $appID; ?>">
<svg width="15px" height="15px" class="c-ico--share-messenger">
<use xlink:href="#ico--job-messenger"></use>
</svg>
</a>
<a href="<?php echo $mailto; ?>" class="gtm-share-click c-share--option c-share--option-email" data-label="Email">
<svg width="17px" height="13px" class="c-ico--share-email">
<use xlink:href="#ico--job-email"></use>
</svg>
</a>
<a href="#" class="js-copy-to-clipboard gtm-share-click c-share--option c-share--option-copy" data-label="Copy">
<svg width="15px" height="18px" class="c-ico--share-copy">
<use xlink:href="#ico--job-copy"></use>
</svg>
<div id="copy-tooltip" class="c-tooltip">
<?php _e('The link copied to the clipboard', 'biuro'); ?>
</div>
</a>
<?php
$waText = __('I think you might like this job offer', 'biuro') . ': ' . urlencode($requestURL . '?utm_source=whatsapp_share_button_job_page');
if (!$pod->field( 'hide-sharing' )):
$waText = __('I think you might like this job offer', 'biuro') . ': ' . urlencode($requestURL . '?utm_source=whatsapp_share_button_job_page');
?>
<a target="_blank" rel="noopener" href="https://wa.me/?text=<?php echo $waText; ?>" data-text="<?php echo $waText; ?>" class="js-share-whatsapp gtm-share-click c-share--option c-share--option-phone" data-label="WhatsApp">
<svg width="17px" height="18px" class="c-ico--share-whatsapp">
<use xlink:href="#ico--job-whatsapp"></use>
</svg>
</a>
<div class="c-share">
<p class="c-share--heading"><?php _e('Suggest a friend', 'biuro'); ?></p>
<div class="c-share--options">
<a rel="noopener" href="https://www.facebook.com/dialog/share?app_id=<?php echo $appID; ?>&display=popup&amp;href=<?php echo urlencode($requestURL . '?utm_source=facebook_share_button_job_page'); ?>&redirect_uri=<?php echo $requestURL; ?>" class="gtm-share-click js-share-facebook c-share--option c-share--option-facebook" data-label="Facebook">
<svg width="9px" height="18px" class="c-ico--share-facebook">
<use xlink:href="#ico--job-facebook"></use>
</svg>
</a>
<a rel="noopener" href="https://www.facebook.com/dialog/send?app_id=<?php echo $appID; ?>&amp;link=<?php echo urlencode($requestURL . '?utm_source=messenger_share_button_job_page'); ?>&redirect_uri=<?php echo $requestURL; ?>" class="gtm-share-click js-share-messenger c-share--option c-share--option-messenger" data-label="Messenger" data-id="<?php echo $appID; ?>">
<svg width="15px" height="15px" class="c-ico--share-messenger">
<use xlink:href="#ico--job-messenger"></use>
</svg>
</a>
<a href="<?php echo $mailto; ?>" class="gtm-share-click c-share--option c-share--option-email" data-label="Email">
<svg width="17px" height="13px" class="c-ico--share-email">
<use xlink:href="#ico--job-email"></use>
</svg>
</a>
<a href="#" class="js-copy-to-clipboard gtm-share-click c-share--option c-share--option-copy" data-label="Copy">
<svg width="15px" height="18px" class="c-ico--share-copy">
<use xlink:href="#ico--job-copy"></use>
</svg>
<div id="copy-tooltip" class="c-tooltip">
<?php _e('The link copied to the clipboard', 'biuro'); ?>
</div>
</a>
<a target="_blank" rel="noopener" href="https://wa.me/?text=<?php echo $waText; ?>" data-text="<?php echo $waText; ?>" class="js-share-whatsapp gtm-share-click c-share--option c-share--option-phone" data-label="WhatsApp">
<svg width="17px" height="18px" class="c-ico--share-whatsapp">
<use xlink:href="#ico--job-whatsapp"></use>
</svg>
</a>
</div>
</div>
</div>
<?php
endif;
?>
<?php
global $recommendPage;
......
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