refacto: simplify tops wordings
All checks were successful
repod / xml (push) Successful in 18s
repod / php (push) Successful in 1m1s
repod / nodejs (push) Successful in 2m22s
repod / release (push) Has been skipped

This commit is contained in:
Michel Roux 2024-01-17 22:38:47 +01:00
parent b784040b69
commit 37d264d717
5 changed files with 19 additions and 22 deletions

View File

@ -17,7 +17,7 @@ return [
['name' => 'episodes#list', 'url' => '/episodes/list', 'verb' => 'GET'], ['name' => 'episodes#list', 'url' => '/episodes/list', 'verb' => 'GET'],
['name' => 'podcast#index', 'url' => '/podcast', 'verb' => 'GET'], ['name' => 'podcast#index', 'url' => '/podcast', 'verb' => 'GET'],
['name' => 'search#index', 'url' => '/search', 'verb' => 'GET'], ['name' => 'search#index', 'url' => '/search', 'verb' => 'GET'],
['name' => 'toplist#hot', 'url' => '/toplist/hot', 'verb' => 'GET'], ['name' => 'tops#hot', 'url' => '/tops/hot', 'verb' => 'GET'],
['name' => 'toplist#new', 'url' => '/toplist/new', 'verb' => 'GET'], ['name' => 'tops#new', 'url' => '/tops/new', 'verb' => 'GET'],
], ],
]; ];

View File

@ -10,7 +10,7 @@ use OCP\AppFramework\Controller;
use OCP\AppFramework\Http\JSONResponse; use OCP\AppFramework\Http\JSONResponse;
use OCP\IRequest; use OCP\IRequest;
class ToplistController extends Controller class TopsController extends Controller
{ {
public function __construct( public function __construct(
IRequest $request, IRequest $request,

View File

@ -1,5 +1,5 @@
<template> <template>
<NcAppContent :class="episode ? 'margin' : ''"> <NcAppContent :class="episode ? 'padding' : ''">
<slot /> <slot />
</NcAppContent> </NcAppContent>
</template> </template>
@ -21,7 +21,7 @@ export default {
</script> </script>
<style scoped> <style scoped>
.margin { .padding {
padding-bottom: 6rem; padding-bottom: 6rem;
} }
</style> </style>

View File

@ -1,5 +1,5 @@
<template> <template>
<NcAppNavigation :class="episode ? 'margin' : ''"> <NcAppNavigation :class="episode ? 'padding' : ''">
<slot /> <slot />
<template #list> <template #list>
<slot name="list" /> <slot name="list" />
@ -27,7 +27,7 @@ export default {
</script> </script>
<style scoped> <style scoped>
.margin { .padding {
padding-bottom: 6rem; padding-bottom: 6rem;
} }
</style> </style>

View File

@ -3,7 +3,7 @@
<h2>{{ title }}</h2> <h2>{{ title }}</h2>
<Loading v-if="loading" /> <Loading v-if="loading" />
<ul v-if="!loading"> <ul v-if="!loading">
<li v-for="top in items" :key="top.link"> <li v-for="top in tops" :key="top.link">
<router-link :to="toUrl(top.link)"> <router-link :to="toUrl(top.link)">
<img :src="top.imageUrl" :title="top.author"> <img :src="top.imageUrl" :title="top.author">
</router-link> </router-link>
@ -32,8 +32,8 @@ export default {
}, },
data() { data() {
return { return {
items: [],
loading: true, loading: true,
tops: [],
} }
}, },
computed: { computed: {
@ -49,22 +49,19 @@ export default {
}, },
}, },
async mounted() { async mounted() {
this.loadList() try {
this.loading = true
const tops = await axios.get(generateUrl(`/apps/repod/tops/${this.type}`))
this.tops = tops.data
} catch (e) {
console.error(e)
showError(t('repod', 'Could not fetch tops'))
} finally {
this.loading = false
}
}, },
methods: { methods: {
toUrl, toUrl,
async loadList() {
try {
this.loading = true
const toplist = await axios.get(generateUrl(`/apps/repod/toplist/${this.type}`))
this.items = toplist.data
} catch (e) {
console.error(e)
showError(t('repod', 'Could not fetch tops'))
} finally {
this.loading = false
}
},
}, },
} }
</script> </script>