Browse Source

增加多公告

tags/v1.22.1.4^2
wangjr 4 years ago
parent
commit
a61aefad7e
5 changed files with 60 additions and 51 deletions
  1. +4
    -24
      templates/base/head.tmpl
  2. +11
    -9
      templates/base/head_fluid.tmpl
  3. +11
    -9
      templates/base/head_home.tmpl
  4. +23
    -0
      templates/base/head_notice.tmpl
  5. +11
    -9
      templates/base/head_pro.tmpl

+ 4
- 24
templates/base/head.tmpl View File

@@ -200,27 +200,7 @@ var _hmt = _hmt || [];
<div class="ui top secondary stackable main menu following bar dark">
{{template "base/head_navbar" .}}
</div><!-- end bar -->
<!-- {{if not .IsCourse}} -->
<div class="notic_content" id ="notic_content" style="display: block; position: relative">
<diV class="ui container">
<marquee behavior="scroll" direction="left">
{{range .notices.Notices}}
<a href={{.Link}} class="a_width">
{{if eq .Visible 1}}
<i class="ri-arrow-right-s-line"></i>
{{.Title}}
{{end}}
</a>
{{end}}
</marquee>
<div class="item right" style="position:absolute;right: 1px;top:0px;">
<i class="ri-close-fill x_icon" onclick="closeNoice()"></i>
</div>
</diV>
</div>
<!-- {{end}} -->
{{template "base/head_notice" .}}
{{end}}
{{/*
</div>
@@ -245,14 +225,13 @@ var _hmt = _hmt || [];
isNewNotice=false;
}
let isShowNoticeTag = false;
let notices= "{{.notices.Notices}}"
let notices= {{.notices.Notices}}
for (i =0;i<notices.length;i++){
if (notices[i].Visible==1){
isShowNoticeTag =true;
break;
}
}
// if (JSON.parse("{{.notice.Visible}}")){
if (isShowNoticeTag){
if(isNewNotice){
document.getElementById("notic_content").style.display='block'
@@ -269,7 +248,8 @@ var _hmt = _hmt || [];
document.getElementById("notic_content").style.display='none'
}
}
if(!("{{.IsCourse}}" == true || "{{.IsCourse}}" =='true')) {
// isShowNotice();
isShowNotice();
}
</script>

+ 11
- 9
templates/base/head_fluid.tmpl View File

@@ -201,14 +201,7 @@ var _hmt = _hmt || [];
<div class="ui top secondary stackable main menu following bar dark">
{{template "base/head_navbar_fluid" .}}
</div><!-- end bar -->
<div class="notic_content" id ="notic_content" style="display: none;">
<a href={{.notice.Link}} class="a_width">
<marquee behavior="scroll" direction="left">
{{.notice.Title}}
</marquee>
</a>
<i class="ri-close-fill x_icon" onclick="closeNoice()"></i>
</div>
{{template "base/head_notice" .}}
{{end}}
{{/*
</div>
@@ -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<notices.length;i++){
if (notices[i].Visible==1){
isShowNoticeTag =true;
break;
}
}
if (isShowNoticeTag){
if(isNewNotice){
document.getElementById("notic_content").style.display='block'
}else{
@@ -248,6 +249,7 @@ var _hmt = _hmt || [];
document.getElementById("notic_content").style.display='none'
}
}
if(!("{{.IsCourse}}" == true || "{{.IsCourse}}" =='true')) {
isShowNotice();
}

+ 11
- 9
templates/base/head_home.tmpl View File

@@ -205,14 +205,7 @@ var _hmt = _hmt || [];
<div class="ui top secondary stackable main menu following bar dark">
{{template "base/head_navbar" .}}
</div><!-- end bar -->
<div class="notic_content" id ="notic_content" style="display: none;" >
<a href={{.notice.Link}} class="a_width">
<marquee behavior="scroll" direction="left">
{{.notice.Title}}
</marquee>
</a>
<i class="ri-close-fill x_icon" onclick="closeNoice()"></i>
</div>
{{template "base/head_notice" .}}
{{end}}
{{/*
</div>
@@ -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<notices.length;i++){
if (notices[i].Visible==1){
isShowNoticeTag =true;
break;
}
}
if (isShowNoticeTag){
if(isNewNotice){
document.getElementById("notic_content").style.display='block'
}else{
@@ -252,6 +253,7 @@ var _hmt = _hmt || [];
document.getElementById("notic_content").style.display='none'
}
}
if(!("{{.IsCourse}}" == true || "{{.IsCourse}}" =='true')) {
isShowNotice();
}

+ 23
- 0
templates/base/head_notice.tmpl View File

@@ -0,0 +1,23 @@
{{if not .IsCourse}}
{{ if .notices}}
<div class="notic_content" id ="notic_content" style="display: block; position: relative">
<diV class="ui container">
<marquee behavior="scroll" direction="left">
{{range .notices.Notices}}
<a href={{.Link}} class="a_width">
{{if eq .Visible 1}}
<i class="ri-arrow-right-s-line"></i>
{{.Title}}
{{end}}
</a>
{{end}}
</marquee>
<div class="item right" style="position:absolute;right: 1px;top:0px;">
<i class="ri-close-fill x_icon" onclick="closeNoice()"></i>
</div>
</diV>
</div>
{{end}}
{{end}}

+ 11
- 9
templates/base/head_pro.tmpl View File

@@ -201,14 +201,7 @@ var _hmt = _hmt || [];
<div class="ui top secondary stackable main menu following bar dark">
{{template "base/head_navbar_pro" .}}
</div><!-- end bar -->
<div class="notic_content" id ="notic_content" style="display: none;" >
<a href={{.notice.Link}} class="a_width">
<marquee behavior="scroll" direction="left">
{{.notice.Title}}
</marquee>
</a>
<i class="icon icon-octicon x_icon" onclick="closeNoice()">{{svg "octicon-x" 16}}</i>
</div>
{{template "base/head_notice" .}}
{{end}}
{{/*
</div>
@@ -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<notices.length;i++){
if (notices[i].Visible==1){
isShowNoticeTag =true;
break;
}
}
if (isShowNoticeTag){
if(isNewNotice){
document.getElementById("notic_content").style.display='block'
}else{
@@ -249,6 +250,7 @@ var _hmt = _hmt || [];
document.getElementById("notic_content").style.display='none'
}
}
if(!("{{.IsCourse}}" == true || "{{.IsCourse}}" =='true')) {
isShowNotice();
}

Loading…
Cancel
Save