Skip to content

armgit / fider

Public Imported from GitHub
0

Open platform to collect and prioritize feedback

refactoring: send less data to browser (#707)

Guilherme Oenningd0e23a1920a9
diff --git a/app/pkg/web/renderer.go b/app/pkg/web/renderer.go
index 137d78f0a..68638be4b 100644
--- a/app/pkg/web/renderer.go
+++ b/app/pkg/web/renderer.go
@@ -24,9 +24,6 @@ var templateFunctions = template.FuncMap{
"md5": func(input string) string {
return crypto.MD5(input)
},
- "replace": func(input, from, to string) string {
- return strings.Replace(input, from, to, -1)
- },
"markdown": func(input string) template.HTML {
return markdown.Full(input)
},
@@ -161,7 +158,8 @@ func (r *Renderer) Render(w io.Writer, name string, props Props, ctx *Context) {
tmpl = r.add(name)
}
- m := make(Map, 0)
+ public := make(Map, 0)
+ private := make(Map, 0)
tenantName := "Fider"
if ctx.Tenant() != nil {
@@ -173,27 +171,24 @@ func (r *Renderer) Render(w io.Writer, name string, props Props, ctx *Context) {
title = fmt.Sprintf("%s · %s", props.Title, tenantName)
}
- m["__title"] = title
+ public["title"] = title
if props.Description != "" {
description := strings.Replace(props.Description, "\n", " ", -1)
- m["__description"] = fmt.Sprintf("%.150s", description)
+ public["description"] = fmt.Sprintf("%.150s", description)
}
if props.ChunkName != "" {
- m["__chunkAssets"] = r.chunkedAssets[props.ChunkName]
+ private["chunkAssets"] = r.chunkedAssets[props.ChunkName]
}
- m["__assets"] = r.assets
- m["__logo"] = ctx.LogoURL()
- m["__favicon"] = ctx.FaviconURL()
- m["__contextID"] = ctx.ContextID()
- m["__currentURL"] = ctx.Request.URL.String()
+ private["assets"] = r.assets
+ private["logo"] = ctx.LogoURL()
+ private["favicon"] = ctx.FaviconURL()
+ private["currentURL"] = ctx.Request.URL.String()
if canonicalURL := ctx.Get("Canonical-URL"); canonicalURL != nil {
- m["__canonicalURL"] = canonicalURL
+ private["canonicalURL"] = canonicalURL
}
- m["__tenant"] = ctx.Tenant()
- m["__props"] = props.Data
oauthProviders := make([]*oauth.ProviderOption, 0)
if !ctx.IsAuthenticated() && ctx.Services() != nil {
@@ -203,7 +198,10 @@ func (r *Renderer) Render(w io.Writer, name string, props Props, ctx *Context) {
}
}
- m["__settings"] = &Map{
+ public["contextID"] = ctx.ContextID()
+ public["tenant"] = ctx.Tenant()
+ public["props"] = props.Data
+ public["settings"] = &Map{
"mode": r.settings.Mode,
"buildTime": r.settings.BuildTime,
"version": r.settings.Version,
@@ -221,7 +219,7 @@ func (r *Renderer) Render(w io.Writer, name string, props Props, ctx *Context) {
if ctx.IsAuthenticated() {
u := ctx.User()
- m["__user"] = &Map{
+ public["user"] = &Map{
"id": u.ID,
"name": u.Name,
"email": u.Email,
@@ -235,7 +233,10 @@ func (r *Renderer) Render(w io.Writer, name string, props Props, ctx *Context) {
}
}
- err = tmpl.Execute(w, m)
+ err = tmpl.Execute(w, Map{
+ "public": public,
+ "private": private,
+ })
if err != nil {
panic(errors.Wrap(err, "failed to execute template %s", name))
}
diff --git a/app/pkg/web/testdata/basic.html b/app/pkg/web/testdata/basic.html
index 9fe9c16ec..05b782b2d 100755
--- a/app/pkg/web/testdata/basic.html
+++ b/app/pkg/web/testdata/basic.html
@@ -37,7 +37,7 @@
<script id="server-data" type="application/json">
- {"__assets":{"CSS":["/assets/css/file1.css"],"JS":["/assets/js/file1.js","/assets/js/file2.js"]},"__contextID":"CONTEXT_ID","__currentURL":"https://demo.test.fider.io:3000/","__favicon":"https://demo.test.fider.io:3000/favicon","__logo":"https://getfider.com/images/logo-100x100.png","__props":null,"__settings":{"baseURL":"https://demo.test.fider.io:3000","buildTime":"","compiler":"","domain":"","environment":"","globalAssetsURL":"https://demo.test.fider.io:3000","googleAnalytics":"","hasLegal":false,"mode":"","oauth":[],"stripePublicKey":"","tenantAssetsURL":"https://demo.test.fider.io:3000","version":""},"__tenant":null,"__title":"Fider"}
+ {"contextID":"CONTEXT_ID","props":null,"settings":{"baseURL":"https://demo.test.fider.io:3000","buildTime":"","compiler":"","domain":"","environment":"","globalAssetsURL":"https://demo.test.fider.io:3000","googleAnalytics":"","hasLegal":false,"mode":"","oauth":[],"stripePublicKey":"","tenantAssetsURL":"https://demo.test.fider.io:3000","version":""},"tenant":null,"title":"Fider"}
</script>
<script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=es6,fetch" crossorigin="anonymous"></script>
diff --git a/app/pkg/web/testdata/canonical.html b/app/pkg/web/testdata/canonical.html
index 95007e7f1..ad1af268e 100755
--- a/app/pkg/web/testdata/canonical.html
+++ b/app/pkg/web/testdata/canonical.html
@@ -39,7 +39,7 @@
<script id="server-data" type="application/json">
- {"__assets":{"CSS":["/assets/css/file1.css"],"JS":["/assets/js/file1.js","/assets/js/file2.js"]},"__canonicalURL":"http://feedback.demo.org","__contextID":"CONTEXT_ID","__currentURL":"https://demo.test.fider.io:3000/","__favicon":"https://demo.test.fider.io:3000/favicon","__logo":"https://getfider.com/images/logo-100x100.png","__props":null,"__settings":{"baseURL":"https://demo.test.fider.io:3000","buildTime":"","compiler":"","domain":"","environment":"","globalAssetsURL":"https://demo.test.fider.io:3000","googleAnalytics":"","hasLegal":false,"mode":"","oauth":[],"stripePublicKey":"","tenantAssetsURL":"https://demo.test.fider.io:3000","version":""},"__tenant":null,"__title":"Fider"}
+ {"contextID":"CONTEXT_ID","props":null,"settings":{"baseURL":"https://demo.test.fider.io:3000","buildTime":"","compiler":"","domain":"","environment":"","globalAssetsURL":"https://demo.test.fider.io:3000","googleAnalytics":"","hasLegal":false,"mode":"","oauth":[],"stripePublicKey":"","tenantAssetsURL":"https://demo.test.fider.io:3000","version":""},"tenant":null,"title":"Fider"}
</script>
<script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=es6,fetch" crossorigin="anonymous"></script>
diff --git a/app/pkg/web/testdata/chunk.html b/app/pkg/web/testdata/chunk.html
index 316afd84d..e7389421a 100644
--- a/app/pkg/web/testdata/chunk.html
+++ b/app/pkg/web/testdata/chunk.html
@@ -44,7 +44,7 @@
<script id="server-data" type="application/json">
- {"__assets":{"CSS":["/assets/css/file1.css"],"JS":["/assets/js/file1.js","/assets/js/file2.js"]},"__chunkAssets":{"CSS":["/assets/css/Test.page.css"],"JS":["/assets/js/Test.page.js"]},"__contextID":"CONTEXT_ID","__currentURL":"https://demo.test.fider.io:3000/","__favicon":"https://demo.test.fider.io:3000/favicon","__logo":"https://getfider.com/images/logo-100x100.png","__props":null,"__settings":{"baseURL":"https://demo.test.fider.io:3000","buildTime":"","compiler":"","domain":"","environment":"","globalAssetsURL":"https://demo.test.fider.io:3000","googleAnalytics":"","hasLegal":false,"mode":"","oauth":[],"stripePublicKey":"","tenantAssetsURL":"https://demo.test.fider.io:3000","version":""},"__tenant":null,"__title":"Fider"}
+ {"contextID":"CONTEXT_ID","props":null,"settings":{"baseURL":"https://demo.test.fider.io:3000","buildTime":"","compiler":"","domain":"","environment":"","globalAssetsURL":"https://demo.test.fider.io:3000","googleAnalytics":"","hasLegal":false,"mode":"","oauth":[],"stripePublicKey":"","tenantAssetsURL":"https://demo.test.fider.io:3000","version":""},"tenant":null,"title":"Fider"}
</script>
<script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=es6,fetch" crossorigin="anonymous"></script>
diff --git a/app/pkg/web/testdata/props.html b/app/pkg/web/testdata/props.html
index 3c53329c2..053aad662 100755
--- a/app/pkg/web/testdata/props.html
+++ b/app/pkg/web/testdata/props.html
@@ -37,7 +37,7 @@
<script id="server-data" type="application/json">
- {"__assets":{"CSS":["/assets/css/file1.css"],"JS":["/assets/js/file1.js","/assets/js/file2.js"]},"__contextID":"CONTEXT_ID","__currentURL":"https://demo.test.fider.io:3000/","__description":"My Page Description","__favicon":"https://demo.test.fider.io:3000/favicon","__logo":"https://getfider.com/images/logo-100x100.png","__props":{"array":["1","2"],"number":2,"object":{"key1":"value1","key2":"value2"}},"__settings":{"baseURL":"https://demo.test.fider.io:3000","buildTime":"","compiler":"","domain":"","environment":"","globalAssetsURL":"https://demo.test.fider.io:3000","googleAnalytics":"","hasLegal":false,"mode":"","oauth":[],"stripePublicKey":"","tenantAssetsURL":"https://demo.test.fider.io:3000","version":""},"__tenant":null,"__title":"My Page Title · Fider"}
+ {"contextID":"CONTEXT_ID","description":"My Page Description","props":{"array":["1","2"],"number":2,"object":{"key1":"value1","key2":"value2"}},"settings":{"baseURL":"https://demo.test.fider.io:3000","buildTime":"","compiler":"","domain":"","environment":"","globalAssetsURL":"https://demo.test.fider.io:3000","googleAnalytics":"","hasLegal":false,"mode":"","oauth":[],"stripePublicKey":"","tenantAssetsURL":"https://demo.test.fider.io:3000","version":""},"tenant":null,"title":"My Page Title · Fider"}
</script>
<script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=es6,fetch" crossorigin="anonymous"></script>
diff --git a/app/pkg/web/testdata/tenant.html b/app/pkg/web/testdata/tenant.html
index ff751545d..4e029f3fe 100755
--- a/app/pkg/web/testdata/tenant.html
+++ b/app/pkg/web/testdata/tenant.html
@@ -37,7 +37,7 @@
<script id="server-data" type="application/json">
- {"__assets":{"CSS":["/assets/css/file1.css"],"JS":["/assets/js/file1.js","/assets/js/file2.js"]},"__contextID":"CONTEXT_ID","__currentURL":"https://demo.test.fider.io:3000/","__favicon":"https://demo.test.fider.io:3000/favicon","__logo":"https://getfider.com/images/logo-100x100.png","__props":null,"__settings":{"baseURL":"https://demo.test.fider.io:3000","buildTime":"","compiler":"","domain":"","environment":"","globalAssetsURL":"https://demo.test.fider.io:3000","googleAnalytics":"","hasLegal":false,"mode":"","oauth":[],"stripePublicKey":"","tenantAssetsURL":"https://demo.test.fider.io:3000","version":""},"__tenant":{"id":0,"name":"Game of Thrones","subdomain":"","invitation":"","welcomeMessage":"","cname":"","status":0,"isPrivate":false,"logoBlobKey":""},"__title":"Game of Thrones"}
+ {"contextID":"CONTEXT_ID","props":null,"settings":{"baseURL":"https://demo.test.fider.io:3000","buildTime":"","compiler":"","domain":"","environment":"","globalAssetsURL":"https://demo.test.fider.io:3000","googleAnalytics":"","hasLegal":false,"mode":"","oauth":[],"stripePublicKey":"","tenantAssetsURL":"https://demo.test.fider.io:3000","version":""},"tenant":{"id":0,"name":"Game of Thrones","subdomain":"","invitation":"","welcomeMessage":"","cname":"","status":0,"isPrivate":false,"logoBlobKey":""},"title":"Game of Thrones"}
</script>
<script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=es6,fetch" crossorigin="anonymous"></script>
diff --git a/app/pkg/web/testdata/user.html b/app/pkg/web/testdata/user.html
index 2f686bddf..42d68a583 100755
--- a/app/pkg/web/testdata/user.html
+++ b/app/pkg/web/testdata/user.html
@@ -37,7 +37,7 @@
<script id="server-data" type="application/json">
- {"__assets":{"CSS":["/assets/css/file1.css"],"JS":["/assets/js/file1.js","/assets/js/file2.js"]},"__contextID":"CONTEXT_ID","__currentURL":"https://demo.test.fider.io:3000/","__description":"My Page Description","__favicon":"https://demo.test.fider.io:3000/favicon","__logo":"https://getfider.com/images/logo-100x100.png","__props":null,"__settings":{"baseURL":"https://demo.test.fider.io:3000","buildTime":"","compiler":"","domain":"","environment":"","globalAssetsURL":"https://demo.test.fider.io:3000","googleAnalytics":"","hasLegal":false,"mode":"","oauth":[],"stripePublicKey":"","tenantAssetsURL":"https://demo.test.fider.io:3000","version":""},"__tenant":null,"__title":"My Page Title · Fider","__user":{"avatarBlobKey":"","avatarType":"gravatar","avatarURL":"https://demo.test.fider.io:3000/avatars/gravatar/5/Jon%20Snow","email":"[email protected]","id":5,"isAdministrator":true,"isCollaborator":true,"name":"Jon Snow","role":"administrator","status":"active"}}
+ {"contextID":"CONTEXT_ID","description":"My Page Description","props":null,"settings":{"baseURL":"https://demo.test.fider.io:3000","buildTime":"","compiler":"","domain":"","environment":"","globalAssetsURL":"https://demo.test.fider.io:3000","googleAnalytics":"","hasLegal":false,"mode":"","oauth":[],"stripePublicKey":"","tenantAssetsURL":"https://demo.test.fider.io:3000","version":""},"tenant":null,"title":"My Page Title · Fider","user":{"avatarBlobKey":"","avatarType":"gravatar","avatarURL":"https://demo.test.fider.io:3000/avatars/gravatar/5/Jon%20Snow","email":"[email protected]","id":5,"isAdministrator":true,"isCollaborator":true,"name":"Jon Snow","role":"administrator","status":"active"}}
</script>
<script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=es6,fetch" crossorigin="anonymous"></script>
diff --git a/public/services/fider.ts b/public/services/fider.ts
index c4c6dc9fd..877eb287c 100644
--- a/public/services/fider.ts
+++ b/public/services/fider.ts
@@ -7,10 +7,10 @@ export class FiderSession {
private pProps: { [key: string]: any } = {};
constructor(data: any) {
- this.pContextID = data.__contextID;
- this.pProps = data.__props;
- this.pUser = data.__user;
- this.pTenant = data.__tenant;
+ this.pContextID = data.contextID;
+ this.pProps = data.props;
+ this.pUser = data.user;
+ this.pTenant = data.tenant;
}
public get contextID(): string {
@@ -41,7 +41,7 @@ export class FiderImpl {
public initialize = (): FiderImpl => {
const el = document.getElementById("server-data");
const data = el ? JSON.parse(el.textContent || el.innerText) : {};
- this.pSettings = data.__settings;
+ this.pSettings = data.settings;
this.pSession = new FiderSession(data);
return this;
};
diff --git a/views/403.html b/views/403.html
index ba28f2f14..ee1e8dfc9 100644
--- a/views/403.html
+++ b/views/403.html
@@ -2,14 +2,14 @@
{{define "content"}}
<div class="container failure-page">
- <img src="{{.__logo}}"/>
+ <img src="{{ .private.logo }}"/>
<h1>NOT AUTHORIZED</h1>
<p>
You are not authorized to view this page.
</p>
- {{ if .__tenant }}
- <span>Take me back to <a href="{{ .__settings.baseURL }}">{{ .__settings.baseURL }}</a> home page.</span>
+ {{ if .public.tenant }}
+ <span>Take me back to <a href="{{ .public.settings.baseURL }}">{{ .public.settings.baseURL }}</a> home page.</span>
{{ end }}
</div>
{{end}}
diff --git a/views/404.html b/views/404.html
index 0f25869d7..2bb839e47 100644
--- a/views/404.html
+++ b/views/404.html
@@ -2,15 +2,15 @@
{{define "content"}}
<div class="container failure-page">
- <img src="{{.__logo}}"/>
+ <img src="{{ .private.logo }}"/>
<h1>PAGE NOT FOUND</h1>
<p>
The link you clicked may be broken or <br />
the page may have been removed.
</p>
- {{ if .__tenant }}
- <span>Take me back to <a href="{{ .__settings.baseURL }}">{{ .__settings.baseURL }}</a> home page.</span>
+ {{ if .public.tenant }}
+ <span>Take me back to <a href="{{ .public.settings.baseURL }}">{{ .public.settings.baseURL }}</a> home page.</span>
{{ end }}
</div>
{{end}}
diff --git a/views/410.html b/views/410.html
index cd1885b38..d2438d5a8 100644
--- a/views/410.html
+++ b/views/410.html
@@ -2,12 +2,12 @@
{{define "content"}}
<div class="container failure-page">
- <img src="{{.__logo}}"/>
+ <img src="{{ .private.logo }}"/>
<h1>EXPIRED</h1>
<p>The link you clicked has expired.</p>
- {{ if .__tenant }}
- <span>Take me back to <a href="{{ .__settings.baseURL }}">{{ .__settings.baseURL }}</a> home page.</span>
+ {{ if .public.tenant }}
+ <span>Take me back to <a href="{{ .public.settings.baseURL }}">{{ .public.settings.baseURL }}</a> home page.</span>
{{ end }}
</div>
{{end}}
diff --git a/views/500.html b/views/500.html
index d6e7bc588..d0e9ef0c5 100644
--- a/views/500.html
+++ b/views/500.html
@@ -2,12 +2,12 @@
{{define "content"}}
<div class="container failure-page">
- <img src="{{.__logo}}"/>
+ <img src="{{ .private.logo }}"/>
<h1>Shoot! Well, this is unexpected…</h1>
<p>An error has occurred and we're working to fix the problem! </br> We’ll be up and running shortly.</p>
- {{ if .__tenant }}
- <span>Take me back to <a href="{{ .__settings.baseURL }}">{{ .__settings.baseURL }}</a> home page.</span>
+ {{ if .public.tenant }}
+ <span>Take me back to <a href="{{ .public.settings.baseURL }}">{{ .public.settings.baseURL }}</a> home page.</span>
{{ end }}
</div>
{{end}}
diff --git a/views/base.html b/views/base.html
index 7637cd948..7661261a1 100644
--- a/views/base.html
+++ b/views/base.html
@@ -4,32 +4,32 @@
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
- <link rel="icon" href='{{ .__favicon }}?size=64' sizes="64x64" type="image/png">
- <link rel="icon" href='{{ .__favicon }}?size=192' sizes="192x192" type="image/png">
- <link rel="apple-touch-icon" href='{{ .__favicon }}?size=180&bg=white' sizes="180x180" type="image/png">
- {{ if .__canonicalURL }}
- <link rel="canonical" href="{{ .__canonicalURL }}" />
+ <link rel="icon" href='{{ .private.favicon }}?size=64' sizes="64x64" type="image/png">
+ <link rel="icon" href='{{ .private.favicon }}?size=192' sizes="192x192" type="image/png">
+ <link rel="apple-touch-icon" href='{{ .private.favicon }}?size=180&bg=white' sizes="180x180" type="image/png">
+ {{ if .private.canonicalURL }}
+ <link rel="canonical" href="{{ .private.canonicalURL }}" />
{{ end }}
- {{ if .__assets }}
- {{range .__assets.CSS}}
- <link rel="stylesheet" href="{{ $.__settings.globalAssetsURL }}{{ . }}" />
+ {{ if .private.assets }}
+ {{range .private.assets.CSS}}
+ <link rel="stylesheet" href="{{ $.public.settings.globalAssetsURL }}{{ . }}" />
{{end}}
{{end}}
- {{ if .__chunkAssets }}
- {{range .__chunkAssets.CSS}}
- <link rel="preload" href="{{ $.__settings.globalAssetsURL }}{{ . }}" as="style" />
+ {{ if .private.chunkAssets }}
+ {{range .private.chunkAssets.CSS}}
+ <link rel="preload" href="{{ $.public.settings.globalAssetsURL }}{{ . }}" as="style" />
{{end}}
- {{range .__chunkAssets.JS}}
- <link rel="preload" href="{{ $.__settings.globalAssetsURL }}{{ . }}" as="script" />
+ {{range .private.chunkAssets.JS}}
+ <link rel="preload" href="{{ $.public.settings.globalAssetsURL }}{{ . }}" as="script" />
{{end}}
{{end}}
- <title>{{ .__title }}</title>
- <meta name="description" content="{{ .__description }}" />
- <meta property="og:title" content="{{ .__title }}" />
- <meta property="og:description" content="{{ .__description }}" />
+ <title>{{ .public.title }}</title>
+ <meta name="description" content="{{ .public.description }}" />
+ <meta property="og:title" content="{{ .public.title }}" />
+ <meta property="og:description" content="{{ .public.description }}" />
<meta property="og:type" content="website" />
- <meta property="og:url" content="{{ .__currentURL }}" />
- <meta property="og:image" content="{{ .__logo }}">
+ <meta property="og:url" content="{{ .private.currentURL }}" />
+ <meta property="og:image" content="{{ .private.logo }}">
</head>
<body>
<noscript class="container">
@@ -40,15 +40,15 @@
</div>
</noscript>
- {{ if ne .__settings.googleAnalytics "" }}
- <script type="text/javascript" nonce="{{ .__contextID }}">
+ {{ if ne .public.settings.googleAnalytics "" }}
+ <script type="text/javascript" nonce="{{ .public.contextID }}">
(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','https://www.google-analytics.com/analytics.js','ga');
- ga('create', '{{ .__settings.googleAnalytics }}', 'auto');
- {{ if .__tenant }}ga('set', 'dimension1', '{{ .__tenant.Subdomain }}');{{ end }}
+ ga('create', '{{ .public.settings.googleAnalytics }}', 'auto');
+ {{ if .public.tenant }}ga('set', 'dimension1', '{{ .public.tenant.Subdomain }}');{{ end }}
ga('send', 'pageview');
</script>
{{ end }}
@@ -60,9 +60,9 @@
</script>
<script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=es6,fetch" crossorigin="anonymous"></script>
{{template "end-of-body" .}}
- {{ if .__tenant }}
- {{ if .__tenant.CustomCSS }}
- <link rel="stylesheet" href="{{ .__settings.tenantAssetsURL }}/custom/{{ .__tenant.CustomCSS | md5 }}.css" />
+ {{ if .public.tenant }}
+ {{ if .public.tenant.CustomCSS }}
+ <link rel="stylesheet" href="{{ .public.settings.tenantAssetsURL }}/custom/{{ .public.tenant.CustomCSS | md5 }}.css" />
{{ end }}
{{ end }}
</body>
diff --git a/views/browser-not-supported.html b/views/browser-not-supported.html
index 3c27b973a..982c0dfef 100644
--- a/views/browser-not-supported.html
+++ b/views/browser-not-supported.html
@@ -6,7 +6,7 @@ Browser not supported &middot; Fider
{{define "content"}}
<div class="container failure-page">
- <img src="{{.__logo}}"/>
+ <img src="{{ .private.logo }}"/>
<h1>BROWSER NOT SUPPORTED</h1>
<p>
You are visiting this page because we detected an unsupported browser. Your browser does not support security features that we require. We highly recommend that you update your browser.
diff --git a/views/index.html b/views/index.html
index 1320e8a13..50b0a941d 100644
--- a/views/index.html
+++ b/views/index.html
@@ -1,13 +1,13 @@
// Print all variables that does not start with _ (95)
// Compressed to avoid whitespace being printed
{{define "server-data"}}
- {{ . }}
+ {{ .public }}
{{ end }}
{{define "content"}}<div id="root"></div><div id="root-modal"></div><div id="root-toastify"></div>{{end}}
{{define "end-of-body"}}
- {{ if .__assets }}
- {{range .__assets.JS}}
- <script src="{{ $.__settings.globalAssetsURL }}{{ . }}" crossorigin="anonymous"></script>
+ {{ if .private.assets }}
+ {{range .private.assets.JS}}
+ <script src="{{ $.public.settings.globalAssetsURL }}{{ . }}" crossorigin="anonymous"></script>
{{end}}
{{end}}
{{end}}
\ No newline at end of file
diff --git a/views/legal.html b/views/legal.html
index 92f123e26..535616d3e 100644
--- a/views/legal.html
+++ b/views/legal.html
@@ -2,7 +2,7 @@
{{define "content"}}
<div class="container legal-page">
- {{ .__props.Content | markdown }}
+ {{ .public.props.Content | markdown }}
</div>
{{end}}
diff --git a/views/maintenance.html b/views/maintenance.html
index 89d0a62c2..175ca8602 100644
--- a/views/maintenance.html
+++ b/views/maintenance.html
@@ -2,12 +2,12 @@
{{define "content"}}
<div class="container failure-page">
- <img src="{{.__logo}}"/>
+ <img src="{{ .private.logo }}"/>
<h1>UNDER MAINTENANCE</h1>
- <p>{{ .__props.message }}</p>
+ <p>{{ .public.props.message }}</p>
- {{ if .__props.until }}
- <p>We'll be back at <strong>{{ .__props.until }}</strong>.</p>
+ {{ if .public.props.until }}
+ <p>We'll be back at <strong>{{ .public.props.until }}</strong>.</p>
{{ else }}
<p>We'll be back soon.</p>
{{ end }}
diff --git a/views/not-invited.html b/views/not-invited.html
index cc8da4216..3b311ebc7 100644
--- a/views/not-invited.html
+++ b/views/not-invited.html
@@ -6,14 +6,14 @@ Not Invited &middot; Fider
{{define "content"}}
<div class="container failure-page">
- <img src="{{.__logo}}"/>
+ <img src="{{ .private.logo }}"/>
<h1>NOT INVITED</h1>
<p>
We couldn't find your account for your email address.
</p>
- {{ if .__tenant }}
- <span>Take me back to <a href="{{ .__settings.baseURL }}/signin">{{ .__settings.baseURL }}/signin</a>.</span>
+ {{ if .public.tenant }}
+ <span>Take me back to <a href="{{ .public.settings.baseURL }}/signin">{{ .public.settings.baseURL }}/signin</a>.</span>
{{ end }}
</div>
{{end}}
diff --git a/views/pending-activation.html b/views/pending-activation.html
index b39d95998..a354c25bf 100644
--- a/views/pending-activation.html
+++ b/views/pending-activation.html
@@ -6,7 +6,7 @@ Pending Activation &middot; Fider
{{define "content"}}
<div class="container failure-page">
- <img src="{{.__logo}}"/>
+ <img src="{{ .private.logo }}"/>
<h1>YOUR ACCOUNT IS PENDING ACTIVATION</h1>
<p>We sent you a confirmation email with a link to activate your site.</p>
<p>Please check your inbox to activate it.</p>