diff --git a/app/_config/config.yml b/app/_config/config.yml index 785c22a..2ceb95b 100644 --- a/app/_config/config.yml +++ b/app/_config/config.yml @@ -1,7 +1,6 @@ --- Name: webapp --- - SilverStripe\Core\Manifest\ModuleManifest: project: app @@ -16,8 +15,10 @@ Page: # - 'colymba/gridfield-bulk-editing-tools:client/dist/styles/main.css' SilverStripe\Admin\LeftAndMain: + extra_requirements_js: + - 'app/client/dist/css/app_cms.js' extra_requirements_css: - - 'app/client/dist/css/app_cms.css' + - 'app/client/dist/css/app_cms.css' SilverStripe\Forms\HTMLEditor\TinyMCEConfig: editor_css: diff --git a/app/_config/elements.yml b/app/_config/elements.yml index 6f3ce51..7a8123a 100644 --- a/app/_config/elements.yml +++ b/app/_config/elements.yml @@ -5,11 +5,14 @@ After: - elemental-list - elementalvirtual --- - Page: extensions: - DNADesign\Elemental\Extensions\ElementalPageExtension +DNADesign\Elemental\Models\ElementalArea: + extensions: + - Site\Extensions\ElementalArea + DNADesign\Elemental\Models\BaseElement: default_global_elements: true extensions: @@ -17,34 +20,34 @@ DNADesign\Elemental\Models\BaseElement: SilverStripe\CMS\Model\SiteTree: allowed_elements: - - DNADesign\ElementalList\Model\ElementList - - DNADesign\Elemental\Models\ElementContent - - DNADesign\ElementalUserForms\Model\ElementForm - - Dynamic\Elements\Image\Elements\ElementImage - - Dynamic\Elements\Blog\Elements\ElementBlogPosts - - Dynamic\Elements\Oembed\Elements\ElementOembed - - Dynamic\Elements\Elements\ElementTestimonials - #- Site\Elements\TeamMembersElement - - Site\Elements\SliderElement - - Site\Elements\BlockElement - - Site\Elements\MapElement - - DNADesign\ElementalVirtual\Model\ElementVirtual + - DNADesign\ElementalList\Model\ElementList + - DNADesign\Elemental\Models\ElementContent + - DNADesign\ElementalUserForms\Model\ElementForm + - Dynamic\Elements\Image\Elements\ElementImage + - Dynamic\Elements\Blog\Elements\ElementBlogPosts + - Dynamic\Elements\Oembed\Elements\ElementOembed + - Dynamic\Elements\Elements\ElementTestimonials + #- Site\Elements\TeamMembersElement + - Site\Elements\SliderElement + - Site\Elements\BlockElement + - Site\Elements\MapElement + - DNADesign\ElementalVirtual\Model\ElementVirtual DNADesign\ElementalList\Model\ElementList: inline_editable: false default_global_elements: false allowed_elements: - - DNADesign\ElementalList\Model\ElementList - - DNADesign\Elemental\Models\ElementContent - - DNADesign\ElementalUserForms\Model\ElementForm - - Dynamic\Elements\Image\Elements\ElementImage - - Dynamic\Elements\Blog\Elements\ElementBlogPosts - - Dynamic\Elements\Oembed\Elements\ElementOembed - - Dynamic\Elements\Elements\ElementTestimonials - #- Site\Elements\TeamMembersElement - - Site\Elements\SliderElement - - Site\Elements\BlockElement - - Site\Elements\MapElement + - DNADesign\ElementalList\Model\ElementList + - DNADesign\Elemental\Models\ElementContent + - DNADesign\ElementalUserForms\Model\ElementForm + - Dynamic\Elements\Image\Elements\ElementImage + - Dynamic\Elements\Blog\Elements\ElementBlogPosts + - Dynamic\Elements\Oembed\Elements\ElementOembed + - Dynamic\Elements\Elements\ElementTestimonials + #- Site\Elements\TeamMembersElement + - Site\Elements\SliderElement + - Site\Elements\BlockElement + - Site\Elements\MapElement styles: whiteframe: 'White Frame' greybg: 'Grey Background' diff --git a/app/client/src/js/_layout.js b/app/client/src/js/_layout.js index 822aa75..4f4d2e4 100644 --- a/app/client/src/js/_layout.js +++ b/app/client/src/js/_layout.js @@ -1,9 +1,9 @@ -"use strict"; +'use strict'; import $ from 'jquery'; import Events from '@a2nt/ss-bootstrap-ui-webpack-boilerplate/src/js/_events'; -const LayoutUI = (($) => { +const LayoutUI = ($ => { // Constants const W = window; const D = document; @@ -19,6 +19,33 @@ const LayoutUI = (($) => { console.log(`Initializing: ${NAME}`); // your custom UI + // Custom fonts + $Body.append( + '', + ); + + /*google analytics */ + /*(function(i, s, o, g, r, a, m) { + i['GoogleAnalyticsObject'] = r; + (i[r] = + i[r] || + function() { + (i[r].q = i[r].q || []).push(arguments); + }), + (i[r].l = 1 * new Date()); + (a = s.createElement(o)), (m = s.getElementsByTagName(o)[0]); + a.async = 1; + a.src = g; + m.parentNode.insertBefore(a, m); + })( + window, + document, + 'script', + '//www.google-analytics.com/analytics.js', + 'ga', + ); + ga('create', 'UA-********-*', 'auto'); + ga('send', 'pageview');*/ } static dispose() { diff --git a/app/client/src/js/app.js b/app/client/src/js/app.js index 17c81c8..33ad5c4 100644 --- a/app/client/src/js/app.js +++ b/app/client/src/js/app.js @@ -1,5 +1,6 @@ -import $ from 'jquery'; -import './_consts'; +'use strict'; + +import '../scss/app.scss'; // import Bootstrap import 'popper.js'; @@ -8,7 +9,21 @@ import 'bootstrap/js/dist/alert'; import 'bootstrap/js/dist/button'; import 'bootstrap/js/dist/carousel'; import 'bootstrap/js/dist/collapse'; -import 'bootstrap/js/dist/dropdown'; + +import 'hammerjs/hammer'; +import 'jquery-hammerjs/jquery.hammer'; + +// Routie +//import 'pouchdb/dist/pouchdb'; +//import '@a2nt/ss-bootstrap-ui-webpack-boilerplate/src/js/_components/routes/index'; + +// conflicts with _components/_ui.hover.js (shows dropdown on hover) +//import 'bootstrap/js/dist/dropdown'; +import '@a2nt/ss-bootstrap-ui-webpack-boilerplate/src/js/_components/_ui.hover'; + +import '@a2nt/ss-bootstrap-ui-webpack-boilerplate/src/js/_components/_ui.carousel'; +import '@a2nt/ss-bootstrap-ui-webpack-boilerplate/src/js/_components/_ui.menu'; + import 'bootstrap/js/dist/modal'; import 'bootstrap/js/dist/tooltip'; import 'bootstrap/js/dist/popover'; @@ -16,27 +31,58 @@ import 'bootstrap/js/dist/scrollspy'; import 'bootstrap/js/dist/tab'; // +import Spinner from '@a2nt/ss-bootstrap-ui-webpack-boilerplate/src/js/_components/_ui.spinner'; + +// Sticky sidebar +import SidebarUI from '@a2nt/ss-bootstrap-ui-webpack-boilerplate/src/js/_components/_ui.sidebar'; + +//import Multislider from '@a2nt/ss-bootstrap-ui-webpack-boilerplate/src/js/_components/_ui.multislider'; + +// Flyout UI +//import Flyout from '@a2nt/ss-bootstrap-ui-webpack-boilerplate/src/js/_components/_ui.flyout'; + // Offcanvas menu //import 'offcanvas-bootstrap/dist/js/bootstrap.offcanvas'; -import '../scss/app.scss'; - -import '@a2nt/meta-lightbox/src/js/meta-lightbox'; -// youtube video preview image -import '@a2nt/ss-bootstrap-ui-webpack-boilerplate/src/js/_components/_ui.video.preview'; - -// MainUI -import '@a2nt/ss-bootstrap-ui-webpack-boilerplate/src/js/_main'; - // Uncomment it to enable meta-lightbox zooming on hover //import 'jquery-zoom/jquery.zoom'; -// Forms UI -import '@a2nt/ss-bootstrap-ui-webpack-boilerplate/src/js/_components/_ui.form.basics'; -import '@a2nt/ss-bootstrap-ui-webpack-boilerplate/src/js/_components/_ui.form.validate'; -import '@a2nt/ss-bootstrap-ui-webpack-boilerplate/src/js/_components/_ui.form.stepped'; +// Toggle bootstrap form fields +//import FormToggleUI from '@a2nt/ss-bootstrap-ui-webpack-boilerplate/src/js/_components/_ui.form.fields.toggle'; + +// Bootstrap Date & Time fields +//import FormDatetime from '@a2nt/ss-bootstrap-ui-webpack-boilerplate/src/js/_components/_ui.form.datetime'; + +// Stepped forms functionality +//import FormStepped from '@a2nt/ss-bootstrap-ui-webpack-boilerplate/src/js/_components/_ui.form.stepped'; + +// Forms validation functionality +//import FormValidate from '@a2nt/ss-bootstrap-ui-webpack-boilerplate/src/js/_components/_ui.form.validate'; + +// Store forms data into localStorage +//import FormStorage from '@a2nt/ss-bootstrap-ui-webpack-boilerplate/src/js/_components/_ui.form.storage'; + +// client-side images cropping +//import FormCroppie from '@a2nt/ss-bootstrap-ui-webpack-boilerplate/src/js/_components/_ui.form.croppie'; + +// Google NoCaptcha fields +//import NoCaptcha from '@a2nt/ss-bootstrap-ui-webpack-boilerplate/src/js/_components/_ui.nocaptcha'; + +// youtube video preview image +import '@a2nt/ss-bootstrap-ui-webpack-boilerplate/src/js/_components/_ui.video.preview'; + +// Meta Lightbox +import '@a2nt/meta-lightbox/src/js/index'; + +//import Confirmation from 'bootstrap-confirmation2/dist/bootstrap-confirmation'; +//import Table from 'bootstrap-table/dist/bootstrap-table'; + +// AJAX UI +//import AjaxUI from '@a2nt/ss-bootstrap-ui-webpack-boilerplate/src/js/_components/_ui.ajax'; + +import '@a2nt/ss-bootstrap-ui-webpack-boilerplate/src/js/_main'; +import './_layout'; -// Import fonts and images function importAll(r) { return r.keys().map(r); } @@ -48,5 +94,5 @@ const fontAwesome = importAll( require.context('font-awesome', false, /\.(otf|eot|svg|ttf|woff|woff2)$/), ); -// Your custom JS -import './_layout'; +// Google Analytics +import '@a2nt/ss-bootstrap-ui-webpack-boilerplate/src/js/_components/drivers/_google.track.external.links'; diff --git a/app/client/src/scss/_layout.scss b/app/client/src/scss/_layout.scss index 852e4c7..dee521d 100644 --- a/app/client/src/scss/_layout.scss +++ b/app/client/src/scss/_layout.scss @@ -1,6 +1,17 @@ /** * Your custom style */ +.field { + margin: 2rem 0; + &.required:after { + display: none; + } +} +.form-control, +.select2-container--default .select2-selection, +.select2-dropdown .select2-search__field { + border-width: 0 0 1px 0; +} .bg-alt { @extend .bg-dark; diff --git a/app/client/src/scss/types/cms.scss b/app/client/src/scss/types/cms.scss deleted file mode 100644 index c1b404f..0000000 --- a/app/client/src/scss/types/cms.scss +++ /dev/null @@ -1,6 +0,0 @@ -#Menu-SilverStripe-CampaignAdmin-CampaignAdmin, -#Menu-Dynamic-Elements-Sponsors-Admin-SponsorsAdmin, -#Menu-Dynamic-Elements-Admin-TestimonialsAdmin, -#Menu-Dynamic-Elements-Promos-Admin-PromosAdmin { - display: none; -} diff --git a/app/src/Extensions/ElementRows.php b/app/src/Extensions/ElementRows.php index 904e0fd..ceeb5e3 100644 --- a/app/src/Extensions/ElementRows.php +++ b/app/src/Extensions/ElementRows.php @@ -8,6 +8,7 @@ namespace Site\Extensions; +use DNADesign\Elemental\Models\BaseElement; use DNADesign\ElementalList\Model\ElementList; use SilverStripe\Core\Config\Config; use SilverStripe\Forms\CheckboxField; @@ -28,6 +29,7 @@ class ElementRows extends DataExtension private static $db = [ 'ContainerType' => 'Varchar(254)', + //'SidebarOnly' => 'Boolean(0)', 'Size' => 'Enum("1,2,3,4,5,6,7,8,9,10,11,12,auto","auto")', ]; @@ -37,9 +39,11 @@ class ElementRows extends DataExtension // move available globaly to main tab $fields->removeByName('AvailableGlobally'); + //$fields->removeByName('SidebarOnly'); $tab = $fields->findOrMakeTab('Root.Main'); $tab->push(CheckboxField::create('AvailableGlobally')); + //$tab->push(CheckboxField::create('SidebarOnly', 'Hidden (Sidebar Only)')); // container type if ($this->isRoot()) { @@ -97,14 +101,31 @@ class ElementRows extends DataExtension $fields->removeByName('Size'); } - $tab = $fields->findOrMakeTab('Root.Settings') - ->push(LiteralField::create( - 'ClassName', - '