diff --git a/.gitignore b/.gitignore index 9203b499f..f1f685123 100644 --- a/.gitignore +++ b/.gitignore @@ -12,4 +12,7 @@ src/vendor node_modules npm-debug.log src/assets/web-components.js -last-js-build.md5 \ No newline at end of file +last-js-build.md5 +src/admin/scss/.sass-cache +src/assets/css/tainacan-admin.css +src/assets/css/tainacan-admin.css.map \ No newline at end of file diff --git a/compile-sass.sh b/compile-sass.sh index 938ef388d..f8c835f57 100644 --- a/compile-sass.sh +++ b/compile-sass.sh @@ -12,5 +12,9 @@ cd src/scss sass -E 'UTF-8' style.scss:../style.css +cd ../admin/scss +sass -E 'UTF-8' tainacan-admin.scss:../../assets/css/tainacan-admin.css + + echo "Compilação do Sass Concluído!" exit 0 diff --git a/src/admin/class-tainacan-admin.php b/src/admin/class-tainacan-admin.php new file mode 100644 index 000000000..87c80f9bc --- /dev/null +++ b/src/admin/class-tainacan-admin.php @@ -0,0 +1,48 @@ +menu_slug, array(&$this, 'admin_page') ); + add_action( 'load-' . $page_suffix, array(&$this, 'load_admin_page')); + } + + function load_admin_page() { + add_action( 'admin_enqueue_scripts', array(&$this, 'add_admin_css') ); + } + + function add_admin_css() { + global $TAINACAN_BASE_URL; + wp_enqueue_style('tainacan-admin-page', $TAINACAN_BASE_URL . '/assets/css/tainacan-admin.css' ); + } + + function admin_body_class($classes) { + global $pagenow; + if ($pagenow == 'admin.php' && isset($_GET['page']) && $_GET['page'] == $this->menu_slug) { + $classes .= ' tainacan-admin-page'; + } + return $classes; + } + + function admin_page() { + // TODO move it to a separate file and start the Vue project + echo "
Here we go!
"; + } + +} + diff --git a/src/admin/scss/tainacan-admin.scss b/src/admin/scss/tainacan-admin.scss new file mode 100644 index 000000000..d6dd80bbe --- /dev/null +++ b/src/admin/scss/tainacan-admin.scss @@ -0,0 +1,15 @@ + +body.tainacan-admin-page #adminmenumain { + display: none; +} + +#tainacan-admin-app { + background: #fff; + position: fixed; + top: 0; + left: 0; + bottom: 0; + right: 0; + width: 100%; + z-index: 99999999999; +} \ No newline at end of file diff --git a/src/tainacan.php b/src/tainacan.php index d896deb63..8a39945c2 100644 --- a/src/tainacan.php +++ b/src/tainacan.php @@ -24,3 +24,8 @@ $Tainacan_Dev_interface = new \Tainacan\DevInterface\DevInterface(); function tnc_enable_dev_wp_interface() { return defined('TNC_ENABLE_DEV_WP_INTERFACE') && true === TNC_ENABLE_DEV_WP_INTERFACE ? true : false; } + +// TODO move it somewhere else? +require_once('admin/class-tainacan-admin.php'); +global $Tainacan_Admin; +$Tainacan_Admin = new \Tainacan\Admin(); \ No newline at end of file