Browse Source

Merge pull request 'fix 1747' (#1748) from wangjr_0328 into V20220328

Reviewed-on: https://git.openi.org.cn/OpenI/aiforge/pulls/1748
Reviewed-by: lewis <747342561@qq.com>
tags/v1.22.3.2^2
lewis 3 years ago
parent
commit
b8d5e2a6f2
5 changed files with 18 additions and 14 deletions
  1. +6
    -2
      models/repo.go
  2. +3
    -3
      templates/base/head.tmpl
  3. +3
    -3
      templates/base/head_fluid.tmpl
  4. +3
    -3
      templates/base/head_home.tmpl
  5. +3
    -3
      templates/base/head_pro.tmpl

+ 6
- 2
models/repo.go View File

@@ -2715,7 +2715,7 @@ func ReadLatestFileInRepo(userName, repoName, refName, treePath string) (*RepoFi
log.Error("ReadLatestFileInRepo error when OpenRepository,error=%v", err)
return nil, err
}
commitID, err := gitRepo.GetBranchCommitID(refName)
_, err = gitRepo.GetBranchCommitID(refName)
if err != nil {
log.Error("ReadLatestFileInRepo error when GetBranchCommitID,error=%v", err)
return nil, err
@@ -2747,5 +2747,9 @@ func ReadLatestFileInRepo(userName, repoName, refName, treePath string) (*RepoFi
if n >= 0 {
buf = buf[:n]
}
return &RepoFile{CommitId: commitID, Content: buf}, nil
commitId := ""
if blob != nil {
commitId = fmt.Sprint(blob.ID)
}
return &RepoFile{CommitId: commitId, Content: buf}, nil
}

+ 3
- 3
templates/base/head.tmpl View File

@@ -215,10 +215,10 @@ var _hmt = _hmt || [];
localStorage.setItem("isCloseNotice",true)
}
function isShowNotice(){
var current_notice = localStorage.getItem("notice")
var current_notice = localStorage.getItem("notices")

if (current_notice != "{{.notice.CommitId}}"){
localStorage.setItem('notice',"{{.notice.CommitId}}");
if (current_notice != "{{.notices.CommitId}}"){
localStorage.setItem('notices',"{{.notices.CommitId}}");
isNewNotice=true;
localStorage.setItem("isCloseNotice",false)
}else{


+ 3
- 3
templates/base/head_fluid.tmpl View File

@@ -216,10 +216,10 @@ var _hmt = _hmt || [];
localStorage.setItem("isCloseNotice",true)
}
function isShowNotice(){
var current_notice = localStorage.getItem("notice")
var current_notice = localStorage.getItem("notices")

if (current_notice != "{{.notice.CommitId}}"){
localStorage.setItem('notice',"{{.notice.CommitId}}");
if (current_notice != "{{.notices.CommitId}}"){
localStorage.setItem('notices',"{{.notices.CommitId}}");
isNewNotice=true;
localStorage.setItem("isCloseNotice",false)
}else{


+ 3
- 3
templates/base/head_home.tmpl View File

@@ -220,10 +220,10 @@ var _hmt = _hmt || [];
localStorage.setItem("isCloseNotice",true)
}
function isShowNotice(){
var current_notice = localStorage.getItem("notice")
var current_notice = localStorage.getItem("notices")

if (current_notice != "{{.notice.CommitId}}"){
localStorage.setItem('notice',"{{.notice.CommitId}}");
if (current_notice != "{{.notices.CommitId}}"){
localStorage.setItem('notices',"{{.notices.CommitId}}");
isNewNotice=true;
localStorage.setItem("isCloseNotice",false)
}else{


+ 3
- 3
templates/base/head_pro.tmpl View File

@@ -217,10 +217,10 @@ var _hmt = _hmt || [];
localStorage.setItem("isCloseNotice",true)
}
function isShowNotice(){
var current_notice = localStorage.getItem("notice")
var current_notice = localStorage.getItem("notices")

if (current_notice != "{{.notice.CommitId}}"){
localStorage.setItem('notice',"{{.notice.CommitId}}");
if (current_notice != "{{.notices.CommitId}}"){
localStorage.setItem('notices',"{{.notices.CommitId}}");
isNewNotice=true;
localStorage.setItem("isCloseNotice",false)
}else{


Loading…
Cancel
Save