diff --git a/composer.json b/composer.json index 16029b7..b9cc734 100755 --- a/composer.json +++ b/composer.json @@ -57,4 +57,4 @@ }, "prefer-stable": true, "minimum-stability": "dev" -} \ No newline at end of file +} diff --git a/site/_config.php b/site/_config.php index 6391f4b..493549d 100755 --- a/site/_config.php +++ b/site/_config.php @@ -2,6 +2,7 @@ use SilverStripe\Forms\HTMLEditor\HtmlEditorConfig; use SilverStripe\Core\Manifest\ModuleResourceLoader; +use SilverStripe\ORM\Search\FulltextSearchable; HtmlEditorConfig::get('cms')->enablePlugins([ 'template', @@ -13,3 +14,7 @@ HtmlEditorConfig::get('cms')->enablePlugins([ 'lists', 'charcount' => ModuleResourceLoader::resourceURL('drmartingonzo/ss-tinymce-charcount:client/dist/js/bundle.js'), ]); + +FulltextSearchable::enable(); + + diff --git a/site/_config/extensions.yml b/site/_config/extensions.yml index bb66b4e..072e5a5 100755 --- a/site/_config/extensions.yml +++ b/site/_config/extensions.yml @@ -1,3 +1,3 @@ SilverStripe\SiteConfig\SiteConfig: extensions: - - Site\Extensions\SiteConfigExtension \ No newline at end of file + - Site\Extensions\SiteConfigExtension diff --git a/site/client/src/js/_components/_slider.js b/site/client/src/js/_components/_slider.js new file mode 100644 index 0000000..ddbe7ef --- /dev/null +++ b/site/client/src/js/_components/_slider.js @@ -0,0 +1,51 @@ +/** + * Just an example component + */ +import $ from 'jquery'; + +const SliderUI = (($) => { + class SliderUI { + static init() { + this.each(function ($this) { + const $items = $this.find('.carousel-item'), + id = $this.attr('id'), + count = $items.length; + + if(!count){ + return; + } + + if($this.data('indicators')) { + let $controls = $(''); + $controls.append('
  • '); + for (let i = 1; i < count; i++) { + $controls.append('
  • '); + } + $this.prepend($controls); + } + + if($this.data('arrows')){ + $this.prepend('Previous'); + $this.prepend('Next'); + } + + $this.carousel(); + }); + } + + static dispose() { + self.each(function ($this) { + $this.carousel('dispose'); + }); + } + + static each(callback) { + $('.carousel').each(function () { + callback($(this)); + }); + } + } + return SliderUI; +})($); + +export default SliderUI; diff --git a/site/client/src/js/main.js b/site/client/src/js/main.js index 038f9cf..dce1718 100644 --- a/site/client/src/js/main.js +++ b/site/client/src/js/main.js @@ -3,6 +3,7 @@ import $ from 'jquery'; import Events from './_events'; // import an example component import Spinner from './_components/_spinner'; +import Slider from './_components/_slider'; const MainUI = (($) => { // Constants @@ -17,6 +18,8 @@ const MainUI = (($) => { Spinner.hide(() => { $('body').addClass('loaded'); }); + + Slider.init(); } static destroy() { diff --git a/site/client/src/scss/_components/_slider.scss b/site/client/src/scss/_components/_slider.scss new file mode 100644 index 0000000..085366d --- /dev/null +++ b/site/client/src/scss/_components/_slider.scss @@ -0,0 +1,19 @@ +.carousel-control-prev, +.carousel-control-next { + z-index: 2; + font-size: 3rem; + text-shadow: 1px 1px #000; + &:hover, + &:focus { + background: rgba(0, 0, 0, 0.6); + } +} + +.carousel-indicators li { + box-shadow: 1px 1px #000; +} + +.carousel-title, +.carousel-content { + text-shadow: 1px 1px #000; +} \ No newline at end of file diff --git a/site/client/src/scss/_layout.scss b/site/client/src/scss/_layout.scss index 9722f34..1513a8a 100644 --- a/site/client/src/scss/_layout.scss +++ b/site/client/src/scss/_layout.scss @@ -1,3 +1,5 @@ /** * Your custom style */ + +@import "_components/slider"; \ No newline at end of file diff --git a/site/client/src/scss/types/typography.scss b/site/client/src/scss/types/typography.scss new file mode 100644 index 0000000..2385ddd --- /dev/null +++ b/site/client/src/scss/types/typography.scss @@ -0,0 +1 @@ +@import "../_variables"; \ No newline at end of file diff --git a/site/src/Templates/DeferedRequirements.php b/site/src/Templates/DeferedRequirements.php index ade3984..2d6f5ec 100755 --- a/site/src/Templates/DeferedRequirements.php +++ b/site/src/Templates/DeferedRequirements.php @@ -42,6 +42,7 @@ class DeferedRequirements implements TemplateGlobalProvider DeferedRequirements::loadJS('//ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js'); // App libs + DeferedRequirements::loadCSS('//use.fontawesome.com/releases/v5.0.13/css/all.css'); DeferedRequirements::loadCSS('app.css'); DeferedRequirements::loadJS('app.js'); diff --git a/site/templates/Includes/FlexSlider.ss b/site/templates/Includes/FlexSlider.ss new file mode 100644 index 0000000..d073767 --- /dev/null +++ b/site/templates/Includes/FlexSlider.ss @@ -0,0 +1,28 @@ +<% if $SlideShow %> + <%-- Use: data-ride="carousel" to autoinitialize bootstrap carousel --%> + +<% end_if %> diff --git a/site/templates/Includes/NavItem.ss b/site/templates/Includes/NavItem.ss new file mode 100644 index 0000000..d10c730 --- /dev/null +++ b/site/templates/Includes/NavItem.ss @@ -0,0 +1,30 @@ +<% if $Children %> + +<% else %> + +<% end_if %> \ No newline at end of file diff --git a/site/templates/Includes/Navigation.ss b/site/templates/Includes/Navigation.ss new file mode 100644 index 0000000..4babbb2 --- /dev/null +++ b/site/templates/Includes/Navigation.ss @@ -0,0 +1,21 @@ + \ No newline at end of file diff --git a/site/templates/Page.ss b/site/templates/Page.ss index e3d544c..4ed3af8 100644 --- a/site/templates/Page.ss +++ b/site/templates/Page.ss @@ -13,10 +13,30 @@ <%-- Loading Spinner --%> -

    <%t Page.LOADINGTEXT 'LOADING ..' %>
    +

    <%t Page.LOADINGTEXT 'LOADING ..' %>
    -
    - +
    +
    +
    + {$SiteConfig.Title} +
    +
    + <% with $SiteConfig %> + <% if $PhoneNumber %> +
    + Call us today: + $PhoneNumber +
    + <% end_if %> + <% end_with %> + <% if $SearchForm %> +
    $SearchForm
    + <% end_if %> +
    +
    + + <% include Navigation Navigation=$SiteConfig.Navigation %> +