aboutsummaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorwxiaoguang <wxiaoguang@gmail.com>2021-10-15 10:35:26 +0800
committerGitHub <noreply@github.com>2021-10-15 10:35:26 +0800
commit56362043d35d2542c6fe4ac7c0ac5aabb833a9ed (patch)
treed3dd12505e7dd1b2d854c61384e1088f6901bab6 /modules
parent96ff3e310f0ba1e94f4e8206758b583719a9b46c (diff)
downloadgitea-56362043d35d2542c6fe4ac7c0ac5aabb833a9ed.tar.gz
gitea-56362043d35d2542c6fe4ac7c0ac5aabb833a9ed.zip
Frontend refactor: move Vue related code from `index.js` to `components` dir, and remove unused codes. (#17301)
* frontend refactor * Apply suggestions from code review Co-authored-by: delvh <dev.lh@web.de> * Update templates/base/head.tmpl Co-authored-by: delvh <dev.lh@web.de> * Update docs/content/doc/developers/guidelines-frontend.md Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> * fix typo * fix typo * refactor PageData to pageData * Apply suggestions from code review Co-authored-by: delvh <dev.lh@web.de> * Simply for the visual difference. Co-authored-by: delvh <dev.lh@web.de> * Revert "Apply suggestions from code review" This reverts commit 4d78ad9b0e96ca180e0823de17659a2e0814c099. Co-authored-by: delvh <dev.lh@web.de> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: 6543 <6543@obermui.de>
Diffstat (limited to 'modules')
-rw-r--r--modules/context/context.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/modules/context/context.go b/modules/context/context.go
index 29f52c53cd..6bd934928e 100644
--- a/modules/context/context.go
+++ b/modules/context/context.go
@@ -51,7 +51,7 @@ type Context struct {
Resp ResponseWriter
Req *http.Request
Data map[string]interface{} // data used by MVC templates
- PageData map[string]interface{} // data used by JavaScript modules in one page
+ PageData map[string]interface{} // data used by JavaScript modules in one page, it's `window.config.pageData`
Render Render
translation.Locale
Cache cache.Cache
@@ -645,9 +645,10 @@ func Contexter() func(next http.Handler) http.Handler {
"CurrentURL": setting.AppSubURL + req.URL.RequestURI(),
"PageStartTime": startTime,
"Link": link,
+ "IsProd": setting.IsProd(),
},
}
- // PageData is passed by reference, and it will be rendered to `window.config.PageData` in `head.tmpl` for JavaScript modules
+ // PageData is passed by reference, and it will be rendered to `window.config.pageData` in `head.tmpl` for JavaScript modules
ctx.PageData = map[string]interface{}{}
ctx.Data["PageData"] = ctx.PageData