Commit 4c6d20ea authored by Simonas's avatar Simonas

Merge branch 'dev'

parents f98ebdf6 b5042c33
...@@ -103,10 +103,9 @@ Restart docker (sometimes PC restart may be required) ...@@ -103,10 +103,9 @@ Restart docker (sometimes PC restart may be required)
- docker load --input ourdemo.tar - docker load --input ourdemo.tar
- docker build -t biuro/web:0.0.1 . - docker build -t biuro/web:0.0.2 .
- docker login --username=biuro --password=9Ndtjd2vKsLvGuFOeFq1KdJs - docker login --username=biuro --password=9Ndtjd2vKsLvGuFOeFq1KdJs
- docker push biuro/web:0.0.1 - docker push biuro/web:0.0.2
- docker pull biuro/web:0.0.0
- sudo chown -R www-data:www-data wordpress/wp-content/plugins - sudo chown -R www-data:www-data wordpress/wp-content/plugins
......
...@@ -28,6 +28,7 @@ services: ...@@ -28,6 +28,7 @@ services:
volumes: volumes:
- ./nginx/php.ini:/usr/local/etc/php/conf.d/php.ini - ./nginx/php.ini:/usr/local/etc/php/conf.d/php.ini
- ./wp-content/plugins/biuro-contacts:/var/www/html/wp-content/plugins/biuro-contacts
- ./wp-content/plugins/cookies-warning:/var/www/html/wp-content/plugins/cookies-warning - ./wp-content/plugins/cookies-warning:/var/www/html/wp-content/plugins/cookies-warning
- ./wp-content/plugins/data-controller:/var/www/html/wp-content/plugins/data-controller - ./wp-content/plugins/data-controller:/var/www/html/wp-content/plugins/data-controller
- ./wp-content/plugins/jobs-importer:/var/www/html/wp-content/plugins/jobs-importer - ./wp-content/plugins/jobs-importer:/var/www/html/wp-content/plugins/jobs-importer
...@@ -78,6 +79,7 @@ services: ...@@ -78,6 +79,7 @@ services:
- ./certs:/etc/letsencrypt - ./certs:/etc/letsencrypt
- ./certs-data:/data/letsencrypt - ./certs-data:/data/letsencrypt
- ./wp-content/plugins/biuro-contacts:/var/www/html/wp-content/plugins/biuro-contacts
- ./wp-content/plugins/cookies-warning:/var/www/html/wp-content/plugins/cookies-warning - ./wp-content/plugins/cookies-warning:/var/www/html/wp-content/plugins/cookies-warning
- ./wp-content/plugins/data-controller:/var/www/html/wp-content/plugins/data-controller - ./wp-content/plugins/data-controller:/var/www/html/wp-content/plugins/data-controller
- ./wp-content/plugins/jobs-importer:/var/www/html/wp-content/plugins/jobs-importer - ./wp-content/plugins/jobs-importer:/var/www/html/wp-content/plugins/jobs-importer
...@@ -106,6 +108,7 @@ services: ...@@ -106,6 +108,7 @@ services:
volumes: volumes:
- './var/wp-cli/cache:/etc/X11/fs/.wp-cli/cache' - './var/wp-cli/cache:/etc/X11/fs/.wp-cli/cache'
- ./wp-content/plugins/biuro-contacts:/var/www/html/wp-content/plugins/biuro-contacts
- ./wp-content/plugins/cookies-warning:/var/www/html/wp-content/plugins/cookies-warning - ./wp-content/plugins/cookies-warning:/var/www/html/wp-content/plugins/cookies-warning
- ./wp-content/plugins/data-controller:/var/www/html/wp-content/plugins/data-controller - ./wp-content/plugins/data-controller:/var/www/html/wp-content/plugins/data-controller
- ./wp-content/plugins/jobs-importer:/var/www/html/wp-content/plugins/jobs-importer - ./wp-content/plugins/jobs-importer:/var/www/html/wp-content/plugins/jobs-importer
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -8,24 +8,24 @@ ...@@ -8,24 +8,24 @@
}, },
"author": "Simon", "author": "Simon",
"devDependencies": { "devDependencies": {
"@babel/core": "^7.2.2", "@babel/core": "^7.3.4",
"@babel/plugin-syntax-dynamic-import": "^7.0.0", "@babel/plugin-syntax-dynamic-import": "^7.0.0",
"@babel/plugin-transform-runtime": "^7.1.0", "@babel/plugin-transform-runtime": "^7.3.4",
"@babel/preset-env": "^7.1.6", "@babel/preset-env": "^7.3.4",
"@babel/preset-react": "^7.0.0", "@babel/preset-react": "^7.0.0",
"@babel/register": "^7.0.0", "@babel/register": "^7.0.0",
"@babel/runtime": "^7.1.2", "@babel/runtime": "^7.3.4",
"autoprefixer": "^9.4.3", "autoprefixer": "^9.4.10",
"babel-loader": "^8.0.4", "babel-loader": "^8.0.5",
"browser-sync": "^2.24.6", "browser-sync": "^2.24.6",
"connect-modrewrite": "^0.10.2", "connect-modrewrite": "^0.10.2",
"css-mqpacker": "^7.0.0", "css-mqpacker": "^7.0.0",
"cssnano": "^4.1.7", "cssnano": "^4.1.10",
"del": "^3.0.0", "del": "^3.0.0",
"eslint-config-standard": "^12.0.0", "eslint-config-standard": "^12.0.0",
"eslint-config-standard-preact": "^1.1.6", "eslint-config-standard-preact": "^1.1.6",
"eslint-plugin-import": "^2.14.0", "eslint-plugin-import": "^2.16.0",
"eslint-plugin-node": "^8.0.0", "eslint-plugin-node": "^8.0.1",
"eslint-plugin-promise": "^4.0.1", "eslint-plugin-promise": "^4.0.1",
"eslint-plugin-standard": "^4.0.0", "eslint-plugin-standard": "^4.0.0",
"glob": "^7.1.3", "glob": "^7.1.3",
...@@ -38,28 +38,28 @@ ...@@ -38,28 +38,28 @@
"gulp-rename": "^1.4.0", "gulp-rename": "^1.4.0",
"gulp-replace": "^1.0.0", "gulp-replace": "^1.0.0",
"gulp-rev": "^9.0.0", "gulp-rev": "^9.0.0",
"gulp-sourcemaps": "^2.6.4", "gulp-sourcemaps": "^2.6.5",
"http2": "^3.3.7", "http2": "^3.3.7",
"postcss": "^7.0.7", "postcss": "^7.0.14",
"postcss-browser-reporter": "^0.5.0", "postcss-browser-reporter": "^0.5.0",
"postcss-critical-split": "^2.5.1", "postcss-critical-split": "^2.5.1",
"postcss-custom-media": "^7.0.7", "postcss-custom-media": "^7.0.7",
"postcss-extend": "^1.0.5", "postcss-extend": "^1.0.5",
"postcss-import": "^12.0.1", "postcss-import": "^12.0.1",
"postcss-nested": "^4.1.1", "postcss-nested": "^4.1.2",
"postcss-preset-env": "^6.5.0", "postcss-preset-env": "^6.6.0",
"postcss-reporter": "^6.0.0", "postcss-reporter": "^6.0.1",
"precss": "^4.0.0", "precss": "^4.0.0",
"stylelint": "^9.8.0", "stylelint": "^9.10.1",
"stylelint-config-standard": "^18.2.0", "stylelint-config-standard": "^18.2.0",
"webpack": "^4.25.1", "webpack": "^4.29.6",
"webpack-bundle-analyzer": "^3.0.3", "webpack-bundle-analyzer": "^3.1.0",
"webpack-dev-middleware": "^3.1.3", "webpack-dev-middleware": "^3.6.1",
"webpack-hot-middleware": "^2.22.3", "webpack-hot-middleware": "^2.22.3",
"write-file-webpack-plugin": "^4.3.2" "write-file-webpack-plugin": "^4.3.2"
}, },
"dependencies": { "dependencies": {
"npm": "^6.4.1", "npm": "^6.9.0",
"preact": "^8.3.1", "preact": "^8.3.1",
"preact-async-route": "^2.2.1", "preact-async-route": "^2.2.1",
"preact-router": "^2.6.1" "preact-router": "^2.6.1"
......
...@@ -35,37 +35,39 @@ export function server () { ...@@ -35,37 +35,39 @@ export function server () {
bs.init({ bs.init({
logPrefix: 'Biuro', logPrefix: 'Biuro',
socket: { socket: {
domain: 'https://dev.biuro.lt:2000' // domain: 'localhost:443'
// port: 443 domain: 'https://10.0.75.1:3000/'
// // port: 2000
}, },
proxy: conf.proxy,
// proxy: { // proxy: {
// target: conf.proxy // target: 'https://dev.biuro.lt'
// // proxyRes: [ // ws: false
// // function (proxyRes, req, res) {
// // // console.log(proxyRes.headers);
// // console.log(req);
// // }
// // ],
// // ws: true
// }, // },
proxy: {
target: 'https://dev.biuro.lt/',
proxyRes: [
function (proxyRes, req, res) {
// console.log(proxyRes.headers);
console.log(req);
}
],
ws: true
},
// httpModule: http2, // httpModule: http2,
https: { https: {
key: conf.certs.key, key: conf.certs.key,
cert: conf.certs.cert cert: conf.certs.cert
}, },
files: [ // files: [
`wp-content/themes/${conf.name}/**/*.php`, // `wp-content/themes/${conf.name}/**/*.php`,
`wp-content/themes/${conf.name}/css/main.min.css` // `wp-content/themes/${conf.name}/css/main.min.css`
],
open: false,
port: 2000,
server: false,
// serveStatic: [
// `wp-content/themes/${conf.name}/css/`,
// `wp-content/themes/${conf.name}/js/`
// ], // ],
ghostMode: false,
open: false,
// port: 2000,
// server: false,
ui: false, ui: false,
// notify: false,
middleware: [ middleware: [
webpackDevMiddleware(bundler, { /* options */ }), webpackDevMiddleware(bundler, { /* options */ }),
webpackHotMiddleware(bundler) webpackHotMiddleware(bundler)
......
...@@ -24,6 +24,15 @@ let config = { ...@@ -24,6 +24,15 @@ let config = {
] ]
}, },
// devServer: {
// // contentBase: path.join(__dirname, 'dist'),
// // compress: true,
// allowedHosts: [
// 'dev.biuro.lt'
// ],
// // port: 3000
// },
mode: conf.env, mode: conf.env,
module: { module: {
......
This diff is collapsed.
=== Plugin Name ===
Contributors: (this should be a list of wordpress.org userid's)
Donate link: https://www.biuro.lt
Tags: comments, spam
Requires at least: 3.0.1
Tested up to: 3.4
Stable tag: 4.3
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Here is a short description of the plugin. This should be no more than 150 characters. No markup here.
== Description ==
This is the long description. No limit, and you can use Markdown (as well as in the following sections).
For backwards compatibility, if this section is missing, the full length of the short description will be used, and
Markdown parsed.
A few notes about the sections above:
* "Contributors" is a comma separated list of wp.org/wp-plugins.org usernames
* "Tags" is a comma separated list of tags that apply to the plugin
* "Requires at least" is the lowest version that the plugin will work on
* "Tested up to" is the highest version that you've *successfully used to test the plugin*. Note that it might work on
higher versions... this is just the highest one you've verified.
* Stable tag should indicate the Subversion "tag" of the latest stable version, or "trunk," if you use `/trunk/` for
stable.
Note that the `readme.txt` of the stable tag is the one that is considered the defining one for the plugin, so
if the `/trunk/readme.txt` file says that the stable tag is `4.3`, then it is `/tags/4.3/readme.txt` that'll be used
for displaying information about the plugin. In this situation, the only thing considered from the trunk `readme.txt`
is the stable tag pointer. Thus, if you develop in trunk, you can update the trunk `readme.txt` to reflect changes in
your in-development version, without having that information incorrectly disclosed about the current stable version
that lacks those changes -- as long as the trunk's `readme.txt` points to the correct stable tag.
If no stable tag is provided, it is assumed that trunk is stable, but you should specify "trunk" if that's where
you put the stable version, in order to eliminate any doubt.
== Installation ==
This section describes how to install the plugin and get it working.
e.g.
1. Upload `biuro-contacts.php` to the `/wp-content/plugins/` directory
1. Activate the plugin through the 'Plugins' menu in WordPress
1. Place `<?php do_action('plugin_name_hook'); ?>` in your templates
== Frequently Asked Questions ==
= A question that someone might have =
An answer to that question.
= What about foo bar? =
Answer to foo bar dilemma.
== Screenshots ==
1. This screen shot description corresponds to screenshot-1.(png|jpg|jpeg|gif). Note that the screenshot is taken from
the /assets directory or the directory that contains the stable readme.txt (tags or trunk). Screenshots in the /assets
directory take precedence. For example, `/assets/screenshot-1.png` would win over `/tags/4.3/screenshot-1.png`
(or jpg, jpeg, gif).
2. This is the second screen shot
== Changelog ==
= 1.0 =
* A change since the previous version.
* Another change.
= 0.5 =
* List versions from most recent at top to oldest at bottom.
== Upgrade Notice ==
= 1.0 =
Upgrade notices describe the reason a user should upgrade. No more than 300 characters.
= 0.5 =
This version fixes a security related bug. Upgrade immediately.
== Arbitrary section ==
You may provide arbitrary sections, in the same format as the ones above. This may be of use for extremely complicated
plugins where more information needs to be conveyed that doesn't fit into the categories of "description" or
"installation." Arbitrary sections will be shown below the built-in sections outlined above.
== A brief Markdown Example ==
Ordered list:
1. Some feature
1. Another feature
1. Something else about the plugin
Unordered list:
* something
* something else
* third thing
Here's a link to [WordPress](http://wordpress.org/ "Your favorite software") and one to [Markdown's Syntax Documentation][markdown syntax].
Titles are optional, naturally.
[markdown syntax]: http://daringfireball.net/projects/markdown/syntax
"Markdown is what the parser uses to process much of the readme file"
Markdown uses email style notation for blockquotes and I've been told:
> Asterisks for *emphasis*. Double it up for **strong**.
`<?php code(); // goes in backticks ?>`
\ No newline at end of file
<?php
/**
* The admin-specific functionality of the plugin.
*
* @link https://www.biuro.lt
* @since 1.0.0
*
* @package Biuro_Contacts
* @subpackage Biuro_Contacts/admin
*/
/**
* The admin-specific functionality of the plugin.
*
* Defines the plugin name, version, and two examples hooks for how to
* enqueue the admin-specific stylesheet and JavaScript.
*
* @package Biuro_Contacts
* @subpackage Biuro_Contacts/admin
* @author Biuro <info@biuro.lt>
*/
class Biuro_Contacts_Admin {
/**
* The ID of this plugin.
*
* @since 1.0.0
* @access private
* @var string $plugin_name The ID of this plugin.
*/
private $plugin_name;
/**
* The version of this plugin.
*
* @since 1.0.0
* @access private
* @var string $version The current version of this plugin.
*/
private $version;
/**
* Initialize the class and set its properties.
*
* @since 1.0.0
* @param string $plugin_name The name of this plugin.
* @param string $version The version of this plugin.
*/
public function __construct( $plugin_name, $version ) {
$this->plugin_name = $plugin_name;
$this->version = $version;
}
/**
* Register the stylesheets for the admin area.
*
* @since 1.0.0
*/
public function enqueue_styles() {
/**
* This function is provided for demonstration purposes only.
*
* An instance of this class should be passed to the run() function
* defined in Biuro_Contacts_Loader as all of the hooks are defined
* in that particular class.
*
* The Biuro_Contacts_Loader will then create the relationship
* between the defined hooks and the functions defined in this
* class.
*/
wp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'css/biuro-contacts-admin.css', array(), $this->version, 'all' );
}
/**
* Register the JavaScript for the admin area.
*
* @since 1.0.0
*/
public function enqueue_scripts() {
/**
* This function is provided for demonstration purposes only.
*
* An instance of this class should be passed to the run() function
* defined in Biuro_Contacts_Loader as all of the hooks are defined
* in that particular class.
*
* The Biuro_Contacts_Loader will then create the relationship
* between the defined hooks and the functions defined in this
* class.
*/
wp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'js/biuro-contacts-admin.js', array( 'jquery' ), $this->version, false );
}
}
/**
* All of the CSS for your admin-specific functionality should be
* included in this file.
*/
\ No newline at end of file
<?php // Silence is golden
\ No newline at end of file
(function( $ ) {
'use strict';
/**
* All of the code for your admin-facing JavaScript source
* should reside in this file.
*
* Note: It has been assumed you will write jQuery code here, so the
* $ function reference has been prepared for usage within the scope
* of this function.
*
* This enables you to define handlers, for when the DOM is ready:
*
* $(function() {
*
* });
*
* When the window is loaded:
*
* $( window ).load(function() {
*
* });
*
* ...and/or other possibilities.
*
* Ideally, it is not considered best practise to attach more than a
* single DOM-ready or window-load handler for a particular page.
* Although scripts in the WordPress core, Plugins and Themes may be
* practising this, we should strive to set a better example in our own work.
*/
})( jQuery );
<?php
/**
* Provide a admin area view for the plugin
*
* This file is used to markup the admin-facing aspects of the plugin.
*
* @link https://www.biuro.lt
* @since 1.0.0
*
* @package Biuro_Contacts
* @subpackage Biuro_Contacts/admin/partials
*/
?>
<!-- This file should primarily consist of HTML with a little bit of PHP. -->
<?php
/**
* The plugin bootstrap file
*
* This file is read by WordPress to generate the plugin information in the plugin
* admin area. This file also includes all of the dependencies used by the plugin,
* registers the activation and deactivation functions, and defines a function
* that starts the plugin.
*
* @link https://www.biuro.lt
* @since 1.0.0
* @package Biuro_Contacts
*
* @wordpress-plugin
* Plugin Name: Biuro Contacts
* Plugin URI: https://www.biuro.lt
* Description: This is a short description of what the plugin does. It's displayed in the WordPress admin area.
* Version: 1.0.0
* Author: Biuro
* Author URI: https://www.biuro.lt
* License: GPL-2.0+
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
* Text Domain: biuro-contacts
* Domain Path: /languages
*/
// If this file is called directly, abort.
if ( ! defined( 'WPINC' ) ) {
die;
}
/**
* Currently plugin version.
* Start at version 1.0.0 and use SemVer - https://semver.org
* Rename this for your plugin and update it as you release new versions.
*/
define( 'BIURO_CONTACTS_VERSION', '1.0.0' );
/**
* The code that runs during plugin activation.
* This action is documented in includes/class-biuro-contacts-activator.php
*/
function activate_biuro_contacts() {
require_once plugin_dir_path( __FILE__ ) . 'includes/class-biuro-contacts-activator.php';
Biuro_Contacts_Activator::activate();
}
/**
* The code that runs during plugin deactivation.
* This action is documented in includes/class-biuro-contacts-deactivator.php
*/
function deactivate_biuro_contacts() {
require_once plugin_dir_path( __FILE__ ) . 'includes/class-biuro-contacts-deactivator.php';
Biuro_Contacts_Deactivator::deactivate();
}
register_activation_hook( __FILE__, 'activate_biuro_contacts' );
register_deactivation_hook( __FILE__, 'deactivate_biuro_contacts' );
/**
* The core plugin class that is used to define internationalization,
* admin-specific hooks, and public-facing site hooks.
*/
require plugin_dir_path( __FILE__ ) . 'includes/class-biuro-contacts.php';
/**
* Begins execution of the plugin.
*
* Since everything within the plugin is registered via hooks,
* then kicking off the plugin from this point in the file does
* not affect the page life cycle.
*
* @since 1.0.0
*/
function run_biuro_contacts() {
$plugin = new Biuro_Contacts();
$plugin->run();
}
run_biuro_contacts();
<?php
/**
* Fired during plugin activation
*
* @link https://www.biuro.lt
* @since 1.0.0
*
* @package Biuro_Contacts
* @subpackage Biuro_Contacts/includes
*/
/**
* Fired during plugin activation.
*
* This class defines all code necessary to run during the plugin's activation.
*
* @since 1.0.0
* @package Biuro_Contacts
* @subpackage Biuro_Contacts/includes
* @author Biuro <info@biuro.lt>
*/
class Biuro_Contacts_Activator {
/**
* Short Description. (use period)
*
* Long Description.
*
* @since 1.0.0
*/
public static function activate() {
}
}
<?php
/**
* Fired during plugin deactivation
*
* @link https://www.biuro.lt
* @since 1.0.0
*
* @package Biuro_Contacts
* @subpackage Biuro_Contacts/includes
*/
/**
* Fired during plugin deactivation.
*
* This class defines all code necessary to run during the plugin's deactivation.
*
* @since 1.0.0
* @package Biuro_Contacts
* @subpackage Biuro_Contacts/includes
* @author Biuro <info@biuro.lt>
*/
class Biuro_Contacts_Deactivator {
/**
* Short Description. (use period)
*
* Long Description.
*
* @since 1.0.0
*/
public static function deactivate() {
}
}
<?php
/**
* Define the internationalization functionality
*
* Loads and defines the internationalization files for this plugin
* so that it is ready for translation.
*
* @link https://www.biuro.lt
* @since 1.0.0
*
* @package Biuro_Contacts
* @subpackage Biuro_Contacts/includes
*/
/**
* Define the internationalization functionality.
*
* Loads and defines the internationalization files for this plugin
* so that it is ready for translation.
*
* @since 1.0.0
* @package Biuro_Contacts
* @subpackage Biuro_Contacts/includes
* @author Biuro <info@biuro.lt>
*/
class Biuro_Contacts_i18n {
/**
* Load the plugin text domain for translation.
*
* @since 1.0.0
*/
public function load_plugin_textdomain() {
load_plugin_textdomain(
'biuro-contacts',
false,
dirname( dirname( plugin_basename( __FILE__ ) ) ) . '/languages/'
);
}
}
<?php
/**
* Register all actions and filters for the plugin
*
* @link https://www.biuro.lt
* @since 1.0.0
*
* @package Biuro_Contacts
* @subpackage Biuro_Contacts/includes
*/
/**
* Register all actions and filters for the plugin.
*
* Maintain a list of all hooks that are registered throughout
* the plugin, and register them with the WordPress API. Call the
* run function to execute the list of actions and filters.
*
* @package Biuro_Contacts
* @subpackage Biuro_Contacts/includes
* @author Biuro <info@biuro.lt>
*/
class Biuro_Contacts_Loader {
/**
* The array of actions registered with WordPress.
*
* @since 1.0.0
* @access protected
* @var array $actions The actions registered with WordPress to fire when the plugin loads.
*/
protected $actions;
/**
* The array of filters registered with WordPress.
*
* @since 1.0.0
* @access protected
* @var array $filters The filters registered with WordPress to fire when the plugin loads.
*/
protected $filters;
/**
* Initialize the collections used to maintain the actions and filters.
*
* @since 1.0.0
*/
public function __construct() {
$this->actions = array();
$this->filters = array();
}
/**
* Add a new action to the collection to be registered with WordPress.
*
* @since 1.0.0
* @param string $hook The name of the WordPress action that is being registered.
* @param object $component A reference to the instance of the object on which the action is defined.
* @param string $callback The name of the function definition on the $component.
* @param int $priority Optional. The priority at which the function should be fired. Default is 10.
* @param int $accepted_args Optional. The number of arguments that should be passed to the $callback. Default is 1.
*/
public function add_action( $hook, $component, $callback, $priority = 10, $accepted_args = 1 ) {
$this->actions = $this->add( $this->actions, $hook, $component, $callback, $priority, $accepted_args );
}
/**
* Add a new filter to the collection to be registered with WordPress.
*
* @since 1.0.0
* @param string $hook The name of the WordPress filter that is being registered.
* @param object $component A reference to the instance of the object on which the filter is defined.
* @param string $callback The name of the function definition on the $component.
* @param int $priority Optional. The priority at which the function should be fired. Default is 10.
* @param int $accepted_args Optional. The number of arguments that should be passed to the $callback. Default is 1
*/
public function add_filter( $hook, $component, $callback, $priority = 10, $accepted_args = 1 ) {
$this->filters = $this->add( $this->filters, $hook, $component, $callback, $priority, $accepted_args );
}
/**
* A utility function that is used to register the actions and hooks into a single
* collection.
*
* @since 1.0.0
* @access private
* @param array $hooks The collection of hooks that is being registered (that is, actions or filters).
* @param string $hook The name of the WordPress filter that is being registered.
* @param object $component A reference to the instance of the object on which the filter is defined.
* @param string $callback The name of the function definition on the $component.
* @param int $priority The priority at which the function should be fired.
* @param int $accepted_args The number of arguments that should be passed to the $callback.
* @return array The collection of actions and filters registered with WordPress.
*/
private function add( $hooks, $hook, $component, $callback, $priority, $accepted_args ) {
$hooks[] = array(
'hook' => $hook,
'component' => $component,
'callback' => $callback,
'priority' => $priority,
'accepted_args' => $accepted_args
);
return $hooks;
}
/**
* Register the filters and actions with WordPress.
*
* @since 1.0.0
*/
public function run() {
foreach ( $this->filters as $hook ) {
add_filter( $hook['hook'], array( $hook['component'], $hook['callback'] ), $hook['priority'], $hook['accepted_args'] );
}
foreach ( $this->actions as $hook ) {
add_action( $hook['hook'], array( $hook['component'], $hook['callback'] ), $hook['priority'], $hook['accepted_args'] );
}
}
}
<?php
/**
* The file that defines the core plugin class
*
* A class definition that includes attributes and functions used across both the
* public-facing side of the site and the admin area.
*
* @link https://www.biuro.lt
* @since 1.0.0
*
* @package Biuro_Contacts
* @subpackage Biuro_Contacts/includes
*/
/**
* The core plugin class.
*
* This is used to define internationalization, admin-specific hooks, and
* public-facing site hooks.
*
* Also maintains the unique identifier of this plugin as well as the current
* version of the plugin.
*
* @since 1.0.0
* @package Biuro_Contacts
* @subpackage Biuro_Contacts/includes
* @author Biuro <info@biuro.lt>
*/
class Biuro_Contacts {
/**
* The loader that's responsible for maintaining and registering all hooks that power
* the plugin.
*
* @since 1.0.0
* @access protected
* @var Biuro_Contacts_Loader $loader Maintains and registers all hooks for the plugin.
*/
protected $loader;
/**
* The unique identifier of this plugin.
*
* @since 1.0.0
* @access protected
* @var string $plugin_name The string used to uniquely identify this plugin.
*/
protected $plugin_name;
/**
* The current version of the plugin.
*
* @since 1.0.0
* @access protected
* @var string $version The current version of the plugin.
*/
protected $version;
/**
* Define the core functionality of the plugin.
*
* Set the plugin name and the plugin version that can be used throughout the plugin.
* Load the dependencies, define the locale, and set the hooks for the admin area and
* the public-facing side of the site.
*
* @since 1.0.0
*/
public function __construct() {
if ( defined( 'BIURO_CONTACTS_VERSION' ) ) {
$this->version = BIURO_CONTACTS_VERSION;
} else {
$this->version = '1.0.0';
}
$this->plugin_name = 'biuro-contacts';
$this->load_dependencies();
$this->set_locale();
$this->define_admin_hooks();
$this->define_public_hooks();
}
/**
* Load the required dependencies for this plugin.
*
* Include the following files that make up the plugin:
*
* - Biuro_Contacts_Loader. Orchestrates the hooks of the plugin.
* - Biuro_Contacts_i18n. Defines internationalization functionality.
* - Biuro_Contacts_Admin. Defines all hooks for the admin area.
* - Biuro_Contacts_Public. Defines all hooks for the public side of the site.
*
* Create an instance of the loader which will be used to register the hooks
* with WordPress.
*
* @since 1.0.0
* @access private
*/
private function load_dependencies() {
/**
* The class responsible for orchestrating the actions and filters of the
* core plugin.
*/
require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-biuro-contacts-loader.php';
/**
* The class responsible for defining internationalization functionality
* of the plugin.
*/
require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-biuro-contacts-i18n.php';
/**
* The class responsible for defining all actions that occur in the admin area.
*/
require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-biuro-contacts-admin.php';
/**
* The class responsible for defining all actions that occur in the public-facing
* side of the site.
*/
require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-biuro-contacts-public.php';
$this->loader = new Biuro_Contacts_Loader();
}
/**
* Define the locale for this plugin for internationalization.
*
* Uses the Biuro_Contacts_i18n class in order to set the domain and to register the hook
* with WordPress.
*
* @since 1.0.0
* @access private
*/
private function set_locale() {
$plugin_i18n = new Biuro_Contacts_i18n();
$this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' );
}
/**
* Register all of the hooks related to the admin area functionality
* of the plugin.
*
* @since 1.0.0
* @access private
*/
private function define_admin_hooks() {
$plugin_admin = new Biuro_Contacts_Admin( $this->get_plugin_name(), $this->get_version() );
$this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' );
$this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts' );
}
/**
* Register all of the hooks related to the public-facing functionality
* of the plugin.
*
* @since 1.0.0
* @access private
*/
private function define_public_hooks() {
$plugin_public = new Biuro_Contacts_Public( $this->get_plugin_name(), $this->get_version() );
$this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_styles' );
$this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_scripts' );
$this->loader->add_action( 'init', $plugin_public, 'register_shortcodes' );
}
/**
* Run the loader to execute all of the hooks with WordPress.
*
* @since 1.0.0
*/
public function run() {
$this->loader->run();
}
/**
* The name of the plugin used to uniquely identify it within the context of
* WordPress and to define internationalization functionality.
*
* @since 1.0.0
* @return string The name of the plugin.
*/
public function get_plugin_name() {
return $this->plugin_name;
}
/**
* The reference to the class that orchestrates the hooks with the plugin.
*
* @since 1.0.0
* @return Biuro_Contacts_Loader Orchestrates the hooks of the plugin.
*/
public function get_loader() {
return $this->loader;
}
/**
* Retrieve the version number of the plugin.
*
* @since 1.0.0
* @return string The version number of the plugin.
*/
public function get_version() {
return $this->version;
}
}
<?php // Silence is golden
\ No newline at end of file
<?php // Silence is golden
\ No newline at end of file
<?php
/**
* The public-facing functionality of the plugin.
*
* @link https://www.biuro.lt
* @since 1.0.0
*
* @package Biuro_Contacts
* @subpackage Biuro_Contacts/public
*/
/**
* The public-facing functionality of the plugin.
*
* Defines the plugin name, version, and two examples hooks for how to
* enqueue the public-facing stylesheet and JavaScript.
*
* @package Biuro_Contacts
* @subpackage Biuro_Contacts/public
* @author Biuro <info@biuro.lt>
*/
class Biuro_Contacts_Public {
/**
* The ID of this plugin.
*
* @since 1.0.0
* @access private
* @var string $plugin_name The ID of this plugin.
*/
private $plugin_name;
/**
* The version of this plugin.
*
* @since 1.0.0
* @access private
* @var string $version The current version of this plugin.
*/
private $version;
/**
* Initialize the class and set its properties.
*
* @since 1.0.0
* @param string $plugin_name The name of the plugin.
* @param string $version The version of this plugin.
*/
public function __construct( $plugin_name, $version ) {
$this->plugin_name = $plugin_name;
$this->version = $version;
}
/**
* Register the stylesheets for the public-facing side of the site.
*
* @since 1.0.0
*/
public function enqueue_styles() {
/**
* This function is provided for demonstration purposes only.
*
* An instance of this class should be passed to the run() function
* defined in Biuro_Contacts_Loader as all of the hooks are defined
* in that particular class.
*
* The Biuro_Contacts_Loader will then create the relationship
* between the defined hooks and the functions defined in this
* class.
*/
// wp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'css/biuro-contacts-public.css', array(), $this->version, 'all' );
}
/**
* Register the JavaScript for the public-facing side of the site.
*
* @since 1.0.0
*/
public function enqueue_scripts() {
/**
* This function is provided for demonstration purposes only.
*
* An instance of this class should be passed to the run() function
* defined in Biuro_Contacts_Loader as all of the hooks are defined
* in that particular class.
*
* The Biuro_Contacts_Loader will then create the relationship
* between the defined hooks and the functions defined in this
* class.
*/
// wp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'js/biuro-contacts-public.js', array( 'jquery' ), $this->version, false );
}
/**
* Processes shortcode biuro-contacts--employees
*
* @param array $attr The attributes from the shortcode
*
* @return mixed $output Output of the buffer
*/
public function employees_form( $attr = array() ) {
$response = false;
ob_start();
if ( isset( $_POST['action-submit'] ) ) :
$response = true;
endif;
include 'partials/biuro-contacts-public--employees.php';
$output = ob_get_contents();
ob_end_clean();
return $output;
} // employees_form()
/**
* Processes shortcode biuro-contacts--employers
*
* @param array $attr The attributes from the shortcode
*
* @return mixed $output Output of the buffer
*/
public function employers_form( $attr = array() ) {
$response = false;
ob_start();
if ( isset( $_POST['action-submit'] ) ) :
$response = true;
endif;
include 'partials/biuro-contacts-public--employers.php';
$output = ob_get_contents();
ob_end_clean();
return $output;
} // employers_form()
/**
* Processes shortcode biuro-contacts--position
*
* @param array $attr The attributes from the shortcode
*
* @return mixed $output Output of the buffer
*/
public function position_form( $attr = array() ) {
$response = false;
ob_start();
if ( isset( $_POST['action-submit'] ) ) :
$response = true;
endif;
include 'partials/biuro-contacts-public--position.php';
$output = ob_get_contents();
ob_end_clean();
return $output;
} // position_form()
/**
* Registers all shortcodes at once
*
* @return [type] [description]
*/
public function register_shortcodes() {
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()
}
/**
* All of the CSS for your public-facing functionality should be
* included in this file.
*/
\ No newline at end of file
<?php // Silence is golden
\ No newline at end of file
(function( $ ) {
'use strict';
/**
* All of the code for your public-facing JavaScript source
* should reside in this file.
*
* Note: It has been assumed you will write jQuery code here, so the
* $ function reference has been prepared for usage within the scope
* of this function.
*
* This enables you to define handlers, for when the DOM is ready:
*
* $(function() {
*
* });
*
* When the window is loaded:
*
* $( window ).load(function() {
*
* });
*
* ...and/or other possibilities.
*
* Ideally, it is not considered best practise to attach more than a
* single DOM-ready or window-load handler for a particular page.
* Although scripts in the WordPress core, Plugins and Themes may be
* practising this, we should strive to set a better example in our own work.
*/
})( jQuery );
<?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 id="ContactFormEmployee_ContactFormEmployee" action="<?php echo $_SERVER["REQUEST_URI"]; ?>" method="post" enctype="multipart/form-data" class="contact-form">
<ul class="form">
<li>
<label for="ContactFormEmployee_ContactFormEmployee_Name">Name (mandatory field):</label>
<input type="text" class="text holder-required <?php if ($response) { echo 'error'; } ?>" id="ContactFormEmployee_ContactFormEmployee_Name" name="Name" value="">
<?php if ($response) : ?>
<div id="errorname" class="errormessage">"Name (mandatory field):" is required.</div>
<?php endif; ?>
</li>
<li>
<label for="ContactFormEmployee_ContactFormEmployee_Email">E-mail (mandatory field):</label>
<input type="text" class="text holder-required <?php if ($response) { echo 'error'; } ?>" id="ContactFormEmployee_ContactFormEmployee_Email" name="Email" value="">
<?php if ($response) : ?>
<div id="erroremail" class="errormessage">"E-mail (mandatory field):" is required.</div>
<?php endif; ?>
</li>
<li>
<label for="ContactFormEmployee_ContactFormEmployee_Phone">Telephone number:</label>
<input type="text" class="text" id="ContactFormEmployee_ContactFormEmployee_Phone" name="Phone" value="">
</li>
<li>
<label for="ContactFormEmployee_ContactFormEmployee_Phone">City:</label>
<select id="ContactFormEmployee_ContactFormEmployee_City" name="City"><option selected="selected" value="">Choose the nearest city</option><option value="31">Vilnius</option><option value="32">Kaunas</option><option value="33">Klaipėda</option><option value="34">Šilutė</option><option value="35">Utena</option><option value="36">Panevėžys</option><option value="37">Šiauliai</option><option value="38">Plungė</option><option value="41">Marijampolė</option><option value="44">Ukmergė</option></select>
</li>
<li>
<label for="ContactFormEmployee_ContactFormEmployee_Comments">Your question (mandatory field):</label>
<textarea id="ContactFormEmployee_ContactFormEmployee_Comments" class="holder-required <?php if ($response) { echo 'error'; } ?>" name="Comments" rows="5" cols="20"></textarea>
<?php if ($response) : ?>
<div id="errorcomments" class="errormessage">"Your question (mandatory field):" is required.</div>
<?php endif; ?>
</li>
<li>
<label for="ContactFormEmployee_ContactFormEmployee_Cvfield">Curriculum vitae:</label>
<input type="file" name="Cvfield" id="ContactFormEmployee_ContactFormEmployee_Cvfield"><input type="hidden" name="MAX_FILE_SIZE" value="">
</li>
<li class="last">
<input class="action " id="ContactFormEmployee_ContactFormEmployee_action_SendContactForm" type="submit" name="action-submit" value="Send" title="Send" onclick="ga('send', 'event', 'ContactFormEmployee', 'Button', 'SendContactFormEmployee');">
</li>
</ul>
</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 id="ContactForm_ContactForm" action="<?php echo $_SERVER["REQUEST_URI"]; ?>" method="post" enctype="application/x-www-form-urlencoded" class="contact-form">
<p id="ContactForm_ContactForm_error" class="message " style="display: none"></p>
<ul class="form">
<li>
<label for="ContactForm_ContactForm_Company">Company (mandatory field):</label>
<input type="text" class="text holder-required <?php if ($response) { echo 'error'; } ?>" id="ContactForm_ContactForm_Company" name="Company" value="">
<?php if ($response) : ?>
<div id="errorcompany" class="errormessage">"Company (mandatory field):" is required.</div>
<?php endif; ?>
</li>
<li>
<label for="ContactForm_ContactForm_Name">Name (mandatory field):</label>
<input type="text" class="text holder-required <?php if ($response) { echo 'error'; } ?>" id="ContactForm_ContactForm_Name" name="Name" value="">
<?php if ($response) : ?>
<div id="errorname" class="errormessage">"Name (mandatory field):" is required.</div>
<?php endif; ?>
</li>
<li>
<label for="ContactForm_ContactForm_Email">E-mail (mandatory field):</label>
<input type="text" class="text holder-required <?php if ($response) { echo 'error'; } ?>" id="ContactForm_ContactForm_Email" name="Email" value="">
<?php if ($response) : ?>
<div id="erroremail" class="errormessage">"E-mail (mandatory field):" is required.</div>
<?php endif; ?>
</li>
<li>
<label for="ContactForm_ContactForm_Phone">Telephone number:</label>
<input type="text" class="text" id="ContactForm_ContactForm_Phone" name="Phone" value="">
</li>
<li>
<label for="ContactForm_ContactForm_Comments">Your question (mandatory field):</label>
<textarea id="ContactForm_ContactForm_Comments" class="holder-required <?php if ($response) { echo 'error'; } ?>" name="Comments" rows="5" cols="20"></textarea>
<?php if ($response) : ?>
<div id="errorcomments" class="errormessage">"Your question (mandatory field):" is required.</div>
<?php endif; ?>
</li>
<li class="last">
<input class="action " id="ContactForm_ContactForm_action_SendContactForm" type="submit" name="action-submit" value="Send" title="Send" onclick="ga('send', 'event', 'ContactForm', 'Button', 'SendContactForm');">
</li>
</ul>
</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 id="CVForm_CVForm" action="<?php echo $_SERVER["REQUEST_URI"]; ?>" method="post" enctype="multipart/form-data" class="contact-form">
<ul class="form">
<li>
<label for="CVForm_CVForm_Name">Name, Surname (mandatory field):</label>
<input type="text" class="text holder-required <?php if ($response) { echo 'error'; } ?>" id="CVForm_CVForm_Name" name="Name" value="">
<?php if ($response) : ?>
<div id="errorname" class="errormessage">"Name, Surname (mandatory field):" is required.</div>
<?php endif; ?>
</li>
<li>
<label for="CVForm_CVForm_Email">E-mail (mandatory field): </label>
<input type="text" class="text holder-required <?php if ($response) { echo 'error'; } ?>" id="CVForm_CVForm_Email" name="Email" value="">
<?php if ($response) : ?>
<div id="erroremail" class="errormessage">"E-mail (mandatory field): " is required.</div>
<?php endif; ?>
</li>
<li>
<label for="CVForm_CVForm_Phone">Telephone number:</label>
<input type="text" class="text" id="CVForm_CVForm_Phone" name="Phone" value="">
</li>
<li>
<label for="CVForm_CVForm_Cvfield">Curriculum vitae:</label>
<input type="file" name="Cvfield" id="CVForm_CVForm_Cvfield"><input type="hidden" name="MAX_FILE_SIZE" value="">
</li>
<li>
<label for="CVForm_CVForm_Additional">Other:</label>
<textarea id="CVForm_CVForm_Additional" name="Additional" rows="5" cols="20"></textarea>
</li>
<li class="last">
<input class="action " id="CVForm_CVForm_action_SendCVForm" type="submit" name="action-submit" value="Send" title="Send" onclick="ga('send', 'event', 'CVForm', 'Button', 'SendCVForm');">
</li>
</ul>
<input class="hidden" type="hidden" id="CVForm_CVForm_offerid" name="offerid" value="14675">
</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
*/
?>
<!-- This file should primarily consist of HTML with a little bit of PHP. -->
<?php
/**
* Fired when the plugin is uninstalled.
*
* When populating this file, consider the following flow
* of control:
*
* - This method should be static
* - Check if the $_REQUEST content actually is the plugin name
* - Run an admin referrer check to make sure it goes through authentication
* - Verify the output of $_GET makes sense
* - Repeat with other user roles. Best directly by using the links/query string parameters.
* - Repeat things for multisite. Once for a single site in the network, once sitewide.
*
* This file may be updated more in future version of the Boilerplate; however, this is the
* general skeleton and outline for how the file should work.
*
* For more information, see the following discussion:
* https://github.com/tommcfarlin/WordPress-Plugin-Boilerplate/pull/123#issuecomment-28541913
*
* @link https://www.biuro.lt
* @since 1.0.0
*
* @package Biuro_Contacts
*/
// If uninstall not called from WordPress, then exit.
if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
exit;
}
...@@ -35,8 +35,8 @@ qa-: Signify that a QA or Test Engineering team is running an automated UI test ...@@ -35,8 +35,8 @@ qa-: Signify that a QA or Test Engineering team is running an automated UI test
@import '10-trumps/__utils.css'; @import '10-trumps/__utils.css';
/* critical:start */ /* critical:start */
/** { border: 1px solid #000; }*/
/* critical:end */ /* critical:end */
/** { border: 1px solid #000; }*/
.tmp-contacts { .tmp-contacts {
img { display: none; } img { display: none; }
......
...@@ -100,6 +100,30 @@ ...@@ -100,6 +100,30 @@
endif; endif;
?> ?>
<script src="/wp-content/themes/biuro/js/main-2a9639b0.min.js" async></script> <script>
document.querySelectorAll('.js-job-action').forEach(function (node) {
node.addEventListener('click', function (e) {
e.preventDefault();
var target = e.currentTarget;
document.querySelectorAll('#action--form, #action--share').forEach(function (section) {
section.style.display = 'none';
});
document.querySelector('#' + target.dataset.id).style.display = 'block';
var input = document.querySelector('#' + target.dataset.id + ' input:first-of-type');
if (input) {
input.focus();
}
target.blur();
});
});
</script>
<script src="/wp-content/themes/biuro/js/main-a9a206ea.min.js" async></script>
</body> </body>
</html> </html>
...@@ -34,14 +34,15 @@ get_header(); ?> ...@@ -34,14 +34,15 @@ get_header(); ?>
endwhile; endwhile;
?> ?>
<div style="display: flex; flex-wrap: wrap;">
<?php <?php
while ( $related->fetch() ) : while ( $related->fetch() ) :
echo $related->display( 'content' ); echo '<div style="flex: 1 1 45%">' . $related->display( 'content' ) . '</div>';
endwhile; endwhile;
?> ?>
</div>
<? <?
$divisions = pods( 'division', array( $divisions = pods( 'division', array(
'limit' => -1 'limit' => -1
) ); ) );
...@@ -109,6 +110,12 @@ get_header(); ?> ...@@ -109,6 +110,12 @@ get_header(); ?>
?> ?>
</ul> </ul>
<div id="js-divisions-map" data-lang="<?php echo pll_current_language(); ?>" class="" 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>
<?php
echo do_shortcode('[biuro-contacts--employees lang="' . pll_current_language() . '"]');
?>
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyBQjPQnLGLeICbpTTu8kLjVRrLUYYCTS2M" async defer></script> <script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyBQjPQnLGLeICbpTTu8kLjVRrLUYYCTS2M" async defer></script>
<?php <?php
endif; endif;
......
...@@ -45,9 +45,19 @@ get_header(); ...@@ -45,9 +45,19 @@ get_header();
</p> </p>
<br> <br>
<div id="action--form" style="border: 1px solid grey; margin-bottom: 20px; display: none;">
<?php
echo do_shortcode('[biuro-contacts--position id="' . get_the_id() . '" lang="' . pll_current_language() . '"]');
?>
</div>
<div id="action--share" style="border: 1px solid grey; margin-bottom: 20px; display: none;">
<h1>Dalintis</h1>
</div>
<div class="c-fixed-footer" style="overflow: hidden; margin-bottom: 2rem;"> <div class="c-fixed-footer" style="overflow: hidden; margin-bottom: 2rem;">
<button style="float: left; text-align: center; color: #fff; background: #006957; padding: 10px; width: 48%; border: 0; border-radius: 3px; cursor: pointer; ">Kandidatuoti</button> <button style="float: left; text-align: center; color: #fff; background: #006957; padding: 10px; width: 48%; border: 0; border-radius: 3px; cursor: pointer; " class="js-job-action" data-id="action--form">Kandidatuoti</button>
<button style="float: right; text-align: center; color: #000; background: #ccc; padding: 10px; width: 48%; border: 0; border-radius: 3px; cursor: pointer;">Dalintis</button> <button style="float: right; text-align: center; color: #000; background: #ccc; padding: 10px; width: 48%; border: 0; border-radius: 3px; cursor: pointer;" class="js-job-action" data-id="action--share">Dalintis</button>
</div> </div>
<?php get_footer(); <?php get_footer();
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<!-- <h3>Job: <?php echo $jobID; ?></h3> --> <!-- <h3>Job: <?php echo $jobID; ?></h3> -->
<div> <div>
<button style="display: block; text-align: center; color: #fff; background: #006957; padding: 10px; width: 100%; border: 0; border-radius: 3px; cursor: pointer;">Kandidatuoti</button> <button style="display: block; text-align: center; color: #fff; background: #006957; padding: 10px; width: 100%; border: 0; border-radius: 3px; cursor: pointer;" class="js-job-action" data-id="action--form">Kandidatuoti</button>
</div> </div>
<div class="tmp-contacts"> <div class="tmp-contacts">
......
...@@ -10,6 +10,13 @@ ...@@ -10,6 +10,13 @@
$no = 0; $no = 0;
$main = ''; $main = '';
function isSubActive($childID, $ID) {
if ($childID == $ID) {
return true;
}
return ( get_post_meta( $childID, 'divisions-page', true )&& pods( 'division' )->find( array( 'limit' => 1, 'where'=>"page-id.ID = " . $ID ) )->total() ) ? true : false;
}
foreach( $menu_items as $menu_item ) { foreach( $menu_items as $menu_item ) {
if ($menu_item->menu_item_parent == 0) { if ($menu_item->menu_item_parent == 0) {
...@@ -30,7 +37,6 @@ ...@@ -30,7 +37,6 @@
$main .= '<ul class="o-nav c-nav--main">'; $main .= '<ul class="o-nav c-nav--main">';
foreach($items as $item) { foreach($items as $item) {
$children = array_key_exists('children', $item); $children = array_key_exists('children', $item);
// $url = ($children && $item['no'] != 1) ? $item['children'][0]->url : $item['props']->url;
$url = ($children) ? $item['children'][0]->url : $item['props']->url; $url = ($children) ? $item['children'][0]->url : $item['props']->url;
$sectionCSS = ($section == get_post_meta( $item['props']->object_id, 'section', true )) ? 'is-nav--main-item-active' : ''; $sectionCSS = ($section == get_post_meta( $item['props']->object_id, 'section', true )) ? 'is-nav--main-item-active' : '';
...@@ -43,7 +49,9 @@ ...@@ -43,7 +49,9 @@
$main .= '<ul class="o-nav c-nav--sub">'; $main .= '<ul class="o-nav c-nav--sub">';
foreach($item['children'] as $child) : foreach($item['children'] as $child) :
$classCSS = ($child->object_id == $ID) ? 'is-nav--sub-anchor-active' : '';
// $classCSS = ($child->object_id == $ID ) ? 'is-nav--sub-anchor-active' : '';
$classCSS = isSubActive($child->object_id, $ID ) ? 'is-nav--sub-anchor-active' : '';
$main .= '<li class="c-nav--sub-item"><a href="' . $child->url . '" title="' . get_the_title($child->object_id) . '" class="c-nav--sub-anchor ' . $classCSS .'">' . $child->title . '</a></li>'; $main .= '<li class="c-nav--sub-item"><a href="' . $child->url . '" title="' . get_the_title($child->object_id) . '" class="c-nav--sub-anchor ' . $classCSS .'">' . $child->title . '</a></li>';
endforeach; endforeach;
......
...@@ -40,12 +40,13 @@ wp plugin update --all ...@@ -40,12 +40,13 @@ wp plugin update --all
# Activate plugin. # Activate plugin.
wp plugin activate akismet --network wp plugin activate akismet --network
wp plugin activate biuro-contacts --network
wp plugin activate cookies-warning --network wp plugin activate cookies-warning --network
wp plugin activate data-controller --network wp plugin activate data-controller --network
# wp plugin activate jobs-importer # wp plugin activate jobs-importer
# WP themes # WP themes
wp theme update --all; wp theme update --all
wp theme activate biuro wp theme activate biuro
# Update translations # Update translations
......
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