diff --git a/bskyweb/cmd/bskyweb/server.go b/bskyweb/cmd/bskyweb/server.go index 672e8d25eb..f0cd72b153 100644 --- a/bskyweb/cmd/bskyweb/server.go +++ b/bskyweb/cmd/bskyweb/server.go @@ -394,6 +394,7 @@ func (srv *Server) Shutdown() error { func (srv *Server) NewTemplateContext() pongo2.Context { return pongo2.Context{ "staticCDNHost": srv.cfg.staticCDNHost, + "favicon": fmt.Sprintf("%s/static/favicon.png", srv.cfg.staticCDNHost), } } @@ -599,13 +600,16 @@ func (srv *Server) WebProfile(c echo.Context) error { unauthedViewingOkay = false } } - if !unauthedViewingOkay { - return c.Render(http.StatusOK, "profile.html", data) - } + req := c.Request() data["profileView"] = pv data["requestURI"] = fmt.Sprintf("https://%s%s", req.Host, req.URL.Path) data["requestHost"] = req.Host + + if !unauthedViewingOkay { + data["requiresAuth"] = true + } + return c.Render(http.StatusOK, "profile.html", data) } diff --git a/bskyweb/templates/base.html b/bskyweb/templates/base.html index c8dec0e22a..0bde22e77c 100644 --- a/bskyweb/templates/base.html +++ b/bskyweb/templates/base.html @@ -95,6 +95,7 @@ + diff --git a/bskyweb/templates/profile.html b/bskyweb/templates/profile.html index 8506a9cff7..cc33ed5318 100644 --- a/bskyweb/templates/profile.html +++ b/bskyweb/templates/profile.html @@ -9,36 +9,48 @@ {% endblock %} {% block html_head_extra -%} -{%- if profileView -%} - - {%- if requestURI %} +{%- if requestURI %} - {% endif -%} +{% endif -%} + +{%- if profileView -%} + {%- if profileView.DisplayName %} {% else %} {% endif -%} - {%- if profileView.Description %} - - - {% endif -%} - {%- if profileView.Banner %} - - - {%- elif profileView.Avatar -%} - {# Don't use avatar image in cards; usually looks bad #} - - {% endif %} + + + + {%- if requestHost %} {% endif %} - + + {# Only show details if auth isn't required #} + {% if not requiresAuth %} + {%- if profileView.Description %} + + + {% endif -%} + {%- if profileView.Banner %} + + + {%- elif profileView.Avatar -%} + {# Don't use avatar image in cards; usually looks bad #} + + {% endif %} + {% else %} + + + + {% endif %} {% endif -%} {%- endblock %}