mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2024-12-22 18:22:11 +00:00
[bugfix] Load instance-wide custom css in page stylesheets template (#3601)
* [bugfix] Load instance-wide custom css in page stylesheets template * [chore] remove redunt import
This commit is contained in:
parent
eb77ceeed6
commit
f78002f915
|
@ -54,7 +54,7 @@ func (m *Module) aboutGETHandler(c *gin.Context) {
|
||||||
Template: "about.tmpl",
|
Template: "about.tmpl",
|
||||||
Instance: instance,
|
Instance: instance,
|
||||||
OGMeta: apiutil.OGBase(instance),
|
OGMeta: apiutil.OGBase(instance),
|
||||||
Stylesheets: []string{cssAbout, instanceCustomCSSPath},
|
Stylesheets: []string{cssAbout},
|
||||||
Extra: map[string]any{
|
Extra: map[string]any{
|
||||||
"showStrap": true,
|
"showStrap": true,
|
||||||
"blocklistExposed": config.GetInstanceExposeSuspendedWeb(),
|
"blocklistExposed": config.GetInstanceExposeSuspendedWeb(),
|
||||||
|
|
|
@ -127,9 +127,8 @@ func (m *Module) confirmEmailPOSTHandler(c *gin.Context) {
|
||||||
// Serve page informing user that their
|
// Serve page informing user that their
|
||||||
// email address is now confirmed.
|
// email address is now confirmed.
|
||||||
page := apiutil.WebPage{
|
page := apiutil.WebPage{
|
||||||
Template: "confirmed_email.tmpl",
|
Template: "confirmed_email.tmpl",
|
||||||
Instance: instance,
|
Instance: instance,
|
||||||
Stylesheets: []string{instanceCustomCSSPath},
|
|
||||||
Extra: map[string]any{
|
Extra: map[string]any{
|
||||||
"email": user.Email,
|
"email": user.Email,
|
||||||
"username": user.Account.Username,
|
"username": user.Account.Username,
|
||||||
|
|
|
@ -67,7 +67,7 @@ func (m *Module) domainBlockListGETHandler(c *gin.Context) {
|
||||||
Template: "domain-blocklist.tmpl",
|
Template: "domain-blocklist.tmpl",
|
||||||
Instance: instance,
|
Instance: instance,
|
||||||
OGMeta: apiutil.OGBase(instance),
|
OGMeta: apiutil.OGBase(instance),
|
||||||
Stylesheets: []string{cssFA, instanceCustomCSSPath},
|
Stylesheets: []string{cssFA},
|
||||||
Javascript: []string{jsFrontend},
|
Javascript: []string{jsFrontend},
|
||||||
Extra: map[string]any{"blocklist": domainBlocks},
|
Extra: map[string]any{"blocklist": domainBlocks},
|
||||||
}
|
}
|
||||||
|
|
|
@ -59,7 +59,7 @@ func (m *Module) indexHandler(c *gin.Context) {
|
||||||
Template: "index.tmpl",
|
Template: "index.tmpl",
|
||||||
Instance: instance,
|
Instance: instance,
|
||||||
OGMeta: apiutil.OGBase(instance),
|
OGMeta: apiutil.OGBase(instance),
|
||||||
Stylesheets: []string{cssAbout, cssIndex, instanceCustomCSSPath},
|
Stylesheets: []string{cssAbout, cssIndex},
|
||||||
Extra: map[string]any{"showStrap": true},
|
Extra: map[string]any{"showStrap": true},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -142,7 +142,6 @@ func (m *Module) profileGETHandler(c *gin.Context) {
|
||||||
cssStatus,
|
cssStatus,
|
||||||
cssThread,
|
cssThread,
|
||||||
cssProfile,
|
cssProfile,
|
||||||
instanceCustomCSSPath,
|
|
||||||
}...,
|
}...,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -53,7 +53,6 @@ func (m *Module) SettingsPanelHandler(c *gin.Context) {
|
||||||
cssProfile, // Used for rendering stub/fake profiles.
|
cssProfile, // Used for rendering stub/fake profiles.
|
||||||
cssStatus, // Used for rendering stub/fake statuses.
|
cssStatus, // Used for rendering stub/fake statuses.
|
||||||
cssSettings,
|
cssSettings,
|
||||||
instanceCustomCSSPath,
|
|
||||||
},
|
},
|
||||||
Javascript: []string{jsSettings},
|
Javascript: []string{jsSettings},
|
||||||
}
|
}
|
||||||
|
|
|
@ -126,10 +126,9 @@ func (m *Module) signupPOSTHandler(c *gin.Context) {
|
||||||
// Serve a page informing the
|
// Serve a page informing the
|
||||||
// user that they've signed up.
|
// user that they've signed up.
|
||||||
page := apiutil.WebPage{
|
page := apiutil.WebPage{
|
||||||
Template: "signed-up.tmpl",
|
Template: "signed-up.tmpl",
|
||||||
Instance: instance,
|
Instance: instance,
|
||||||
Stylesheets: []string{instanceCustomCSSPath},
|
OGMeta: apiutil.OGBase(instance),
|
||||||
OGMeta: apiutil.OGBase(instance),
|
|
||||||
Extra: map[string]any{
|
Extra: map[string]any{
|
||||||
"email": user.UnconfirmedEmail,
|
"email": user.UnconfirmedEmail,
|
||||||
"username": user.Account.Username,
|
"username": user.Account.Username,
|
||||||
|
|
|
@ -59,7 +59,7 @@ func (m *Module) tagGETHandler(c *gin.Context) {
|
||||||
Template: "tag.tmpl",
|
Template: "tag.tmpl",
|
||||||
Instance: instance,
|
Instance: instance,
|
||||||
OGMeta: apiutil.OGBase(instance),
|
OGMeta: apiutil.OGBase(instance),
|
||||||
Stylesheets: []string{cssFA, cssThread, cssTag, instanceCustomCSSPath},
|
Stylesheets: []string{cssFA, cssThread, cssTag},
|
||||||
Extra: map[string]any{"tagName": tagName},
|
Extra: map[string]any{"tagName": tagName},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -124,7 +124,6 @@ func (m *Module) threadGETHandler(c *gin.Context) {
|
||||||
cssFA,
|
cssFA,
|
||||||
cssStatus,
|
cssStatus,
|
||||||
cssThread,
|
cssThread,
|
||||||
instanceCustomCSSPath,
|
|
||||||
}...,
|
}...,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -32,10 +32,16 @@
|
||||||
{{- range .stylesheets }}
|
{{- range .stylesheets }}
|
||||||
<link rel="preload" href="{{- . -}}" as="style">
|
<link rel="preload" href="{{- . -}}" as="style">
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
{{- if .instance.CustomCSS }}
|
||||||
|
<link rel="preload" href="/custom.css" as="style">
|
||||||
|
{{- end }}
|
||||||
<link rel="stylesheet" href="/assets/dist/_colors.css">
|
<link rel="stylesheet" href="/assets/dist/_colors.css">
|
||||||
<link rel="stylesheet" href="/assets/dist/base.css">
|
<link rel="stylesheet" href="/assets/dist/base.css">
|
||||||
<link rel="stylesheet" href="/assets/dist/page.css">
|
<link rel="stylesheet" href="/assets/dist/page.css">
|
||||||
{{- range .stylesheets }}
|
{{- range .stylesheets }}
|
||||||
<link rel="stylesheet" href="{{- . -}}">
|
<link rel="stylesheet" href="{{- . -}}">
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
{{- if .instance.CustomCSS }}
|
||||||
|
<link rel="stylesheet" href="/custom.css">
|
||||||
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
Loading…
Reference in a new issue