<?php
/**
 * Alta de usuarios JB (standalone).
 */
require_once dirname( __DIR__ ) . '/core/bootstrap.php';

JB_App::set_current_post(
	(object) array(
		'ID'           => 5,
		'post_title'   => 'Agregar usuario',
		'post_content' => '',
		'post_type'    => 'page',
		'post_name'    => 'user-new',
	)
);

do_action( 'wp_enqueue_scripts' );

wp_enqueue_style( 'dashicons' );
wp_enqueue_style(
	'logistica-admin',
	LOGISTICA_PLUGIN_URL . 'assets/css/admin.css',
	array( 'dashicons' ),
	logistica_asset_version( 'assets/css/admin.css' )
);
wp_enqueue_style(
	'logistica-user-panel',
	LOGISTICA_PLUGIN_URL . 'assets/css/panel.css',
	array( 'logistica-admin' ),
	logistica_asset_version( 'assets/css/panel.css' )
);
wp_enqueue_style(
	'logistica-config-panel',
	LOGISTICA_PLUGIN_URL . 'assets/css/config-panel.css',
	array( 'logistica-user-panel' ),
	logistica_asset_version( 'assets/css/config-panel.css' )
);
wp_enqueue_script(
	'logistica-user-form',
	LOGISTICA_PLUGIN_URL . 'assets/js/user-form.js',
	array(),
	logistica_asset_version( 'assets/js/user-form.js' ),
	true
);

$body_class = apply_filters(
	'body_class',
	array( 'jb-planeacion-app', 'logistica-panel-page', 'logistica-user-form-page' )
);
?>
<!DOCTYPE html>
<html lang="es">
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<title><?php echo esc_html( JB_App::config( 'app_name' ) ); ?> — <?php esc_html_e( 'Agregar usuario', 'logistica' ); ?></title>
	<?php
	if ( function_exists( 'logistica_print_favicon' ) ) {
		logistica_print_favicon();
	}
	wp_print_styles();
	?>
</head>
<body class="<?php echo esc_attr( implode( ' ', $body_class ) ); ?>">
	<div id="jb-app" class="jb-app-root">
		<?php include LOGISTICA_PLUGIN_DIR . 'admin/views/user-new.php'; ?>
	</div>
	<?php wp_print_scripts(); ?>
</body>
</html>
