Fix instance cards with some instances

This commit is contained in:
Chocobozzz 2019-09-19 15:17:53 +02:00
parent 5abb89c39e
commit d355b57214
No known key found for this signature in database
GPG key ID: 583A612D890159BE
3 changed files with 22 additions and 16 deletions

View file

@ -26,6 +26,7 @@
"babel-eslint": "^10.0.1",
"eslint": "^5.16.0",
"eslint-plugin-vue": "^5.0.0",
"lodash": "^4.17.15",
"node-sass": "^4.12.0",
"sass-loader": "^8.0.0",
"vue-template-compiler": "^2.6.10"

View file

@ -7,8 +7,8 @@
<div class="host">{{ instance.host }}</div>
</div>
<div class="description">
{{ instance.shortDescription }}
<div class="description" :title="instance.shortDescription">
{{ truncatedDescription }}
</div>
<div class="upload-limits" v-if="isVideoMaker">
@ -72,7 +72,7 @@
<icon-languages></icon-languages>
</div>
<div>{{ getLanguages(instance.languages) }}</div>
<div>{{ languages }}</div>
</div>
<div class="nsfw">
@ -119,11 +119,12 @@
.label {
color: $grey;
letter-spacing: -0.5px;
}
.left {
margin-right: 40px;
width: 490px;
width: 480px;
.name-host {
display: flex;
@ -155,6 +156,7 @@
}
.tags {
display: flex;
margin-top: auto;
}
}
@ -168,10 +170,6 @@
.nsfw {
display: flex;
.label {
color: $grey;
}
}
.link {
@ -188,6 +186,7 @@
import IconFollowing from './icons/IconFollowing'
import IconLanguages from './icons/IconLanguages'
import IconQuota from './icons/IconQuota'
import truncate from 'lodash/truncate'
export default {
components: {
@ -205,8 +204,19 @@
isVideoMaker: Boolean
},
data () {
return {}
computed: {
truncatedDescription () {
const t = this.instance.shortDescription
return truncate(t, { separator: /,? /, length: 200 })
},
languages () {
return this.instance.languages
.map(l => this.translatedLanguages[l])
.filter(l => !!l)
.join(', ')
}
},
methods: {
@ -227,10 +237,6 @@
return calc + format.type
},
getLanguages (languages) {
return languages.map(l => this.translatedLanguages[l]).join(', ')
},
getUrl (instance) {
return `https://${instance.host}`
}

View file

@ -381,8 +381,7 @@
const params = {
start: 0,
count: 250,
healthy: true,
search: 'peertube2'
healthy: true
}
if (this.wantTo === 'create-account') params.signup = true