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", "babel-eslint": "^10.0.1",
"eslint": "^5.16.0", "eslint": "^5.16.0",
"eslint-plugin-vue": "^5.0.0", "eslint-plugin-vue": "^5.0.0",
"lodash": "^4.17.15",
"node-sass": "^4.12.0", "node-sass": "^4.12.0",
"sass-loader": "^8.0.0", "sass-loader": "^8.0.0",
"vue-template-compiler": "^2.6.10" "vue-template-compiler": "^2.6.10"

View file

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

View file

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