fix(ui): podcasts remote search form

This commit is contained in:
ArneBo 2025-01-05 19:46:16 +01:00 committed by upsiflu
parent 4681e23a1e
commit 154f68b153
1 changed files with 39 additions and 37 deletions

View File

@ -172,9 +172,30 @@ watch(() => props.initialId, () => {
</script> </script>
<template> <template>
<Tabs <Alert red
v-if="!isLoading && obj?.status === 'finished' && !redirectRoute"
>
{{ t('components.RemoteSearchForm.warning.unsupported') }}
</Alert>
<Alert red
v-if="errors.length > 0"
role="alert"
title="t('components.RemoteSearchForm.header.fetchFailed')"
>
<ul class="list">
<li
v-for="(error, key) in errors"
:key="key"
>
{{ error }}
</li>
</ul>
</Alert>
<Layout form
v-if="type === 'both'" v-if="type === 'both'"
class="two ui buttons" id="remote-search"
>
<Tabs
> >
<Tab <Tab
icon="bi-feed" icon="bi-feed"
@ -207,40 +228,21 @@ watch(() => props.initialId, () => {
/> />
</Tab> </Tab>
</Tabs> </Tabs>
<div v-else> </Layout>
<Layout form <Layout form
id="remote-search" v-else
:class="['ui', {loading: isLoading}, 'form']" id="remote-search"
@submit.stop.prevent="submit" :class="['ui', {loading: isLoading}, 'form']"
@submit.stop.prevent="submit"
>
<Button
v-if="showSubmit"
primary
type="submit"
:class="{loading: isLoading}"
:disabled="isLoading || !id || id.length === 0"
> >
<Alert red {{ t('components.RemoteSearchForm.button.search') }}
v-if="errors.length > 0" </Button>
role="alert" </Layout>
title="t('components.RemoteSearchForm.header.fetchFailed')"
>
<ul class="list">
<li
v-for="(error, key) in errors"
:key="key"
>
{{ error }}
</li>
</ul>
</Alert>
<Button
v-if="showSubmit"
primary
type="submit"
:class="{loading: isLoading}"
:disabled="isLoading || !id || id.length === 0"
>
{{ t('components.RemoteSearchForm.button.search') }}
</Button>
</Layout>
<Alert
v-if="!isLoading && obj?.status === 'finished' && !redirectRoute"
>
{{ t('components.RemoteSearchForm.warning.unsupported') }}
</Alert>
</div>
</template> </template>