From 24f16ee66a25468d8901dfa18a3bb9d560bd8131 Mon Sep 17 00:00:00 2001 From: chenyifan01 Date: Tue, 25 Jan 2022 11:08:15 +0800 Subject: [PATCH 01/18] #1447 update notice --- modules/context/context.go | 10 ++++----- routers/notice/notice.go | 43 +++++++++++++++++++++++--------------- 2 files changed, 31 insertions(+), 22 deletions(-) diff --git a/modules/context/context.go b/modules/context/context.go index 6cb6c267a..25897d068 100755 --- a/modules/context/context.go +++ b/modules/context/context.go @@ -45,8 +45,8 @@ type Context struct { IsSigned bool IsBasicAuth bool - Repo *Repository - Org *Organization + Repo *Repository + Org *Organization Cloudbrain *models.Cloudbrain } @@ -347,9 +347,9 @@ func Contexter() macaron.Handler { ctx.Data["EnableSwagger"] = setting.API.EnableSwagger ctx.Data["EnableOpenIDSignIn"] = setting.Service.EnableOpenIDSignIn - notice, _ := notice.GetNewestNotice() - if notice != nil { - ctx.Data["notice"] = *notice + notices, _ := notice.GetNewestNotice() + if notices != nil { + ctx.Data["notices"] = notices } c.Map(ctx) } diff --git a/routers/notice/notice.go b/routers/notice/notice.go index f1e996e2d..5a39ee684 100644 --- a/routers/notice/notice.go +++ b/routers/notice/notice.go @@ -16,27 +16,31 @@ const ( ) type Notice struct { - Title string - Link string - Visible int //0 invisible, 1 visible + Title string + Link string + Visible int //0 invisible, 1 visible +} + +type NoticeResponse struct { + Notices []*Notice CommitId string } var lock int32 = 0 -func GetNewestNotice() (*Notice, error) { +func GetNewestNotice() (*NoticeResponse, error) { defer func() { if err := recover(); err != nil { log.Error("recover error", err) } }() - var notice *Notice + var notice *NoticeResponse var err error if setting.CacheOn { - notice, err = getNewestNoticeFromCacheAndDisk() + notice, err = getNewestNoticesFromCacheAndDisk() } else { - notice, err = getNewestNoticeFromDisk() + notice, err = getNewestNoticesFromDisk() } if err != nil { @@ -49,34 +53,39 @@ func getNoticeTimeout() time.Duration { return time.Duration(setting.CacheTimeOutSecond) * time.Second } -func getNewestNoticeFromDisk() (*Notice, error) { +func getNewestNoticesFromDisk() (*NoticeResponse, error) { log.Debug("Get notice from disk") - repoFile, err := models.ReadLatestFileInRepo(setting.UserNameOfNoticeRepo, setting.RepoNameOfNoticeRepo, setting.RefNameOfNoticeRepo, setting.TreePathOfNoticeRepo) + repo, err := models.GetRepositoryByOwnerAndAlias(setting.UserNameOfNoticeRepo, setting.RepoNameOfNoticeRepo) + if err != nil { + log.Error("get notice repo failed, error=%v", err) + return nil, err + } + repoFile, err := models.ReadLatestFileInRepo(repo.OwnerName, repo.Name, setting.RefNameOfNoticeRepo, setting.TreePathOfNoticeRepo) if err != nil { log.Error("GetNewestNotice failed, error=%v", err) return nil, err } - notice := &Notice{} - json.Unmarshal(repoFile.Content, notice) - if notice.Title == "" { + res := &NoticeResponse{} + json.Unmarshal(repoFile.Content, res) + if res == nil || len(res.Notices) == 0 { return nil, err } - notice.CommitId = repoFile.CommitId - return notice, nil + res.CommitId = repoFile.CommitId + return res, nil } -func getNewestNoticeFromCacheAndDisk() (*Notice, error) { +func getNewestNoticesFromCacheAndDisk() (*NoticeResponse, error) { v, success := noticeCache.Get(NOTICE_CACHE_KEY) if success { log.Debug("Get notice from cache,value = %v", v) if v == nil { return nil, nil } - n := v.(*Notice) + n := v.(*NoticeResponse) return n, nil } - notice, err := getNewestNoticeFromDisk() + notice, err := getNewestNoticesFromDisk() if err != nil { log.Error("GetNewestNotice failed, error=%v", err) noticeCache.Set(NOTICE_CACHE_KEY, nil, 30*time.Second) From 2be45b1f52b48ba3b33b2906f4e380ed97fc9821 Mon Sep 17 00:00:00 2001 From: ychao_1983 Date: Wed, 26 Jan 2022 11:25:51 +0800 Subject: [PATCH 02/18] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- routers/user/auth.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/routers/user/auth.go b/routers/user/auth.go index 16af84b66..b4953beb3 100755 --- a/routers/user/auth.go +++ b/routers/user/auth.go @@ -143,6 +143,7 @@ func SignIn(ctx *context.Context) { ctx.Data["Title"] = ctx.Tr("sign_in") ctx.Data["SignInLink"] = setting.AppSubURL + "/user/login" ctx.Data["PageIsSignIn"] = true + ctx.Data["IsCourse"] = ctx.QueryBool("course") ctx.Data["PageIsLogin"] = true ctx.Data["EnableSSPI"] = models.IsSSPIEnabled() ctx.Data["EnableCloudBrain"] = true @@ -565,6 +566,12 @@ func handleSignInFull(ctx *context.Context, u *models.User, remember bool, obeyR return setting.AppSubURL + "/dashboard" } + isCourse := ctx.QueryBool("course") + if isCourse { + redirectToCourse := setting.AppSubURL + "/" + setting.Course.OrgName + ctx.RedirectToFirst(redirectToCourse) + return redirectToCourse + } if redirectTo := ctx.GetCookie("redirect_to"); len(redirectTo) > 0 && !util.IsExternalURL(redirectTo) { ctx.SetCookie("redirect_to", "", -1, setting.AppSubURL, "", setting.SessionConfig.Secure, true) if obeyRedirect { From c457cae8ef911f4f2361f4d0a1e4e3ffc0e8f732 Mon Sep 17 00:00:00 2001 From: wangjr Date: Wed, 26 Jan 2022 12:46:37 +0800 Subject: [PATCH 03/18] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=8D=83=E6=A0=A1?= =?UTF-8?q?=E8=B7=B3=E8=BD=AC=E9=93=BE=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- templates/base/head_navbar.tmpl | 12 +++++++++--- templates/org/home_courses.tmpl | 7 ++----- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/templates/base/head_navbar.tmpl b/templates/base/head_navbar.tmpl index d8d9d50f2..9d63bcab5 100755 --- a/templates/base/head_navbar.tmpl +++ b/templates/base/head_navbar.tmpl @@ -215,9 +215,15 @@ {{svg "octicon-person" 16}} {{.i18n.Tr "register"}} {{end}} - - {{svg "octicon-sign-in" 16}} {{.i18n.Tr "sign_in"}} - + {{if .IsCourse}} + + {{svg "octicon-sign-in" 16}} {{.i18n.Tr "sign_in"}} + + {{else}} + + {{svg "octicon-sign-in" 16}} {{.i18n.Tr "sign_in"}} + + {{end}} {{end}} diff --git a/templates/org/home_courses.tmpl b/templates/org/home_courses.tmpl index df164bd89..bd5f0f24e 100644 --- a/templates/org/home_courses.tmpl +++ b/templates/org/home_courses.tmpl @@ -136,11 +136,8 @@ From c24e6f28c809faa29ca8e5af61943502cce1007e Mon Sep 17 00:00:00 2001 From: ychao_1983 Date: Wed, 26 Jan 2022 13:19:13 +0800 Subject: [PATCH 04/18] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- routers/user/auth.go | 1 + 1 file changed, 1 insertion(+) diff --git a/routers/user/auth.go b/routers/user/auth.go index b4953beb3..53a959f79 100755 --- a/routers/user/auth.go +++ b/routers/user/auth.go @@ -183,6 +183,7 @@ func SignInPost(ctx *context.Context, form auth.SignInForm) { ctx.Data["SignInLink"] = setting.AppSubURL + "/user/login" ctx.Data["PageIsSignIn"] = true ctx.Data["PageIsLogin"] = true + ctx.Data["IsCourse"] = ctx.QueryBool("course") ctx.Data["EnableSSPI"] = models.IsSSPIEnabled() if ctx.HasError() { From 8f2a1c6df24f2c70591ca2df9dca6a7c922744d9 Mon Sep 17 00:00:00 2001 From: wangjr Date: Wed, 26 Jan 2022 15:24:58 +0800 Subject: [PATCH 05/18] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=82=B9=E5=87=BB?= =?UTF-8?q?=E6=8C=89=E9=92=AE=E8=B7=B3=E8=BD=AC=E5=B9=B3=E5=8F=B0=E7=BB=9D?= =?UTF-8?q?=E5=AF=B9=E8=B7=AF=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- templates/base/head_navbar.tmpl | 4 ++-- templates/org/home_courses.tmpl | 5 ++--- templates/user/auth/signin_inner.tmpl | 6 +++++- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/templates/base/head_navbar.tmpl b/templates/base/head_navbar.tmpl index 9d63bcab5..95fff82c3 100755 --- a/templates/base/head_navbar.tmpl +++ b/templates/base/head_navbar.tmpl @@ -216,11 +216,11 @@ {{end}} {{if .IsCourse}} - + {{svg "octicon-sign-in" 16}} {{.i18n.Tr "sign_in"}} {{else}} - + {{svg "octicon-sign-in" 16}} {{.i18n.Tr "sign_in"}} {{end}} diff --git a/templates/org/home_courses.tmpl b/templates/org/home_courses.tmpl index bd5f0f24e..771b0169b 100644 --- a/templates/org/home_courses.tmpl +++ b/templates/org/home_courses.tmpl @@ -136,8 +136,7 @@ @@ -206,7 +205,7 @@ {{if .IsSigned}} {{.i18n.Tr "org.teams.join_teams"}} {{else}} - {{.i18n.Tr "org.teams.join_teams"}} + {{.i18n.Tr "org.teams.join_teams"}} {{end}} diff --git a/templates/user/auth/signin_inner.tmpl b/templates/user/auth/signin_inner.tmpl index a827bde9e..bdcd6a5c6 100644 --- a/templates/user/auth/signin_inner.tmpl +++ b/templates/user/auth/signin_inner.tmpl @@ -29,7 +29,11 @@
-
+ {{if .IsCourse}} + + {{else}} + + {{end}} {{.CsrfTokenHtml}}
From 72599d3e6dc02e7acc2c0c1b58aac3870974ffe9 Mon Sep 17 00:00:00 2001 From: wangjr Date: Wed, 26 Jan 2022 15:44:21 +0800 Subject: [PATCH 06/18] =?UTF-8?q?=E5=8D=83=E6=A0=A1=E6=B3=A8=E5=86=8C?= =?UTF-8?q?=E7=99=BB=E5=BD=95=E7=BB=9D=E5=AF=B9=E5=9F=9F=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- templates/base/head_navbar.tmpl | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/templates/base/head_navbar.tmpl b/templates/base/head_navbar.tmpl index 95fff82c3..4e9d265c8 100755 --- a/templates/base/head_navbar.tmpl +++ b/templates/base/head_navbar.tmpl @@ -211,9 +211,15 @@
{{if .ShowRegistrationButton}} - - {{svg "octicon-person" 16}} {{.i18n.Tr "register"}} - + {{if .IsCourse}} + + {{svg "octicon-person" 16}} {{.i18n.Tr "register"}} + + {{else}} + + {{svg "octicon-person" 16}} {{.i18n.Tr "register"}} + + {{end}} {{end}} {{if .IsCourse}} From 1cd3237dedbe66cd7f866782314b1cd4ad22fd57 Mon Sep 17 00:00:00 2001 From: wangjr Date: Wed, 26 Jan 2022 16:33:03 +0800 Subject: [PATCH 07/18] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- templates/base/head.tmpl | 9 ++++++--- web_src/less/openi.less | 7 +++++-- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/templates/base/head.tmpl b/templates/base/head.tmpl index 859cacb62..2ffeec68c 100755 --- a/templates/base/head.tmpl +++ b/templates/base/head.tmpl @@ -202,11 +202,14 @@ var _hmt = _hmt || [];
diff --git a/web_src/less/openi.less b/web_src/less/openi.less index 39789d9d9..fd047ab30 100644 --- a/web_src/less/openi.less +++ b/web_src/less/openi.less @@ -604,10 +604,13 @@ display: block; font-weight: bold !important; } .a_width{ - width: 50% !important; + // width: 50% !important; + margin-right: 20em; display:inline-block !important; } - +.a_width i{ + vertical-align:middle; +} .footer_icon{ display: inline-block !important; vertical-align: middle !important; From 384553751756128b3cfd7b1879c144232a9076c1 Mon Sep 17 00:00:00 2001 From: ychao_1983 Date: Wed, 26 Jan 2022 16:33:52 +0800 Subject: [PATCH 08/18] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- routers/user/auth.go | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/routers/user/auth.go b/routers/user/auth.go index 53a959f79..2459602e7 100755 --- a/routers/user/auth.go +++ b/routers/user/auth.go @@ -116,8 +116,18 @@ func checkAutoLogin(ctx *context.Context) bool { } if isSucceed { - ctx.SetCookie("redirect_to", "", -1, setting.AppSubURL, "", setting.SessionConfig.Secure, true) - ctx.RedirectToFirst(redirectTo, setting.AppSubURL+string(setting.LandingPageURL)) + + isCourse := ctx.QueryBool("course") + if isCourse { + ctx.SetCookie("redirect_to", "", -1, setting.AppSubURL, "", setting.SessionConfig.Secure, true) + redirectToCourse := setting.AppSubURL + "/" + setting.Course.OrgName + ctx.RedirectToFirst(redirectToCourse) + + } else { + ctx.SetCookie("redirect_to", "", -1, setting.AppSubURL, "", setting.SessionConfig.Secure, true) + ctx.RedirectToFirst(redirectTo, setting.AppSubURL+string(setting.LandingPageURL)) + + } return true } From 36e7f266f1bd0f4909d59e54d543a284ab11eb92 Mon Sep 17 00:00:00 2001 From: ychao_1983 Date: Wed, 26 Jan 2022 16:42:25 +0800 Subject: [PATCH 09/18] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- routers/user/auth.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/routers/user/auth.go b/routers/user/auth.go index 2459602e7..a02cf24dc 100755 --- a/routers/user/auth.go +++ b/routers/user/auth.go @@ -118,13 +118,11 @@ func checkAutoLogin(ctx *context.Context) bool { if isSucceed { isCourse := ctx.QueryBool("course") - if isCourse { - ctx.SetCookie("redirect_to", "", -1, setting.AppSubURL, "", setting.SessionConfig.Secure, true) + ctx.SetCookie("redirect_to", "", -1, setting.AppSubURL, "", setting.SessionConfig.Secure, true) + if redirectTo == "" && isCourse { redirectToCourse := setting.AppSubURL + "/" + setting.Course.OrgName ctx.RedirectToFirst(redirectToCourse) - } else { - ctx.SetCookie("redirect_to", "", -1, setting.AppSubURL, "", setting.SessionConfig.Secure, true) ctx.RedirectToFirst(redirectTo, setting.AppSubURL+string(setting.LandingPageURL)) } From 83c2a080ae4bcb643004a9695afa9f52727db39d Mon Sep 17 00:00:00 2001 From: wangjr Date: Wed, 26 Jan 2022 16:43:13 +0800 Subject: [PATCH 10/18] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=8D=83=E6=A0=A1?= =?UTF-8?q?=E5=8A=A0=E5=85=A5=E7=BB=84=E7=BB=87=E7=9A=84=E6=9C=AA=E7=99=BB?= =?UTF-8?q?=E5=BD=95=E8=B7=B3=E8=BD=AC=E9=93=BE=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- templates/org/home_courses.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/org/home_courses.tmpl b/templates/org/home_courses.tmpl index 771b0169b..dd287c87f 100644 --- a/templates/org/home_courses.tmpl +++ b/templates/org/home_courses.tmpl @@ -205,7 +205,7 @@ {{if .IsSigned}} {{.i18n.Tr "org.teams.join_teams"}} {{else}} - {{.i18n.Tr "org.teams.join_teams"}} + {{.i18n.Tr "org.teams.join_teams"}} {{end}}
From 32b80f365957cf3f452eb1e2f49b50546f41f893 Mon Sep 17 00:00:00 2001 From: ychao_1983 Date: Wed, 26 Jan 2022 17:44:36 +0800 Subject: [PATCH 11/18] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/context/auth.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/context/auth.go b/modules/context/auth.go index 9877657eb..61a7b029b 100755 --- a/modules/context/auth.go +++ b/modules/context/auth.go @@ -64,6 +64,11 @@ func Toggle(options *ToggleOptions) macaron.Handler { ctx.Redirect(setting.AppSubURL + "/") return } + + if ctx.QueryBool("course") { + ctx.Redirect(setting.AppSubURL + "/" + setting.Course.OrgName) + return + } } // Redirect to dashboard if user tries to visit any non-login page. From ee46a3122eaed40515dbac19330b9b9d10199c5f Mon Sep 17 00:00:00 2001 From: wangjr Date: Thu, 27 Jan 2022 10:08:30 +0800 Subject: [PATCH 12/18] =?UTF-8?q?=E6=9B=B4=E6=94=B9=E5=A4=9A=E5=85=AC?= =?UTF-8?q?=E5=91=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- templates/base/head.tmpl | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/templates/base/head.tmpl b/templates/base/head.tmpl index 2ffeec68c..7a2fce2aa 100755 --- a/templates/base/head.tmpl +++ b/templates/base/head.tmpl @@ -201,12 +201,15 @@ var _hmt = _hmt || []; {{template "base/head_navbar" .}} - @@ -232,7 +225,15 @@ var _hmt = _hmt || []; }else{ isNewNotice=false; } - if (JSON.parse("{{.notice.Visible}}")){ + let isShowNoticeTag = false; + let notices= {{.notices.Notices}} + for (i =0;i {{template "base/head_navbar" .}} - + {{template "base/head_notice" .}} {{end}} {{/* @@ -236,7 +229,15 @@ var _hmt = _hmt || []; }else{ isNewNotice=false; } - if (JSON.parse("{{.notice.Visible}}")){ + let isShowNoticeTag = false; + let notices= {{.notices.Notices}} + for (i =0;i +
+ + {{range .notices.Notices}} + + {{if eq .Visible 1}} + + {{.Title}} + {{end}} + + {{end}} + + +
+ +
+
+ + + {{end}} +{{end}} \ No newline at end of file diff --git a/templates/base/head_pro.tmpl b/templates/base/head_pro.tmpl index e6dbfc03e..85719cf9b 100644 --- a/templates/base/head_pro.tmpl +++ b/templates/base/head_pro.tmpl @@ -201,14 +201,7 @@ var _hmt = _hmt || []; - + {{template "base/head_notice" .}} {{end}} {{/* @@ -233,7 +226,15 @@ var _hmt = _hmt || []; }else{ isNewNotice=false; } - if (JSON.parse("{{.notice.Visible}}")){ + let isShowNoticeTag = false; + let notices= {{.notices.Notices}} + for (i =0;i Date: Thu, 27 Jan 2022 15:44:26 +0800 Subject: [PATCH 15/18] =?UTF-8?q?=E5=B9=BF=E5=91=8A=E9=93=BE=E6=8E=A5?= =?UTF-8?q?=E8=B7=B3=E8=BD=AC=E6=96=B0=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- templates/base/head_notice.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/base/head_notice.tmpl b/templates/base/head_notice.tmpl index b9ca7ae17..6c52426bc 100644 --- a/templates/base/head_notice.tmpl +++ b/templates/base/head_notice.tmpl @@ -4,7 +4,7 @@
{{range .notices.Notices}} - + {{if eq .Visible 1}} {{.Title}} From ef05d62aa624b2d64078edda7a23345aa9908b4e Mon Sep 17 00:00:00 2001 From: wangjr Date: Thu, 27 Jan 2022 16:03:57 +0800 Subject: [PATCH 16/18] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=A0=87=E7=AD=BE?= =?UTF-8?q?=E9=BC=A0=E6=A0=87=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- templates/org/course_list.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/org/course_list.tmpl b/templates/org/course_list.tmpl index a4d140e46..310676b90 100644 --- a/templates/org/course_list.tmpl +++ b/templates/org/course_list.tmpl @@ -96,7 +96,7 @@ {{if .Topics }}
{{range .Topics}} - {{if ne . "" }}{{.}}{{end}} + {{if ne . "" }}{{.}}{{end}} {{end}}
From 8d5d8fb5d36d89c684f245b3b6c2e2ba89886d1d Mon Sep 17 00:00:00 2001 From: wangjr Date: Thu, 27 Jan 2022 17:13:05 +0800 Subject: [PATCH 17/18] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=BA0=E6=97=B6?= =?UTF-8?q?=EF=BC=8C=E5=86=85=E5=AE=B9=E4=B8=8D=E5=8D=A0=E4=BD=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- templates/base/head_notice.tmpl | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/templates/base/head_notice.tmpl b/templates/base/head_notice.tmpl index 6c52426bc..2880b494d 100644 --- a/templates/base/head_notice.tmpl +++ b/templates/base/head_notice.tmpl @@ -4,12 +4,13 @@
{{range .notices.Notices}} - - {{if eq .Visible 1}} + {{if eq .Visible 1}} + {{.Title}} - {{end}} - + + {{end}} + {{end}} From c4a3d828684e5105b1c09973618bb5f3233b4c89 Mon Sep 17 00:00:00 2001 From: wangjr Date: Thu, 27 Jan 2022 17:44:16 +0800 Subject: [PATCH 18/18] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=85=AC=E5=91=8A?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- templates/base/head_notice.tmpl | 18 +++++++++++++----- web_src/less/openi.less | 2 +- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/templates/base/head_notice.tmpl b/templates/base/head_notice.tmpl index 2880b494d..88615cc38 100644 --- a/templates/base/head_notice.tmpl +++ b/templates/base/head_notice.tmpl @@ -3,14 +3,22 @@
+ {{ $firstTag := true }} {{range .notices.Notices}} {{if eq .Visible 1}} - - - {{.Title}} - + {{if $firstTag}} + + + {{.Title}} + + {{else}} + + + {{.Title}} + + {{end}} + {{ $firstTag = false }} {{end}} - {{end}} diff --git a/web_src/less/openi.less b/web_src/less/openi.less index a4a812cce..1d165dda8 100644 --- a/web_src/less/openi.less +++ b/web_src/less/openi.less @@ -605,7 +605,7 @@ display: block; } .a_width{ // width: 50% !important; - margin-right: 20em; + margin-left: 20em; // display:inline-block !important; } .a_width i{