mirror of
https://github.com/a2nt/silverstripe-webpack.git
synced 2024-10-22 17:05:31 +02:00
Bunch of Improvements
This commit is contained in:
parent
4184d0f21a
commit
91577fe012
@ -12,10 +12,11 @@ HtmlEditorConfig::get('cms')->enablePlugins([
|
|||||||
'charmap',
|
'charmap',
|
||||||
'visualblocks',
|
'visualblocks',
|
||||||
'lists',
|
'lists',
|
||||||
|
'anchor',
|
||||||
'charcount' => ModuleResourceLoader::resourceURL(
|
'charcount' => ModuleResourceLoader::resourceURL(
|
||||||
'drmartingonzo/ss-tinymce-charcount:client/dist/js/bundle.js'
|
'drmartingonzo/ss-tinymce-charcount:client/dist/js/bundle.js'
|
||||||
),
|
),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
HtmlEditorConfig::get('cms')->insertButtonsAfter('sslink', 'anchor');
|
||||||
FulltextSearchable::enable();
|
FulltextSearchable::enable();
|
||||||
|
|
||||||
|
4
app/_config/columns.yml
Normal file
4
app/_config/columns.yml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
Site\Extensions\ElementRows:
|
||||||
|
container_max_width: 1140
|
||||||
|
column_class: 'col-block col-md-'
|
||||||
|
|
@ -20,6 +20,3 @@ SilverStripe\View\SSViewer:
|
|||||||
SilverStripe\Forms\HTMLEditor\TinyMCEConfig:
|
SilverStripe\Forms\HTMLEditor\TinyMCEConfig:
|
||||||
editor_css:
|
editor_css:
|
||||||
- 'app/client/dist/css/editor.css'
|
- 'app/client/dist/css/editor.css'
|
||||||
|
|
||||||
SilverShop\Extension\ShopConfigExtension:
|
|
||||||
base_currency: USD
|
|
||||||
|
@ -24,9 +24,6 @@ SilverStripe\CMS\Model\SiteTree:
|
|||||||
- Dynamic\Elements\Oembed\Elements\ElementOembed
|
- Dynamic\Elements\Oembed\Elements\ElementOembed
|
||||||
- Dynamic\Elements\Elements\ElementTestimonials
|
- Dynamic\Elements\Elements\ElementTestimonials
|
||||||
- Site\Elements\TeamMembersElement
|
- Site\Elements\TeamMembersElement
|
||||||
- Site\Elements\SliderElement
|
|
||||||
- Site\Elements\PromotionElement
|
|
||||||
- Site\Elements\StoreElement
|
|
||||||
|
|
||||||
DNADesign\ElementalList\Model\ElementList:
|
DNADesign\ElementalList\Model\ElementList:
|
||||||
default_global_elements: false
|
default_global_elements: false
|
||||||
|
@ -14,9 +14,3 @@ SilverStripe\Blog\Model\BlogPost:
|
|||||||
SilverStripe\Core\Injector\Injector:
|
SilverStripe\Core\Injector\Injector:
|
||||||
SilverStripe\UserForms\Model\UserDefinedForm:
|
SilverStripe\UserForms\Model\UserDefinedForm:
|
||||||
class: Site\Extensions\CMSMain_HiddenClass
|
class: Site\Extensions\CMSMain_HiddenClass
|
||||||
SilverShop\Checkout\SinglePageCheckoutComponentConfig:
|
|
||||||
class: Site\Models\CheckoutNoDeliveryConfig
|
|
||||||
|
|
||||||
#SilverShop\Model\Address:
|
|
||||||
# extensions:
|
|
||||||
# - Site\Extensions\AddressExtension
|
|
@ -3,8 +3,4 @@ Site\Templates\DeferedRequirements:
|
|||||||
nofontawesome: false
|
nofontawesome: false
|
||||||
version: false
|
version: false
|
||||||
static_domain: false
|
static_domain: false
|
||||||
custom_requirements:
|
|
||||||
SilverShop\Page\AccountPageController:
|
|
||||||
- SilverShop.Page.CheckoutPageController.js
|
|
||||||
- SilverShop.Page.CheckoutPageController.css
|
|
||||||
|
|
||||||
|
19
app/_config/shop.yml_
Normal file
19
app/_config/shop.yml_
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
---
|
||||||
|
Name: shop
|
||||||
|
---
|
||||||
|
SilverStripe\Core\Injector\Injector:
|
||||||
|
SilverShop\Checkout\SinglePageCheckoutComponentConfig:
|
||||||
|
class: Site\Models\CheckoutNoDeliveryConfig
|
||||||
|
|
||||||
|
SilverShop\Extension\ShopConfigExtension:
|
||||||
|
base_currency: USD
|
||||||
|
|
||||||
|
SilverShop\Model\Address:
|
||||||
|
extensions:
|
||||||
|
- Site\Extensions\AddressExtension
|
||||||
|
|
||||||
|
Site\Templates\DeferedRequirements:
|
||||||
|
custom_requirements:
|
||||||
|
SilverShop\Page\AccountPageController:
|
||||||
|
- SilverShop.Page.CheckoutPageController.js
|
||||||
|
- SilverShop.Page.CheckoutPageController.css
|
@ -1 +1,71 @@
|
|||||||
// your custom JS
|
import $ from 'jquery';
|
||||||
|
|
||||||
|
import Events from './_events';
|
||||||
|
import Spinner from './_components/_ui.spinner';
|
||||||
|
|
||||||
|
// your custom components
|
||||||
|
import 'bootstrap-datepicker/dist/js/bootstrap-datepicker.js';
|
||||||
|
import 'bootstrap-timepicker/js/bootstrap-timepicker.js';
|
||||||
|
|
||||||
|
const LayoutUI = (($) => {
|
||||||
|
// Constants
|
||||||
|
const W = window;
|
||||||
|
const D = document;
|
||||||
|
const $Body = $('body');
|
||||||
|
|
||||||
|
const NAME = 'LayoutUI';
|
||||||
|
|
||||||
|
const datepickerOptions = {
|
||||||
|
autoclose: true,
|
||||||
|
startDate: 0,
|
||||||
|
//todayBtn: true,
|
||||||
|
todayHighlight: true,
|
||||||
|
clearBtn: true,
|
||||||
|
};
|
||||||
|
|
||||||
|
class LayoutUI {
|
||||||
|
static init() {
|
||||||
|
this.dispose();
|
||||||
|
|
||||||
|
console.log(`Initializing: ${NAME}`);
|
||||||
|
// your custom UI
|
||||||
|
|
||||||
|
const $dateFields = $Body.find('input.date');
|
||||||
|
const $timeFields = $Body.find('input.time');
|
||||||
|
|
||||||
|
// datepicker
|
||||||
|
$dateFields.each((i, e) => {
|
||||||
|
const $e = $(e);
|
||||||
|
const defaultDate = ($e.attr('name').toLowerCase().indexOf('end') !== -1) ?
|
||||||
|
'+4d' :
|
||||||
|
'+3d';
|
||||||
|
|
||||||
|
$e.attr('readonly', 'true');
|
||||||
|
$e.datepicker($.extend(datepickerOptions, {
|
||||||
|
defaultViewDate: defaultDate
|
||||||
|
}));
|
||||||
|
});
|
||||||
|
|
||||||
|
// timepicker
|
||||||
|
$timeFields.each((i, e) => {
|
||||||
|
const $e = $(e);
|
||||||
|
$e.attr('readonly', 'true');
|
||||||
|
$e.timepicker();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
static dispose() {
|
||||||
|
console.log(`Destroying: ${NAME}`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$(W).on(`${Events.AJAX} ${Events.LOADED}`, () => {
|
||||||
|
LayoutUI.init();
|
||||||
|
});
|
||||||
|
|
||||||
|
W.LayoutUI = LayoutUI;
|
||||||
|
|
||||||
|
return LayoutUI;
|
||||||
|
})($);
|
||||||
|
|
||||||
|
export default LayoutUI;
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
|
@import "~bootstrap-datepicker/dist/css/bootstrap-datepicker.css";
|
||||||
|
@import "~bootstrap-timepicker/css/bootstrap-timepicker.css";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Your custom style
|
* Your custom style
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// shrink elements on scroll
|
// shrink elements on scroll
|
||||||
body.shrink {}
|
body.shrink {}
|
||||||
|
|
||||||
@ -36,3 +38,57 @@ body.shrink {}
|
|||||||
opacity: 1;
|
opacity: 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SS-messages
|
||||||
|
.message {
|
||||||
|
@extend .alert;
|
||||||
|
|
||||||
|
@extend .alert-info;
|
||||||
|
}
|
||||||
|
|
||||||
|
.message.required,
|
||||||
|
.message.error {
|
||||||
|
@extend .alert;
|
||||||
|
|
||||||
|
@extend .alert-danger;
|
||||||
|
}
|
||||||
|
|
||||||
|
// date-time fields
|
||||||
|
input.date,
|
||||||
|
input.time {
|
||||||
|
&[readonly] {
|
||||||
|
background-color: $white;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.bootstrap-timepicker-widget,
|
||||||
|
.datepicker-dropdown {
|
||||||
|
border: 1px solid #ced4da;
|
||||||
|
box-shadow: 0 0 3px #999;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bootstrap-timepicker-widget {
|
||||||
|
.glyphicon {
|
||||||
|
-moz-osx-font-smoothing: grayscale;
|
||||||
|
-webkit-font-smoothing: antialiased;
|
||||||
|
display: inline-block;
|
||||||
|
font-style: normal;
|
||||||
|
font-variant: normal;
|
||||||
|
text-rendering: auto;
|
||||||
|
line-height: 1;
|
||||||
|
font-family: Font Awesome\ 5 Free;
|
||||||
|
font-weight: 900;
|
||||||
|
}
|
||||||
|
|
||||||
|
.glyphicon-chevron-up:before {
|
||||||
|
content: "\f077";
|
||||||
|
}
|
||||||
|
|
||||||
|
.glyphicon-chevron-down:before {
|
||||||
|
content: "\f078";
|
||||||
|
}
|
||||||
|
|
||||||
|
input {
|
||||||
|
border: 1px solid #ced4da;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -2,7 +2,9 @@
|
|||||||
@import "_variables";
|
@import "_variables";
|
||||||
|
|
||||||
@import "_components/_ui.bootstrap";
|
@import "_components/_ui.bootstrap";
|
||||||
@import "_components/_ui.fontawesome";
|
|
||||||
|
// By default we prefer font awesome CDN
|
||||||
|
//@import "_components/_ui.fontawesome";
|
||||||
@import "_components/_ui.lightbox";
|
@import "_components/_ui.lightbox";
|
||||||
|
|
||||||
@import "_components/_ui.main";
|
@import "_components/_ui.main";
|
||||||
|
@ -88,6 +88,11 @@ class ElementRows extends DataExtension
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getWidthPercetage()
|
||||||
|
{
|
||||||
|
return $this->isColumn() ? $this->owner->getField('Size') / 12 * 100 : false;
|
||||||
|
}
|
||||||
|
|
||||||
public function isList()
|
public function isList()
|
||||||
{
|
{
|
||||||
return is_a($this->owner, ElementList::class);
|
return is_a($this->owner, ElementList::class);
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace Site\Extensions;
|
namespace Site\Extensions;
|
||||||
|
|
||||||
|
use Innoweb\Sitemap\Pages\SitemapPage;
|
||||||
use SilverStripe\AssetAdmin\Forms\UploadField;
|
use SilverStripe\AssetAdmin\Forms\UploadField;
|
||||||
use SilverStripe\Assets\Image;
|
use SilverStripe\Assets\Image;
|
||||||
use SilverStripe\Forms\TextareaField;
|
use SilverStripe\Forms\TextareaField;
|
||||||
@ -22,6 +23,11 @@ class SiteConfigExtension extends DataExtension
|
|||||||
'MapAPIKey' => 'Varchar(255)'
|
'MapAPIKey' => 'Varchar(255)'
|
||||||
];
|
];
|
||||||
|
|
||||||
|
private static $has_one = [
|
||||||
|
'PrivacyPolicy' => SiteTree::class,
|
||||||
|
'Sitemap' => SiteTree::class,
|
||||||
|
];
|
||||||
|
|
||||||
private static $many_many = [
|
private static $many_many = [
|
||||||
'Navigation' => SiteTree::class,
|
'Navigation' => SiteTree::class,
|
||||||
];
|
];
|
||||||
@ -38,6 +44,18 @@ class SiteConfigExtension extends DataExtension
|
|||||||
|
|
||||||
$tab->push(TextareaField::create('ExtraCode', 'Extra site-wide HTML code'));
|
$tab->push(TextareaField::create('ExtraCode', 'Extra site-wide HTML code'));
|
||||||
|
|
||||||
|
$tab->push(DropdownField::create(
|
||||||
|
'PrivacyPolicyID',
|
||||||
|
'Privacy Policy Page',
|
||||||
|
SiteTree::get()->map()->toArray()
|
||||||
|
));
|
||||||
|
|
||||||
|
$tab->push(DropdownField::create(
|
||||||
|
'SitemapID',
|
||||||
|
'Sitemap Page',
|
||||||
|
SitemapPage::get()->map()->toArray()
|
||||||
|
));
|
||||||
|
|
||||||
$mapTab = $fields->findOrMakeTab('Root.GoogleMaps');
|
$mapTab = $fields->findOrMakeTab('Root.GoogleMaps');
|
||||||
$mapTab->push(TextField::create('MapAPIKey'));
|
$mapTab->push(TextField::create('MapAPIKey'));
|
||||||
$mapTab->push(TextField::create('MapZoom'));
|
$mapTab->push(TextField::create('MapZoom'));
|
||||||
|
@ -6,20 +6,26 @@
|
|||||||
|
|
||||||
use SilverStripe\CMS\Controllers\ContentController;
|
use SilverStripe\CMS\Controllers\ContentController;
|
||||||
use SilverStripe\ORM\FieldType\DBDatetime;
|
use SilverStripe\ORM\FieldType\DBDatetime;
|
||||||
use SilverStripe\Blog\Model\BlogPost;
|
|
||||||
|
|
||||||
class PageController extends ContentController
|
class PageController extends ContentController
|
||||||
{
|
{
|
||||||
private static $static_path = '/resources/app/client/dist/';
|
public function setSiteWideMessage($message, $type)
|
||||||
|
|
||||||
public function RecentBlogPosts()
|
|
||||||
{
|
{
|
||||||
return BlogPost::get()->sort('PublishDate DESC');
|
$this->getRequest()->getSession()->set(
|
||||||
|
'SiteWideMessage',
|
||||||
|
[
|
||||||
|
'Message' => $message,
|
||||||
|
'Type' => $type,
|
||||||
|
]
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function StaticPath($path = '')
|
public function getSiteWideMessage()
|
||||||
{
|
{
|
||||||
return self::join_links($this->config()->get('static_path'), $path);
|
$session = $this->getRequest()->getSession();
|
||||||
|
$session->clear('SiteWideMessage');
|
||||||
|
|
||||||
|
return $session->get('SiteWideMessage');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function CurrentTime()
|
public function CurrentTime()
|
||||||
|
@ -38,6 +38,7 @@ class WebpackTemplateProvider implements TemplateGlobalProvider
|
|||||||
'WebpackDevServer' => 'isActive',
|
'WebpackDevServer' => 'isActive',
|
||||||
'WebpackCSS' => 'loadCSS',
|
'WebpackCSS' => 'loadCSS',
|
||||||
'WebpackJS' => 'loadJS',
|
'WebpackJS' => 'loadJS',
|
||||||
|
'ResoursesURL' => 'resoursesURL',
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -59,6 +60,11 @@ class WebpackTemplateProvider implements TemplateGlobalProvider
|
|||||||
Requirements::javascript(self::_getPath($path));
|
Requirements::javascript(self::_getPath($path));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function resoursesURL($link = null)
|
||||||
|
{
|
||||||
|
return Controller::join_links(Director::baseURL(), '/resources/app/client/dist/img/', $link);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if dev mode is enabled and if webpack server is online
|
* Checks if dev mode is enabled and if webpack server is online
|
||||||
|
16
app/templates/BreadcrumbsTemplate.ss
Normal file
16
app/templates/BreadcrumbsTemplate.ss
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
<% if $Pages %>
|
||||||
|
<nav class="breadcrumbs"><ul>
|
||||||
|
<li>
|
||||||
|
<a href="/">Home</a>
|
||||||
|
$Delimiter.RAW
|
||||||
|
</li>
|
||||||
|
<% loop $Pages %>
|
||||||
|
<li<% if $Last %> class="current"<% end_if %>>
|
||||||
|
<% if not Up.Unlinked %><a href="$Link" class="breadcrumb-$Pos"><% end_if %>
|
||||||
|
$MenuTitle.XML
|
||||||
|
<% if not Up.Unlinked %></a><% end_if %>
|
||||||
|
$Up.Delimiter.RAW
|
||||||
|
</li>
|
||||||
|
<% end_loop %>
|
||||||
|
</ul></nav>
|
||||||
|
<% end_if %>
|
5
app/templates/Includes/SiteWideMessage.ss
Normal file
5
app/templates/Includes/SiteWideMessage.ss
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
<% if $SiteWideMessage %>
|
||||||
|
<div class="alert alert-fixed-top alert-{$Type}">
|
||||||
|
{$Message}
|
||||||
|
</div>
|
||||||
|
<% end_if %>
|
7
app/templates/Objects/Map.ss
Normal file
7
app/templates/Objects/Map.ss
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
<div class="mapAPI-map-container" data-map-zoom="$MapZoom" data-key="$MapAPIKey" data-geojson="$GeoJSON.XML">
|
||||||
|
<div class="mapAPI-map"></div>
|
||||||
|
|
||||||
|
<div class="text-right">
|
||||||
|
$DirectionsLink.RAW
|
||||||
|
</div>
|
||||||
|
</div>
|
@ -15,6 +15,9 @@
|
|||||||
<%-- Loading Spinner --%>
|
<%-- Loading Spinner --%>
|
||||||
<div id="PageLoading"><div class="loading-spinner"><div class="bubblingG"><i id="bubblingG_1"></i><i id="bubblingG_2"></i><i id="bubblingG_3"></i></div><br/><%t Page.LOADINGTEXT 'LOADING ..' %></div></div>
|
<div id="PageLoading"><div class="loading-spinner"><div class="bubblingG"><i id="bubblingG_1"></i><i id="bubblingG_2"></i><i id="bubblingG_3"></i></div><br/><%t Page.LOADINGTEXT 'LOADING ..' %></div></div>
|
||||||
|
|
||||||
|
<%-- Site Wide Alert Message --%>
|
||||||
|
<% include SiteWideMessage %>
|
||||||
|
|
||||||
<div class="wrapper">
|
<div class="wrapper">
|
||||||
<header id="Header" class="container">
|
<header id="Header" class="container">
|
||||||
<% include Header %>
|
<% include Header %>
|
||||||
|
@ -30,7 +30,8 @@
|
|||||||
"undefinedoffset/silverstripe-nocaptcha": "*",
|
"undefinedoffset/silverstripe-nocaptcha": "*",
|
||||||
"a2nt/silverstripe-font-awesome-field": "dev-master",
|
"a2nt/silverstripe-font-awesome-field": "dev-master",
|
||||||
"stevie-mayhew/silverstripe-svg": "^2.1",
|
"stevie-mayhew/silverstripe-svg": "^2.1",
|
||||||
"betterbrief/silverstripe-googlemapfield": "*"
|
"betterbrief/silverstripe-googlemapfield": "^2.1",
|
||||||
|
"innoweb/silverstripe-sitemap": "^2.0"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"phpunit/phpunit": "^5.7",
|
"phpunit/phpunit": "^5.7",
|
||||||
|
@ -25,7 +25,9 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"bootbox": "^4.4.0",
|
"bootbox": "^4.4.0",
|
||||||
"bootstrap": "^4.1.1",
|
"bootstrap": "^4.1.1",
|
||||||
|
"bootstrap-datepicker": "^1.8.0",
|
||||||
"bootstrap-offcanvas": "^1.0.0",
|
"bootstrap-offcanvas": "^1.0.0",
|
||||||
|
"bootstrap-timepicker": "^0.5.2",
|
||||||
"core-util-is": "^1.0.2",
|
"core-util-is": "^1.0.2",
|
||||||
"font-awesome": "^4.7.0",
|
"font-awesome": "^4.7.0",
|
||||||
"foundation-emails": "^2.2.1",
|
"foundation-emails": "^2.2.1",
|
||||||
|
Loading…
Reference in New Issue
Block a user