diff options
author | 2023-12-27 11:23:52 +0100 | |
---|---|---|
committer | 2023-12-27 11:23:52 +0100 | |
commit | 0ff52b71f2c0e970b1f0d43793c019bbed93e112 (patch) | |
tree | eff120472b4b6f837121536ada03f530d213b13e /internal/web/web.go | |
parent | [bugfix] :innocent: (#2476) (diff) | |
download | gotosocial-0ff52b71f2c0e970b1f0d43793c019bbed93e112.tar.xz |
[chore] Refactor HTML templates and CSS (#2480)
* [chore] Refactor HTML templates and CSS
* eslint
* ignore "Local"
* rss tests
* fiddle with OG just a tiny bit
* dick around with polls a bit more so SR stops saying "clickable"
* remove break
* oh lord
* don't lazy load avatar
* fix ogmeta tests
* clean up some cruft
* catch remaining calls to c.HTML
* fix error rendering + stack overflow in tag
* allow templating attributes
* fix indent
* set aria-hidden on status complementary content, since it's already present in the label anyway
* tidy up templating calls a little
* try to make styling a bit more consistent + readable
* fix up some remaining CSS issues
* fix up reports
Diffstat (limited to 'internal/web/web.go')
-rw-r--r-- | internal/web/web.go | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/internal/web/web.go b/internal/web/web.go index 86e74d6f8..5e57d08c6 100644 --- a/internal/web/web.go +++ b/internal/web/web.go @@ -37,7 +37,7 @@ import ( const ( confirmEmailPath = "/" + uris.ConfirmEmailPath - profileGroupPath = "/@:" + usernameKey + profileGroupPath = "/@:username" statusPath = "/statuses/:" + apiutil.WebStatusIDKey // leave out the '/@:username' prefix as this will be served within the profile group tagsPath = "/tags/:" + apiutil.TagNameKey customCSSPath = profileGroupPath + "/custom.css" @@ -49,15 +49,24 @@ const ( userPanelPath = settingsPathPrefix + "/user" adminPanelPath = settingsPathPrefix + "/admin" - tokenParam = "token" - usernameKey = "username" - cacheControlHeader = "Cache-Control" // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control cacheControlNoCache = "no-cache" // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#response_directives ifModifiedSinceHeader = "If-Modified-Since" // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Modified-Since ifNoneMatchHeader = "If-None-Match" // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-None-Match eTagHeader = "ETag" // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/ETag lastModifiedHeader = "Last-Modified" // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Last-Modified + + cssFA = assetsPathPrefix + "/Fork-Awesome/css/fork-awesome.min.css" + cssAbout = distPathPrefix + "/about.css" + cssIndex = distPathPrefix + "/index.css" + cssStatus = distPathPrefix + "/status.css" + cssThread = distPathPrefix + "/thread.css" + cssProfile = distPathPrefix + "/profile.css" + cssSettings = distPathPrefix + "/settings-style.css" + cssTag = distPathPrefix + "/tag.css" + + jsFrontend = distPathPrefix + "/frontend.js" // Progressive enhancement frontend JS. + jsSettings = distPathPrefix + "/settings.js" // Settings panel React application. ) type Module struct { @@ -99,7 +108,7 @@ func (m *Module) Route(r *router.Router, mi ...gin.HandlerFunc) { profileGroup.Handle(http.MethodGet, statusPath, m.threadGETHandler) // Attach individual web handlers which require no specific middlewares - r.AttachHandler(http.MethodGet, "/", m.baseHandler) // front-page + r.AttachHandler(http.MethodGet, "/", m.indexHandler) // front-page r.AttachHandler(http.MethodGet, settingsPathPrefix, m.SettingsPanelHandler) r.AttachHandler(http.MethodGet, settingsPanelGlob, m.SettingsPanelHandler) r.AttachHandler(http.MethodGet, customCSSPath, m.customCSSGETHandler) |