feat(ui): [WIP] Artist page
This commit is contained in:
parent
fdaba924a1
commit
2818c3eff3
|
@ -22,6 +22,8 @@ import Card from '~/components/ui/Card.vue'
|
||||||
import Layout from '~/components/ui/Layout.vue'
|
import Layout from '~/components/ui/Layout.vue'
|
||||||
import Button from '~/components/ui/Button.vue'
|
import Button from '~/components/ui/Button.vue'
|
||||||
import Input from '~/components/ui/Input.vue'
|
import Input from '~/components/ui/Input.vue'
|
||||||
|
import Toggle from '~/components/ui/Toggle.vue'
|
||||||
|
import Alert from '~/components/ui/Alert.vue'
|
||||||
|
|
||||||
import useSharedLabels from '~/composables/locale/useSharedLabels'
|
import useSharedLabels from '~/composables/locale/useSharedLabels'
|
||||||
import useOrdering from '~/composables/navigation/useOrdering'
|
import useOrdering from '~/composables/navigation/useOrdering'
|
||||||
|
@ -128,12 +130,10 @@ const paginateOptions = computed(() => sortedUniq([12, 30, 50, paginateBy.value]
|
||||||
<h2>
|
<h2>
|
||||||
{{ t('components.library.Artists.header.browse') }}
|
{{ t('components.library.Artists.header.browse') }}
|
||||||
</h2>
|
</h2>
|
||||||
<form
|
<Layout form flex
|
||||||
:class="['ui', {'loading': isLoading}, 'form']"
|
:class="['ui', {'loading': isLoading}, 'form']"
|
||||||
@submit.prevent="search"
|
@submit.prevent="search"
|
||||||
>
|
>
|
||||||
<div class="fields">
|
|
||||||
<div class="field">
|
|
||||||
<Input search
|
<Input search
|
||||||
id="artist-search"
|
id="artist-search"
|
||||||
v-model="query"
|
v-model="query"
|
||||||
|
@ -143,15 +143,13 @@ const paginateOptions = computed(() => sortedUniq([12, 30, 50, paginateBy.value]
|
||||||
:placeholder="labels.searchPlaceholder"
|
:placeholder="labels.searchPlaceholder"
|
||||||
>
|
>
|
||||||
</Input>
|
</Input>
|
||||||
</div>
|
<Input
|
||||||
<div class="field">
|
v-model="tags"
|
||||||
<label for="tags-search">{{ t('components.library.Artists.label.tags') }}</label>
|
:label="t('components.library.Artists.label.tags')"
|
||||||
<tags-selector v-model="tags" />
|
/>
|
||||||
</div>
|
|
||||||
<div class="field">
|
|
||||||
<label for="artist-ordering">{{ t('components.library.Artists.ordering.label') }}</label>
|
|
||||||
<select
|
<select
|
||||||
id="artist-ordering"
|
id="artist-ordering"
|
||||||
|
:label="t('components.library.Artists.ordering.label')"
|
||||||
v-model="ordering"
|
v-model="ordering"
|
||||||
class="ui dropdown"
|
class="ui dropdown"
|
||||||
>
|
>
|
||||||
|
@ -163,10 +161,8 @@ const paginateOptions = computed(() => sortedUniq([12, 30, 50, paginateBy.value]
|
||||||
{{ sharedLabels.filters[option[1]] }}
|
{{ sharedLabels.filters[option[1]] }}
|
||||||
</option>
|
</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
|
||||||
<div class="field">
|
|
||||||
<label for="artist-ordering-direction">{{ t('components.library.Artists.ordering.direction.label') }}</label>
|
|
||||||
<select
|
<select
|
||||||
|
:label="t('components.library.Artists.ordering.direction.label')"
|
||||||
id="artist-ordering-direction"
|
id="artist-ordering-direction"
|
||||||
v-model="orderingDirection"
|
v-model="orderingDirection"
|
||||||
class="ui dropdown"
|
class="ui dropdown"
|
||||||
|
@ -178,10 +174,8 @@ const paginateOptions = computed(() => sortedUniq([12, 30, 50, paginateBy.value]
|
||||||
{{ t('components.library.Artists.ordering.direction.descending') }}
|
{{ t('components.library.Artists.ordering.direction.descending') }}
|
||||||
</option>
|
</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
|
||||||
<div class="field">
|
|
||||||
<label for="artist-results">{{ t('components.library.Artists.pagination.results') }}</label>
|
|
||||||
<select
|
<select
|
||||||
|
:label="t('components.library.Artists.pagination.results')"
|
||||||
id="artist-results"
|
id="artist-results"
|
||||||
v-model="paginateBy"
|
v-model="paginateBy"
|
||||||
class="ui dropdown"
|
class="ui dropdown"
|
||||||
|
@ -194,29 +188,15 @@ const paginateOptions = computed(() => sortedUniq([12, 30, 50, paginateBy.value]
|
||||||
{{ opt }}
|
{{ opt }}
|
||||||
</option>
|
</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
<Toggle
|
||||||
<div class="field">
|
:label="t('components.library.Artists.label.excludeCompilation')"
|
||||||
<span id="excludeHeader">{{ t('components.library.Artists.label.excludeCompilation') }}</span>
|
|
||||||
<div
|
|
||||||
id="excludeCompilation"
|
|
||||||
class="ui toggle checkbox"
|
|
||||||
>
|
|
||||||
<Input
|
|
||||||
id="exclude-compilation"
|
id="exclude-compilation"
|
||||||
v-model="excludeCompilation"
|
v-model="excludeCompilation"
|
||||||
true-value="true"
|
true-value="true"
|
||||||
false-value="null"
|
false-value="null"
|
||||||
type="checkbox"
|
type="checkbox"
|
||||||
/>
|
/>
|
||||||
<label
|
</Layout>
|
||||||
for="exclude-compilation"
|
|
||||||
class="visually-hidden"
|
|
||||||
>{{ t('components.library.Artists.label.excludeCompilation') }}</label>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
<div class="ui hidden divider" />
|
|
||||||
<div
|
<div
|
||||||
v-if="result && result.results.length > 0"
|
v-if="result && result.results.length > 0"
|
||||||
style="display:flex; flex-wrap:wrap; gap: 32px; margin-top:32px;"
|
style="display:flex; flex-wrap:wrap; gap: 32px; margin-top:32px;"
|
||||||
|
@ -227,21 +207,19 @@ const paginateOptions = computed(() => sortedUniq([12, 30, 50, paginateBy.value]
|
||||||
>
|
>
|
||||||
<div class="ui loader" />
|
<div class="ui loader" />
|
||||||
</div>
|
</div>
|
||||||
<artist-card
|
<ArtistCard
|
||||||
v-for="artist in result.results"
|
v-for="artist in result.results"
|
||||||
:key="artist.id"
|
:key="artist.id"
|
||||||
:artist="artist"
|
:artist="artist"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<Layout stack
|
||||||
v-else-if="!isLoading"
|
v-else-if="!isLoading"
|
||||||
class="ui placeholder segment sixteen wide column"
|
|
||||||
style="text-align: center; display: flex; align-items: center"
|
|
||||||
>
|
>
|
||||||
<div class="ui icon header">
|
<Alert yellow>
|
||||||
<i class="compact disc icon" />
|
<i class="compact disc icon" />
|
||||||
{{ t('components.library.Artists.empty.noResults') }}
|
{{ t('components.library.Artists.empty.noResults') }}
|
||||||
</div>
|
</Alert>
|
||||||
<router-link
|
<router-link
|
||||||
v-if="store.state.auth.authenticated"
|
v-if="store.state.auth.authenticated"
|
||||||
:to="{name: 'content.index'}"
|
:to="{name: 'content.index'}"
|
||||||
|
@ -250,7 +228,7 @@ const paginateOptions = computed(() => sortedUniq([12, 30, 50, paginateBy.value]
|
||||||
<i class="upload icon" />
|
<i class="upload icon" />
|
||||||
{{ t('components.library.Artists.button.upload') }}
|
{{ t('components.library.Artists.button.upload') }}
|
||||||
</router-link>
|
</router-link>
|
||||||
</div>
|
</Layout>
|
||||||
<div class="ui center aligned basic segment">
|
<div class="ui center aligned basic segment">
|
||||||
<pagination
|
<pagination
|
||||||
v-if="result && result.count > paginateBy"
|
v-if="result && result.count > paginateBy"
|
||||||
|
|
Loading…
Reference in New Issue