@shift72/core-template 1.9.8 → 1.9.9

Sign up to get free protection for your applications and to get access to all the features.
package/CHANGELOG.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Changelog
2
2
 
3
- ## [Unreleased](https://github.com/shift72/core-template/compare/1.9.8...HEAD)
3
+ ## [Unreleased](https://github.com/shift72/core-template/compare/1.9.9...HEAD)
4
4
 
5
5
  ### Added
6
6
 
@@ -8,6 +8,14 @@
8
8
 
9
9
  ### Fixed
10
10
 
11
+ ## [1.9.9](https://github.com/shift72/core-template/compare/1.9.8...1.9.9)
12
+
13
+ ### Changed
14
+
15
+ - Update the checkout embed to suit latest version, and to pass through urls
16
+ - Add flags in `application.jet` to switch on local dev options for relish and
17
+ checkout.
18
+
11
19
  ## [1.9.8](https://github.com/shift72/core-template/compare/1.9.7...1.9.8)
12
20
 
13
21
  ### Fixed
package/README.md CHANGED
@@ -13,4 +13,5 @@ This template supports the following features:
13
13
 
14
14
  ## Running local content
15
15
 
16
- To use a local version of relish, update [application.jet](site/templates/application/application.jet) to set the CDN to: `{{CDN := "//localhost:3000"}}`.
16
+ To use a local version of relish or checkout, update the flags at the top of
17
+ [application.jet](site/templates/application/application.jet)
package/kibble.json CHANGED
@@ -194,5 +194,5 @@
194
194
  "pageSize": 0
195
195
  }
196
196
  ],
197
- "coreTemplateVersion": "1.9.8"
197
+ "coreTemplateVersion": "1.9.9"
198
198
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shift72/core-template",
3
- "version": "1.9.8",
3
+ "version": "1.9.9",
4
4
  "description": "Shift72 core template",
5
5
  "license": "MIT",
6
6
  "scripts": {
@@ -0,0 +1,5 @@
1
+ {{extends "templates/application/application.jet"}}
2
+
3
+ {{block body()}}
4
+ <s72-shopping-embeddable></s72-shopping-embeddable>
5
+ {{end}}
@@ -5,14 +5,17 @@
5
5
  {{import "./pixel.jet"}}
6
6
  {{import "./footer/footer.jet" }}
7
7
 
8
- {{CDN := "//cdn.shift72.com/1.4"}}
9
- {*{CDN := "//localhost:3000"}*}
8
+ {{useLocalDevRelish := false}}
9
+ {{useLocalDevCheckout := false}}
10
+
11
+ {{CDN := useLocalDevRelish ? "//localhost:3000" : "//cdn.shift72.com/1.4"}}
10
12
 
11
13
  {{CSSFileURL := site.SiteBrand.GetLink("css", "")}}
12
14
  {*{CSSFileURL := "/styles/local.css"}*}
13
15
 
14
- {{checkoutDevMode := false}}
15
- {{useCheckout := site.Toggles["use_checkout"] || checkoutDevMode}}
16
+ {{useCheckout := site.Toggles["use_checkout"] || useLocalDevCheckout}}
17
+ {{checkoutDevServer := "http://localhost:4072"}}
18
+ {{checkoutScriptUrl := useLocalDevCheckout ? checkoutDevServer + "/s72.checkout.js" : "/checkout/s72.checkout.js"}}
16
19
 
17
20
  <!DOCTYPE html>
18
21
  <html lang="{{lang.Code}}">
@@ -55,16 +58,9 @@
55
58
 
56
59
  <script src="{{CDN}}/s72.transactional.js" defer></script>
57
60
 
58
- {{if checkoutDevMode}}
59
- <script>window.S72_CHECKOUT_OVERRIDE_URL = 'http://localhost:4072'</script>
60
- <script src="http://localhost:4072/s72.checkout.js" defer></script>
61
- {{else if useCheckout}}
62
- <script src="/checkout/s72.checkout.js" defer></script>
63
- {{end}}
64
-
65
61
  <script src="https://js.stripe.com/v3/" defer></script>
66
62
 
67
- {* get default language from site record or kibble.json depening on if db translations is enabled *}
63
+ {* get default language from site record or kibble.json depening on if db translations is enabled *}
68
64
  {{ defaultLanguage := isEnabled("site_translations_api") ? site.DefaultLanguage : site.SiteConfig.DefaultLanguage }}
69
65
  <script>
70
66
  window.addEventListener('DOMContentLoaded', function(){
@@ -78,6 +74,22 @@
78
74
  });
79
75
  </script>
80
76
 
77
+ {{if useCheckout}}
78
+ <script src="{{checkoutScriptUrl}}" defer></script>
79
+ <script>
80
+ window.Shift72CheckoutOptions = {
81
+ baseUrl: window.location.origin,
82
+ {{if useLocalDevCheckout}}checkoutDevServerUrl: '{{checkoutDevServer}}',{{end}}
83
+ links: {
84
+ library: '{{routeToPath("/library.html")}}',
85
+ termsAndConditions: '{{routeToPath("/page/terms-and-conditions/")}}',
86
+ deviceCompatibility: '{{routeToPath("/page/help/")}}',
87
+ help: '{{routeToPath("/page/help/")}}'
88
+ }
89
+ };
90
+ </script>
91
+ {{end}}
92
+
81
93
  <script type="text/javascript" src="/scripts/swiper.min.js"></script>
82
94
  </head>
83
95
  <body>
@@ -8,7 +8,9 @@
8
8
  <a href="{{ routeToPath("/signin.html") }}" class="btn btn-signin-primary">{{i18n("nav_signin")}}</a>
9
9
  {{else}}
10
10
  <a href="{{ routeToPath("/signin.html") }}" class="btn btn-signin">{{i18n("nav_signin")}}</a>
11
- <a href="{{routeToPath("/signup.html")}}" class="btn btn-signup">{{i18n("nav_signup")}}</a>
11
+ {{create_account_link := config("create_account_link")}}
12
+ {{href := create_account_link == "" ? routeToPath("/signup.html") : create_account_link}}
13
+ <a href="{{href}}" class="btn btn-signup">{{i18n("nav_signup")}}</a>
12
14
  {{end}}
13
15
  </s72-user-anon>
14
16
  {{end}}
@@ -0,0 +1,4 @@
1
+ {
2
+ "primaryColor": {{isset(site.Config["theme_primary_color"]) ? json(site.Config["theme_primary_color"]) : "null" | raw }},
3
+ "mode": {{site.Config["theme_mode"] == "dark" ? "\"dark\"" : "\"light\"" | raw}}
4
+ }