Browse Source

Merge pull request 'fix-1463项目简介 未登录时 隐藏按钮' (#1522) from fix-1463 into V20220228

Reviewed-on: https://git.openi.org.cn/OpenI/aiforge/pulls/1522
Reviewed-by: zhoupzh <zhoupzh@pcl.ac.cn>
pull/1524/head
zhoupzh 3 years ago
parent
commit
4fa4578003
2 changed files with 18 additions and 7 deletions
  1. +3
    -3
      templates/repo/home.tmpl
  2. +15
    -4
      web_src/js/components/EditAboutInfo.vue

+ 3
- 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>


+ 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