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}} {{end}}
</div> </div>
<div class="ui six wide tablet four wide computer column"> <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> <p>
{{if .Repository.DescriptionHTML}} {{if .Repository.DescriptionHTML}}
<span class="description" style="word-break:break-all">{{.Repository.DescriptionHTML}}</span> <span class="description" style="word-break:break-all">{{.Repository.DescriptionHTML}}</span>
@@ -356,5 +356,6 @@
// $("#contributorInfo > a:nth-child(n+25)").show(); // $("#contributorInfo > a:nth-child(n+25)").show();
// }); // });
// }); // });
console.log("repo-desc::::",document.getElementById("repo-desc").dataset.issigned)
</script> </script>
{{template "base/footer" .}} {{template "base/footer" .}}

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

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


}; };


Loading…
Cancel
Save