Commit 1bf988e7 authored by Simonas's avatar Simonas

in progress

parent c52dca1c
......@@ -106,7 +106,7 @@ Restart docker (sometimes PC restart may be required)
- docker build -t biuro/web:0.0.5 .
- docker login --username=biuro --password=9Ndtjd2vKsLvGuFOeFq1KdJs
- sudo docker login --username=biuro --password=9Ndtjd2vKsLvGuFOeFq1KdJs
- docker push biuro/web:0.0.4
- docker push biuro/web:0.0.5
- sudo chown -R www-data:www-data wordpress/wp-content/plugins
......
......@@ -30,6 +30,7 @@ services:
- ./wp-content/plugins/biuro-contacts:/var/www/html/wp-content/plugins/biuro-contacts
- ./wp-content/plugins/biuro-feedbacks:/var/www/html/wp-content/plugins/biuro-feedbacks
- ./wp-content/plugins/biuro-html:/var/www/html/wp-content/plugins/biuro-html
- ./wp-content/plugins/biuro-sections:/var/www/html/wp-content/plugins/biuro-sections
- ./wp-content/plugins/biuro-services:/var/www/html/wp-content/plugins/biuro-services
- ./wp-content/plugins/biuro-values:/var/www/html/wp-content/plugins/biuro-values
......@@ -86,6 +87,7 @@ services:
- ./wp-content/plugins/biuro-contacts:/var/www/html/wp-content/plugins/biuro-contacts
- ./wp-content/plugins/biuro-feedbacks:/var/www/html/wp-content/plugins/biuro-feedbacks
- ./wp-content/plugins/biuro-html:/var/www/html/wp-content/plugins/biuro-html
- ./wp-content/plugins/biuro-sections:/var/www/html/wp-content/plugins/biuro-sections
- ./wp-content/plugins/biuro-services:/var/www/html/wp-content/plugins/biuro-services
- ./wp-content/plugins/biuro-values:/var/www/html/wp-content/plugins/biuro-values
......@@ -120,6 +122,7 @@ services:
- ./wp-content/plugins/biuro-contacts:/var/www/html/wp-content/plugins/biuro-contacts
- ./wp-content/plugins/biuro-feedbacks:/var/www/html/wp-content/plugins/biuro-feedbacks
- ./wp-content/plugins/biuro-html:/var/www/html/wp-content/plugins/biuro-html
- ./wp-content/plugins/biuro-sections:/var/www/html/wp-content/plugins/biuro-sections
- ./wp-content/plugins/biuro-services:/var/www/html/wp-content/plugins/biuro-services
- ./wp-content/plugins/biuro-values:/var/www/html/wp-content/plugins/biuro-values
......
......@@ -174,6 +174,11 @@ class Biuro_Contacts {
$this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_scripts' );
$this->loader->add_action( 'init', $plugin_public, 'register_shortcodes' );
$this->loader->add_action('admin_post_nopriv_employees_quick', $plugin_public, 'employeesQuickSubmit');
$this->loader->add_action('admin_post_employees_quick', $plugin_public, 'employeesQuickSubmit');
$this->loader->add_action('admin_post_nopriv_employers_quick', $plugin_public, 'employersQuickSubmit');
$this->loader->add_action('admin_post_employers_quick', $plugin_public, 'employersQuickSubmit');
}
/**
......
......@@ -138,11 +138,36 @@ class Biuro_Contacts_Public {
ob_start();
if ( isset( $_POST['action-submit'] ) ) :
if ( isset( $_POST['submit'] ) ) :
$response = true;
endif;
include 'partials/biuro-contacts-public--employees-quick.php';
$output = ob_get_contents();
ob_end_clean();
return $output;
} // employees_form()
/**
* Processes shortcode biuro-contacts--employees
*
* @param array $attr The attributes from the shortcode
*
* @return mixed $output Output of the buffer
*/
public function employers_quick_form( $attr = array() ) {
$response = false;
ob_start();
if ( isset( $_POST['submit'] ) ) :
$response = true;
endif;
include 'partials/biuro-contacts-public--employees-2-steps.php';
include 'partials/biuro-contacts-public--employers-quick.php';
$output = ob_get_contents();
......@@ -203,6 +228,33 @@ class Biuro_Contacts_Public {
} // position_form()
public function employersQuickSubmit() {
debug($_POST); //$_POST variables should be accessible now
//Optional: Now you can redirect the user to your confirmation page using wp_redirect()
// ob_start();
// wp_redirect($_POST['_wp_http_referer']);
exit;
// wp_redirect(admin_url('admin.php?page=' . $_POST['_wp_http_referer']));
// die();
//apparently when finished, die(); is required.
}
public function employeesQuickSubmit() {
debug($_POST); //$_POST variables should be accessible now
//Optional: Now you can redirect the user to your confirmation page using wp_redirect()
// ob_start();
// wp_redirect($_POST['_wp_http_referer']);
exit;
// wp_redirect(admin_url('admin.php?page=' . $_POST['_wp_http_referer']));
// die();
//apparently when finished, die(); is required.
}
/**
* Registers all shortcodes at once
*
......@@ -212,12 +264,13 @@ class Biuro_Contacts_Public {
add_shortcode( 'biuro-contacts--employees-quick', array( $this, 'employees_quick_form' ) );
add_shortcode( 'biuro-contacts--employers-quick', array( $this, 'employers_quick_form' ) );
add_shortcode( 'biuro-contacts--employees', array( $this, 'employees_form' ) );
add_shortcode( 'biuro-contacts--employers', array( $this, 'employers_form' ) );
add_shortcode( 'biuro-contacts--position', array( $this, 'position_form' ) );
} // register_shortcodes()
}
......@@ -13,16 +13,18 @@
*/
?>
<form action="<?php echo $_SERVER["REQUEST_URI"]; ?>" method="post" enctype="multipart/form-data" class="c-form">
<form action="<?php echo admin_url('admin-post.php') ?>" method="post" enctype="multipart/form-data" class="c-form">
<div class="c-form--row">
<label class="c-form--label" for="form-name">Name, Surname*</label>
<div class="c-form--input-wrap">
<input type="text" class="c-form--input <?php if ($response) { echo 'c-form--input--error'; } ?>" id="form-name" name="name" value="">
</div>
<div class="c-form--validation-error">
Name and Surname is required
</div>
<?php if ($response): ?>
<div class="c-form--validation-error">
Name and Surname is required
</div>
<?php endif; ?>
</div><!-- .c-form--row -->
<div class="c-form--row">
......@@ -30,9 +32,11 @@
<div class="c-form--input-wrap">
<input type="tel" class="c-form--input <?php if ($response) { echo 'c-form--input--error'; } ?>" id="form-phone" name="phone" value="">
</div>
<div class="c-form--validation-error">
Phone number is required
</div>
<?php if ($response): ?>
<div class="c-form--validation-error">
Phone number is required
</div>
<?php endif; ?>
</div><!-- .c-form--row -->
<div class="c-form--row">
......@@ -40,9 +44,11 @@
<div class="c-form--input-wrap">
<input type="email" class="c-form--input <?php if ($response) { echo 'c-form--input--error'; } ?>" id="form-email" name="email" value="">
</div>
<div class="c-form--validation-error">
Email address is required
</div>
<?php if ($response): ?>
<div class="c-form--validation-error">
Email address is required
</div>
<?php endif; ?>
</div><!-- .c-form--row -->
<div class="c-form--row">
......@@ -56,9 +62,13 @@
<input id="form-agree" type="checkbox" class="c-form--checkbox <?php if ($response) { echo 'c-form--checkbox--error'; } ?>" name="agree" value="1">
<label class="c-form--label-checkbox" for="form-agree">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Rem possimus, delectus unde enim dolores doloribus, recusandae a veritatis ducimus repudiandae iste eos voluptatum architecto mollitia?</label>
</div>
<div class="c-form--validation-error">
You have to agree with conditions
</div>
<?php if ($response): ?>
<div class="c-form--validation-error">
You have to agree with conditions
</div>
<?php endif; ?>
</div><!-- .c-form--row -->
<input type="hidden" name="action" value="employees_quick">
<?php wp_nonce_field('employees_quick_nonce', 'employees_quick_nonce'); ?>
</form>
<?php
/**
* Provide a public-facing view for the plugin
*
* This file is used to markup the public-facing aspects of the plugin.
*
* @link https://www.biuro.lt
* @since 1.0.0
*
* @package Biuro_Contacts
* @subpackage Biuro_Contacts/public/partials
*/
?>
<form action="<?php echo admin_url('admin-post.php') ?>" method="post" enctype="multipart/form-data" class="c-form">
<div class="c-form--row">
<label class="c-form--label" for="form-name">Name, Surname*</label>
<div class="c-form--input-wrap">
<input type="text" class="c-form--input <?php if ($response) { echo 'c-form--input--error'; } ?>" id="form-name" name="name" value="">
</div>
<?php if ($response): ?>
<div class="c-form--validation-error">
Name and Surname is required
</div>
<?php endif; ?>
</div><!-- .c-form--row -->
<div class="c-form--row">
<label class="c-form--label" for="form-phone">Phone no.*</label>
<div class="c-form--input-wrap">
<input type="tel" class="c-form--input <?php if ($response) { echo 'c-form--input--error'; } ?>" id="form-phone" name="phone" value="">
</div>
<?php if ($response): ?>
<div class="c-form--validation-error">
Phone number is required
</div>
<?php endif; ?>
</div><!-- .c-form--row -->
<div class="c-form--row">
<label class="c-form--label" for="form-email">Email address*</label>
<div class="c-form--input-wrap">
<input type="email" class="c-form--input <?php if ($response) { echo 'c-form--input--error'; } ?>" id="form-email" name="email" value="">
</div>
<?php if ($response): ?>
<div class="c-form--validation-error">
Email address is required
</div>
<?php endif; ?>
</div><!-- .c-form--row -->
<div class="c-form--row">
<div class="c-form--submit-wrap">
<button type="submit" class="c-form--submit" name="submit" value="1">Submit</button>
</div>
</div><!-- .c-form--row -->
<div class="c-form--row">
<div class="c-form--checkbox-wrap">
<input id="form-agree" type="checkbox" class="c-form--checkbox <?php if ($response) { echo 'c-form--checkbox--error'; } ?>" name="agree" value="1">
<label class="c-form--label-checkbox" for="form-agree">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Rem possimus, delectus unde enim dolores doloribus, recusandae a veritatis ducimus repudiandae iste eos voluptatum architecto mollitia?</label>
</div>
<?php if ($response): ?>
<div class="c-form--validation-error">
You have to agree with conditions
</div>
<?php endif; ?>
</div><!-- .c-form--row -->
<input type="hidden" name="action" value="employers_quick">
<?php wp_nonce_field('employers_quick_nonce', 'employers_quick_nonce'); ?>
</form>
<?php
/*
Plugin Name: Biuro HTML
Description: Biuro Biuro HTML plugin
Author: Biuro
Version: 1.0
Author URI: https://www.biuro.lt/
*/
class Biuro_HTML extends WP_Widget {
// Main constructor
public function __construct() {
parent::__construct(
'biuro-html',
__( 'Biuro HTML | Biuro', 'biuro' ),
array(
'customize_selective_refresh' => true,
)
);
}
// The widget form (for the backend )
public function form( $instance ) {
// Set widget defaults
$defaults = array(
'title' => '',
'content' => '',
);
// Parse current settings with defaults
extract( wp_parse_args( ( array ) $instance, $defaults ) ); ?>
<p>
<label for="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>"><?php _e( 'Title', 'biuro' ); ?><?php echo ' ' . $i . ':'; ?></label>
<input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'title' ) ); ?>" type="text" value="<?php echo esc_attr( ${'title'} ); ?>" />
</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>
</p>
<?php }
// Update widget settings
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'] ) : '';
return $instance;
}
// Display the widget
public function widget( $args, $instance ) {
extract( $args );
// Check the widget options
$title = isset( $instance['title'] ) ?$instance['title'] : '';
$content = isset( $instance['content'] ) ?$instance['content'] : '';
// WordPress core before_widget hook (always include )
echo $before_widget;
// Display the widget
// echo '<div class="c-biuro-html">';
// Display content field
if ( $title ) {
echo '<h3>' . $title . '</h3>';
}
if ( $content ) {
echo $content;
}
// echo '</div>';
// WordPress core after_widget hook (always include )
echo $after_widget;
}
}
// register Biuro_HTML
add_action( 'widgets_init', function(){
register_widget( 'Biuro_HTML' );
});
......@@ -12,6 +12,7 @@ c-: Signify that something is a Component. This is a concrete, implementation-sp
@import '_component--copy.css';
@import '_component--data-controller.css';
@import '_component--divisions.css';
@import '_component--form.css';
@import '_component--job.css';
@import '_component--jobs-list.css';
@import '_component--jobs-pagination.css';
......
/* ------------- Component: form ------------- */
/* critical:start */
/* critical:end */
.c-form--input--error { border: 1px solid #f90000; }
.c-form--validation-error { color: #f90000; margin-bottom: 10px;}
: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}.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--main{display:-webkit-box;display:-ms-flexbox;display:flex}.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{-webkit-box-flex:0;-ms-flex:0 0 16.25em;flex:0 0 16.25em}.l-main,.l-nav{-webkit-box-flex:1;-ms-flex:1 1 100%;flex:1 1 100%}.c-nav--main{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}.c-nav--main{margin:20px 0}}@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.
......@@ -123,7 +123,7 @@ document.querySelectorAll('.js-job-action').forEach(function (node) {
});
</script>
<script src="/wp-content/themes/biuro/js/main-a9a206ea.min.js" async></script>
<script src="/wp-content/themes/biuro/js/main.min.js" async></script>
<?php wp_footer(); ?>
</body>
</html>
......@@ -65,30 +65,38 @@
<br>
<h2>Partneriai</h2>
<div class="c-logos">
<div>1 logo</div>
<div>2 logo</div>
<div>3 logo</div>
<div>4 logo</div>
<div>5 logo</div>
<div>6 logo</div>
<div>7 logo</div>
<div style="border: 1px solid green;">
<h2 style="text-align: center;">Mumis pasitiki</h2>
<div class="c-logos">
<div>1 logo</div>
<div>2 logo</div>
<div>3 logo</div>
<div>4 logo</div>
<div>5 logo</div>
<div>6 logo</div>
<div>7 logo</div>
<div>8 logo</div>
</div>
</div>
<br>
<div style="border: 1px solid red">
<?php
if ( is_active_sidebar( 'front_page_employees' ) ) :
dynamic_sidebar( 'front_page_employees' );
endif;
?>
<?php
echo do_shortcode('[biuro-contacts--employees-quick]');
?>
<div style="border: 1px solid red; display: flex;">
<div style="flex: 1 1 40%;">
<?php
if ( is_active_sidebar( 'front_page_employees' ) ) :
dynamic_sidebar( 'front_page_employees' );
endif;
?>
<img src="https://picsum.photos/330/100" alt="" style="display: block;">
</div>
<div style="flex: 1 1 40%;">
<?php
echo do_shortcode('[biuro-contacts--employees-quick]');
?>
</div>
</div>
<?php get_footer();
......@@ -122,7 +122,7 @@ function biuro_widger_areas() {
unregister_widget('WP_Widget_Tag_Cloud');
// unregister_widget('Twenty_Eleven_Ephemera_Widget');
unregister_widget('WP_Widget_Media_Video');
// unregister_widget('WP_Widget_Custom_HTML');
unregister_widget('WP_Widget_Custom_HTML');
unregister_widget('PLL_Widget_Calendar');
unregister_widget('PLL_Widget_Languages');
unregister_widget('PodsWidgetSingle');
......@@ -199,8 +199,8 @@ function biuro_widger_areas() {
) );
register_sidebar( array(
'name' => 'Sales page: Employers',
'id' => 'sales_page_employers',
'name' => 'Sales page: Sections',
'id' => 'sales_page_sections',
'before_widget' => '',
'after_widget' => '',
'before_title' => '',
......@@ -208,8 +208,8 @@ function biuro_widger_areas() {
) );
register_sidebar( array(
'name' => 'Sales page: Sections',
'id' => 'sales_page_sections',
'name' => 'Sales page: Feedbacks',
'id' => 'sales_page_feedbacks',
'before_widget' => '',
'after_widget' => '',
'before_title' => '',
......@@ -217,8 +217,8 @@ function biuro_widger_areas() {
) );
register_sidebar( array(
'name' => 'Sales page: Feedbacks',
'id' => 'sales_page_feedbacks',
'name' => 'Sales page: Employers',
'id' => 'sales_page_employers',
'before_widget' => '',
'after_widget' => '',
'before_title' => '',
......
......@@ -31,16 +31,16 @@ define('cityID', $cityID);
get_template_part( 'template-parts/meta/canonical');
?>
<style><?php include 'css/core-a25434ed1d.min.css'; ?></style>
<style><?php include 'css/core.min.css'; ?></style>
<link rel="preload" href="/wp-content/themes/biuro/css/main-dcf0970343.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-dcf0970343.min.css">
<link rel="stylesheet" href="/wp-content/themes/biuro/css/main.min.css">
</noscript>
<?php wp_head(); ?>
......
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -42,18 +42,7 @@
endif;
?>
<h2>Mumis pasitiki</h2>
<div class="c-logos">
<div>1 logo</div>
<div>2 logo</div>
<div>3 logo</div>
<div>4 logo</div>
<div>5 logo</div>
<div>6 logo</div>
<div>7 logo</div>
</div>
<div style="border: 1px solid orange;">
<h2 style="color:; red">Sektoriai</h2>
<?php
......@@ -61,21 +50,52 @@
dynamic_sidebar( 'sales_page_sections' );
endif;
?>
</div>
<br>
<h2 style="color:; red">Atsiliepimai</h2>
<div style="border: 1px solid green; display: flex;">
<h2 style="flex: 1 1 10%">Mumis pasitiki</h2>
<?php
if ( is_active_sidebar( 'sales_page_feedbacks' ) ) :
dynamic_sidebar( 'sales_page_feedbacks' );
endif;
?>
<div class="c-logos" style="flex: 1 1 50%">
<div>1 logo</div>
<div>2 logo</div>
<div>3 logo</div>
<div>4 logo</div>
</div>
</div>
<br>
<h2>Forma</h2>
<p>ToDo</p>
<div style="border: 1px solid grey;">
<h2 style="color:; red">Atsiliepimai</h2>
<?php
if ( is_active_sidebar( 'sales_page_feedbacks' ) ) :
dynamic_sidebar( 'sales_page_feedbacks' );
endif;
?>
</div>
<br>
<div style="border: 1px solid blue; display: flex;">
<div style="flex: 1 1 40%;">
<?php
if ( is_active_sidebar( 'sales_page_employers' ) ) :
dynamic_sidebar( 'sales_page_employers' );
endif;
?>
<img src="https://picsum.photos/330/100" alt="" style="display: block;">
</div>
<div style="flex: 1 1 40%;">
<?php
echo do_shortcode('[biuro-contacts--employers-quick]');
?>
</div>
</div>
<br>
<?php get_footer();
......@@ -21,9 +21,10 @@ global $jobs;
</tr>
<?php
while ( $jobs->fetch() ) :
$ID = $jobs->display( 'ID' );
$i++;
$i = 0;
while ( $jobs->fetch() ) :
$ID = $jobs->display( 'ID' );
$i++;
?>
<tr <?php if ( $i % 2 != 0 ) { echo 'class="c-jobs-list--row-odd"'; } ?>>
<td class="c-jobs-list--col c-jobs-list--col-position">
......@@ -55,7 +56,7 @@ global $jobs;
</tr>
<?php
endwhile;
endwhile;
?>
</table>
......
......@@ -43,6 +43,7 @@ wp plugin activate akismet --network
wp plugin activate biuro-contacts --network
wp plugin activate biuro-feedbacks --network
wp plugin activate biuro-html --network
wp plugin activate biuro-sections --network
wp plugin activate biuro-services --network
wp plugin activate biuro-values --network
......
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