Show app version in app detail sidebar

Show either installed version or first release found in app store data

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel 2020-01-15 17:29:37 +01:00
parent 5de3ea0417
commit d5d4e71558
No known key found for this signature in database
GPG Key ID: A061B9DDE0CA0773
6 changed files with 33 additions and 10 deletions

View File

@ -756,7 +756,7 @@ span.version {
float: right;
}
}
.app-author, .app-licence {
.app-author, .app-version-licence {
color: var(--color-text-maxcontrast);
}
.app-dependencies {

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -59,8 +59,8 @@
<a v-if="a['@attributes'] && a['@attributes']['homepage']" :href="a['@attributes']['homepage']">{{ a['@value'] }}</a><span v-else-if="a['@value']">{{ a['@value'] }}</span><span v-else>{{ a }}</span><span v-if="index+1 < author.length">, </span>
</span>
</div>
<div v-if="licence" class="app-licence">
{{ licence }}
<div v-if="versionAndLicense" class="app-version-licence">
{{ versionAndLicense }}
</div>
<div class="actions">
<div class="actions-buttons">
@ -215,7 +215,30 @@ export default {
},
licence() {
if (this.app.licence) {
return t('settings', '{license}-licensed', { license: ('' + this.app.licence).toUpperCase() })
return ('' + this.app.licence).toUpperCase()
}
return null
},
appVersion() {
if (this.app.version) {
return this.app.version
}
if (this.app.appstoreData.releases && this.app.appstoreData.releases.length > 0) {
return this.app.appstoreData.releases[0].version
}
return null
},
versionAndLicense() {
const licence = this.licence
const version = this.appVersion
if (licence && version) {
return t('settings', 'Version {version}, {licence}-licensed', { version, licence })
}
if (licence) {
return t('settings', '{licence}-licensed', { licence })
}
if (version) {
return t('settings', 'Version {version}', { version })
}
return null
},