Browse Source

fix-1463项目简介未登录不显示

tags/v1.22.2.2^2
wangjr 3 years ago
parent
commit
400d2b5654
2 changed files with 19 additions and 7 deletions
  1. +4
    -3
      templates/repo/home.tmpl
  2. +15
    -4
      web_src/js/components/EditAboutInfo.vue

+ 4
- 3
templates/repo/home.tmpl View File

@@ -255,9 +255,9 @@
{{end}}
</div>
<div class="ui six wide tablet four wide computer column">
<div id="repo-desc">
<h4 id="about-desc" class="ui header">简介</h4>
<input type="hidden" id="edit-alias" value="{{.Repository.Alias}}">
<div id="repo-desc" data-IsSigned= "{{.IsSigned}}" >
<h4 id="about-desc" class="ui header">简介</h4>
<input type="hidden" id="edit-alias" value="{{.Repository.Alias}}">
<p>
{{if .Repository.DescriptionHTML}}
<span class="description" style="word-break:break-all">{{.Repository.DescriptionHTML}}</span>
@@ -356,5 +356,6 @@
// $("#contributorInfo > a:nth-child(n+25)").show();
// });
// });
console.log("repo-desc::::",document.getElementById("repo-desc").dataset.issigned)
</script>
{{template "base/footer" .}}

+ 15
- 4
web_src/js/components/EditAboutInfo.vue View File

@@ -1,7 +1,7 @@
<template>
<div>
<h4 id="about-desc" class="ui header desc-home">简介
<a class="edit-icon" href="javascript:void(0)" @click="editClick">
<a class="edit-icon" v-if="IsSigned" id ="editBtn" href="javascript:void(0)" @click="editClick" >
<i class="gray edit outline icon" style="margin-right: 0;"></i>
</a>
</h4>
@@ -52,7 +52,8 @@ export default {
desc: '',
index_web: '',
repo_name_name: '',
alias:''
alias:'',
IsSigned:false
},
// rule1:[{min:3,max:5,message:'1',trigger:"blur"}],
rule: {
@@ -63,8 +64,17 @@ export default {
};
},
methods: {
getIsSigned(){
this.IsSigned = document.getElementById("repo-desc").dataset.issigned;
// console.log("IsSigned:",this.IsSigned)
if (this.IsSigned==true || this.IsSigned=="true"){
this.IsSigned=true;
}
},
editClick() {
this.editDataDialog = true;
if (this.IsSigned){
this.editDataDialog = true;
}
},
getDesc() {
const el = $('span.description').text();
@@ -121,6 +131,7 @@ export default {
}
},
mounted() {
this.getIsSigned();
this.getUrl();
this.getRepoName();
this.getDesc();
@@ -135,7 +146,7 @@ export default {
}
},
created() {
this.getIsSigned();
}

};


Loading…
Cancel
Save