From 11495623c59597e4e03db61c10f9384641736b42 Mon Sep 17 00:00:00 2001 From: chenshihai Date: Mon, 19 Dec 2022 17:39:03 +0800 Subject: [PATCH 1/3] =?UTF-8?q?#3313=20=E5=8F=91=E5=B8=83=E6=96=B0?= =?UTF-8?q?=E7=89=88=E6=9C=AC=E7=9A=84=E6=97=B6=E5=80=99=E4=B8=8D=E7=94=A8?= =?UTF-8?q?=E6=B8=85=E7=A9=BA=E7=BC=93=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- custom/public/css/placeholder.css | 1 + custom/public/js/placeholder.js | 1 + modules/templates/helper.go | 2 ++ templates/base/footer.tmpl | 18 ++++++++--------- templates/base/footer_fluid.tmpl | 14 +++++++------- templates/base/head.tmpl | 20 +++++++++---------- templates/base/head_course.tmpl | 20 +++++++++---------- templates/base/head_fluid.tmpl | 20 +++++++++---------- templates/base/head_home.tmpl | 28 +++++++++++++-------------- templates/base/head_pro.tmpl | 20 +++++++++---------- templates/custom/header.tmpl | 2 ++ templates/explore/organizations.tmpl | 8 ++++---- templates/explore/repo_orgtop.tmpl | 4 ++-- templates/explore/search_new.tmpl | 2 +- templates/home.tmpl | 2 +- templates/repo/cloudbrain/trainjob/show.tmpl | 6 +++--- templates/repo/datasets/dirs/dir_list.tmpl | 2 +- templates/repo/datasets/dirs/dir_preview.tmpl | 2 +- templates/repo/datasets/label/index.tmpl | 2 +- templates/repo/grampus/trainjob/show.tmpl | 6 +++--- templates/repo/header.tmpl | 22 ++++++++++----------- templates/repo/issue/view_content/pull.tmpl | 2 +- templates/repo/modelarts/trainjob/show.tmpl | 6 +++--- templates/repo/modelmanage/create_online.tmpl | 6 +++--- templates/repo/modelmanage/index.tmpl | 6 +++--- 25 files changed, 114 insertions(+), 108 deletions(-) create mode 100644 custom/public/css/placeholder.css create mode 100644 custom/public/js/placeholder.js diff --git a/custom/public/css/placeholder.css b/custom/public/css/placeholder.css new file mode 100644 index 000000000..1ae0f997e --- /dev/null +++ b/custom/public/css/placeholder.css @@ -0,0 +1 @@ +/* placeholder.css */ diff --git a/custom/public/js/placeholder.js b/custom/public/js/placeholder.js new file mode 100644 index 000000000..e2c4bcff7 --- /dev/null +++ b/custom/public/js/placeholder.js @@ -0,0 +1 @@ +/* placeholder.js */ diff --git a/modules/templates/helper.go b/modules/templates/helper.go index c314127f1..001e1e478 100755 --- a/modules/templates/helper.go +++ b/modules/templates/helper.go @@ -102,6 +102,7 @@ func NewFuncMap() []template.FuncMap { "SafeJS": SafeJS, "Str2html": Str2html, "subOne": subOne, + "TimeStampNow": timeutil.TimeStampNow, "TimeSince": timeutil.TimeSince, "TimeSinceUnix": timeutil.TimeSinceUnix, "TimeSinceUnix1": timeutil.TimeSinceUnix1, @@ -361,6 +362,7 @@ func NewTextFuncMap() []texttmpl.FuncMap { "AppDomain": func() string { return setting.Domain }, + "TimeStampNow": timeutil.TimeStampNow, "TimeSince": timeutil.TimeSince, "TimeSinceUnix": timeutil.TimeSinceUnix, "TimeSinceUnix1": timeutil.TimeSinceUnix1, diff --git a/templates/base/footer.tmpl b/templates/base/footer.tmpl index 738578a8a..d652f3ab1 100755 --- a/templates/base/footer.tmpl +++ b/templates/base/footer.tmpl @@ -17,9 +17,9 @@ {{if .RequireSimpleMDE}} - - - + + + @@ -27,10 +27,10 @@ {{if .RequireMinicolors}} - + {{end}} {{if .RequireU2F}} - + {{end}} {{if .EnableCaptcha}} {{if eq .CaptchaType "recaptcha"}} @@ -38,17 +38,17 @@ {{end}} {{end}} {{if .RequireTribute}} - + {{end}} {{if .PageIsHome}} - + {{end}} {{template "custom/footer" .}} {{if .PageIsHome}} - - + + {{if .RequireSimpleMDE}} - - - + + + @@ -24,10 +24,10 @@ {{if .RequireMinicolors}} - + {{end}} {{if .RequireU2F}} - + {{end}} {{if .EnableCaptcha}} {{if eq .CaptchaType "recaptcha"}} @@ -35,10 +35,10 @@ {{end}} {{end}} {{if .RequireTribute}} - + {{end}} {{if .PageIsHome}} - + {{end}} diff --git a/templates/base/head.tmpl b/templates/base/head.tmpl index f4766bc9d..113813c09 100755 --- a/templates/base/head.tmpl +++ b/templates/base/head.tmpl @@ -5,7 +5,7 @@ {{if .Title}}{{.Title}} - {{end}} {{if .Repository.Name}}{{.Repository.Name}} - {{end}}{{AppName}} - + {{if UseServiceWorker}} - - - - + + + + {{if .RequireSimpleMDE}} - + {{end}} {{if .RequireTribute}} - + {{end}} @@ -137,7 +137,7 @@ {{if .RequireMinicolors}} - + {{end}} {{if .PageIsUserProfile}} @@ -179,7 +179,7 @@ {{else if ne DefaultTheme "gitea"}} {{end}} - + {{template "custom/header" .}} - + {{template "custom/body_outer_pre" .}} diff --git a/templates/base/head_course.tmpl b/templates/base/head_course.tmpl index fe21a0e05..ac5a849d2 100644 --- a/templates/base/head_course.tmpl +++ b/templates/base/head_course.tmpl @@ -5,7 +5,7 @@ {{if .Title}}{{.Title}} - {{end}} {{if .Repository.Name}}{{.Repository.Name}} - {{end}}{{AppName}} - + {{if UseServiceWorker}} - - - - + + + + {{if .RequireSimpleMDE}} - + {{end}} {{if .RequireTribute}} - + {{end}} @@ -137,7 +137,7 @@ {{if .RequireMinicolors}} - + {{end}} {{if .PageIsUserProfile}} @@ -179,7 +179,7 @@ {{else if ne DefaultTheme "gitea"}} {{end}} - + {{template "custom/header" .}} - + {{template "custom/body_outer_pre" .}} diff --git a/templates/base/head_fluid.tmpl b/templates/base/head_fluid.tmpl index 1c16e7140..851509861 100644 --- a/templates/base/head_fluid.tmpl +++ b/templates/base/head_fluid.tmpl @@ -5,7 +5,7 @@ {{if .Title}}{{.Title}} - {{end}} {{if .Repository.Name}}{{.Repository.Name}} - {{end}}{{AppName}} - + {{if UseServiceWorker}} - - - - + + + + {{if .RequireSimpleMDE}} - + {{end}} {{if .RequireTribute}} - + {{end}} @@ -137,7 +137,7 @@ {{if .RequireMinicolors}} - + {{end}} {{if .PageIsUserProfile}} @@ -179,7 +179,7 @@ {{else if ne DefaultTheme "gitea"}} {{end}} - + {{template "custom/header" .}} - + diff --git a/templates/base/head_home.tmpl b/templates/base/head_home.tmpl index 6456e2a4a..77a0fcc55 100644 --- a/templates/base/head_home.tmpl +++ b/templates/base/head_home.tmpl @@ -5,7 +5,7 @@ {{if .Title}}{{.Title}} - {{end}} {{if .Repository.Name}}{{.Repository.Name}} - {{end}}{{AppName}} - + {{if UseServiceWorker}} - - - - + + + + - + {{if .RequireSimpleMDE}} - + {{end}} {{if .RequireTribute}} - + {{end}} @@ -138,7 +138,7 @@ {{if .RequireMinicolors}} - + {{end}} {{if .PageIsUserProfile}} @@ -191,14 +191,14 @@ var _hmt = _hmt || []; s.parentNode.insertBefore(hm, s); })(); - + - + - - + + - + {{template "custom/body_outer_pre" .}} diff --git a/templates/base/head_pro.tmpl b/templates/base/head_pro.tmpl index c643ea873..b1f7501f8 100644 --- a/templates/base/head_pro.tmpl +++ b/templates/base/head_pro.tmpl @@ -5,7 +5,7 @@ {{if .Title}}{{.Title}} - {{end}} {{if .Repository.Name}}{{.Repository.Name}} - {{end}}{{AppName}} - + {{if UseServiceWorker}} - - - - + + + + {{if .RequireSimpleMDE}} - + {{end}} {{if .RequireTribute}} - + {{end}} @@ -137,7 +137,7 @@ {{if .RequireMinicolors}} - + {{end}} {{if .PageIsUserProfile}} @@ -179,7 +179,7 @@ {{else if ne DefaultTheme "gitea"}} {{end}} - + {{template "custom/header" .}} - + diff --git a/templates/custom/header.tmpl b/templates/custom/header.tmpl index e69de29bb..cbc5f7e8f 100644 --- a/templates/custom/header.tmpl +++ b/templates/custom/header.tmpl @@ -0,0 +1,2 @@ + + diff --git a/templates/explore/organizations.tmpl b/templates/explore/organizations.tmpl index 5faf039af..dad7dfc93 100644 --- a/templates/explore/organizations.tmpl +++ b/templates/explore/organizations.tmpl @@ -1,8 +1,8 @@ - - - - + + + + {{template "base/head" .}}
diff --git a/templates/explore/repo_orgtop.tmpl b/templates/explore/repo_orgtop.tmpl index bba16dd47..17d02189f 100755 --- a/templates/explore/repo_orgtop.tmpl +++ b/templates/explore/repo_orgtop.tmpl @@ -1,5 +1,5 @@ - - + + - + @@ -266,8 +266,8 @@ {{template "base/footer" .}} - - + +
{{template "custom/home/home_top" .}}
From 085030a171f9349af1f7329f98261832c39c4b47 Mon Sep 17 00:00:00 2001 From: chenshihai Date: Tue, 10 Jan 2023 11:10:51 +0800 Subject: [PATCH 3/3] update --- modules/templates/helper.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/templates/helper.go b/modules/templates/helper.go index bb2ebc1a1..ce8c5dfe7 100755 --- a/modules/templates/helper.go +++ b/modules/templates/helper.go @@ -106,8 +106,8 @@ func NewFuncMap() []template.FuncMap { "SafeJS": SafeJS, "Str2html": Str2html, "subOne": subOne, - "addOne": addOne, - "TimeStampNow": timeutil.TimeStampNow, + "addOne": addOne, + "TimeStampNow": timeutil.TimeStampNow, "TimeSince": timeutil.TimeSince, "TimeSinceUnix": timeutil.TimeSinceUnix, "TimeSinceUnix1": timeutil.TimeSinceUnix1,