#1748 fix 1747

Merged
lewis merged 2 commits from wangjr_0328 into V20220328 2 years ago
  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

@@ -2691,7 +2691,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
@@ -2723,5 +2723,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