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 "