Skip to content

Commit

Permalink
refactor: improve code readability
Browse files Browse the repository at this point in the history
  • Loading branch information
mtdvlpr committed Nov 21, 2024
1 parent 4bd2411 commit ba996fa
Show file tree
Hide file tree
Showing 10 changed files with 74 additions and 71 deletions.
6 changes: 4 additions & 2 deletions src/components/dialog/DialogBackgroundMusicPopup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -85,17 +85,19 @@
:disable="mediaPlaying || musicStarting"
unelevated
@click="playMusic"
>{{ $t('play-music') }}</q-btn
>
{{ $t('play-music') }}
</q-btn>
<q-btn
v-else
class="full-width"
color="primary"
:disable="musicStopping"
unelevated
@click="stopMusic"
>{{ $t('stop-music') }}</q-btn
>
{{ $t('stop-music') }}
</q-btn>
</div>
</div>
</q-card-section>
Expand Down
48 changes: 25 additions & 23 deletions src/components/dialog/DialogCongregationLookup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,26 +30,28 @@
<q-list class="full-width q-px-md" padding separator>
<q-item v-if="!results?.length">
<q-item-section>
<q-item-label
>{{
<q-item-label>
{{
congregationFilter?.length > 2
? $t('no-results')
: $t('no-results-short')
}}
</q-item-label>
<q-item-label caption>{{
congregationFilter?.length > 2
? $t('no-results-explain')
: $t('no-results-short-explain')
}}</q-item-label>
<q-item-label caption>
{{
congregationFilter?.length > 2
? $t('no-results-explain')
: $t('no-results-short-explain')
}}
</q-item-label>
</q-item-section>
</q-item>
<template v-for="congregation in results" :key="congregation">
<q-item clickable @click="selectCongregation(congregation)">
<q-item-section>
<q-item-label>{{
congregation.properties.orgName
}}</q-item-label>
<q-item-label>
{{ congregation.properties.orgName }}
</q-item-label>
<q-item-label caption>
{{
dateLocale.days[
Expand All @@ -71,18 +73,18 @@
.weekday
]
}}
{{
congregation.properties.schedule.current.weekend.time
}}</q-item-label
>
{{ congregation.properties.schedule.current.weekend.time }}
</q-item-label>
</q-item-section>
<q-item-section side top>
<q-item-label caption>{{
jwLanguages.list?.find(
(l) =>
l.langcode === congregation?.properties?.languageCode,
)?.vernacularName
}}</q-item-label>
<q-item-label caption>
{{
jwLanguages.list?.find(
(l) =>
l.langcode === congregation?.properties?.languageCode,
)?.vernacularName
}}
</q-item-label>
</q-item-section>
</q-item>
</template>
Expand All @@ -91,9 +93,9 @@
</div>
<div class="row q-px-md">
<div class="col text-right">
<q-btn v-close-popup color="negative" flat @click="dismissPopup">{{
$t('cancel')
}}</q-btn>
<q-btn v-close-popup color="negative" flat @click="dismissPopup">
{{ $t('cancel') }}
</q-btn>
</div>
</div>
</div>
Expand Down
9 changes: 6 additions & 3 deletions src/components/dialog/DialogDisplayPopup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -147,16 +147,18 @@
color="primary"
unelevated
@click="showMediaWindow(false)"
>{{ $t('hide-media-display') }}</q-btn
>
{{ $t('hide-media-display') }}
</q-btn>
<q-btn
v-else
class="full-width"
color="primary"
unelevated
@click="showMediaWindow(true)"
>{{ $t('show-media-display') }}</q-btn
>
{{ $t('show-media-display') }}
</q-btn>
</div>
</div>
</q-card-section>
Expand Down Expand Up @@ -215,8 +217,9 @@
jwpubImportFilePath = '';
jwpubImages = [];
"
>{{ $t('cancel') }}</q-btn
>
{{ $t('cancel') }}
</q-btn>
</div>
</div>
</q-dialog>
Expand Down
6 changes: 3 additions & 3 deletions src/components/dialog/DialogRemoteVideo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@
{{ video.title }}
</div>
<div>
<span class="text-caption text-dark-grey">{{
video.naturalKey
}}</span>
<span class="text-caption text-dark-grey">
{{ video.naturalKey }}
</span>
</div>
</q-card-section>
</div>
Expand Down
24 changes: 12 additions & 12 deletions src/components/header/HeaderCalendar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@
</q-item-section>
<q-item-section>
<q-item-label>{{ $t('video') }}</q-item-label>
<q-item-label caption>{{
$t('latest-videos-from-jw-org')
}}</q-item-label>
<q-item-label caption>
{{ $t('latest-videos-from-jw-org') }}
</q-item-label>
</q-item-section>
</q-item>
<q-item v-close-popup clickable @click="publicTalkMediaPopup = true">
Expand Down Expand Up @@ -122,9 +122,9 @@
</q-item-section>
<q-item-section>
<q-item-label>{{ $t('show-hidden-media') }}</q-item-label>
<q-item-label caption>{{
$t('show-hidden-media-explain')
}}</q-item-label>
<q-item-label caption>
{{ $t('show-hidden-media-explain') }}
</q-item-label>
</q-item-section>
</q-item>
<q-item
Expand All @@ -137,12 +137,12 @@
<q-icon color="negative" name="mmm-delete" />
</q-item-section>
<q-item-section>
<q-item-label>{{
$t('delete-all-additional-media')
}}</q-item-label>
<q-item-label caption>{{
$t('this-will-only-delete-media-for-this-day')
}}</q-item-label>
<q-item-label>
{{ $t('delete-all-additional-media') }}
</q-item-label>
<q-item-label caption>
{{ $t('this-will-only-delete-media-for-this-day') }}
</q-item-label>
</q-item-section>
</q-item>
</template>
Expand Down
4 changes: 2 additions & 2 deletions src/components/header/HeaderSettings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
/>
</q-item-section>
<q-item-section>
<q-item-label
>{{
<q-item-label>
{{
onlyShowInvalidSettings
? $t('show-all-settings')
: $t('only-show-settings-that-are-not-valid')
Expand Down
12 changes: 4 additions & 8 deletions src/components/media/DragAndDropper.vue
Original file line number Diff line number Diff line change
Expand Up @@ -78,23 +78,19 @@
{{ $t('local-media-explain-2') }}
<q-tooltip>
<div class="row">
<strong>{{ $t('images:') }}</strong
>&nbsp;
<strong>{{ $t('images:') }}&nbsp;</strong>
{{ IMG_EXTENSIONS.sort().join(', ') }}
</div>
<div class="row">
<strong>{{ $t('videos:') }}</strong
>&nbsp;
<strong>{{ $t('videos:') }}&nbsp;</strong>
{{ VIDEO_EXTENSIONS.sort().join(', ') }}
</div>
<div class="row">
<strong>{{ $t('audio:') }}</strong
>&nbsp;
<strong>{{ $t('audio:') }}&nbsp;</strong>
{{ AUDIO_EXTENSIONS.sort().join(', ') }}
</div>
<div class="row">
<strong>{{ $t('other:') }}</strong
>&nbsp;
<strong>{{ $t('other:') }}&nbsp;</strong>
{{ OTHER_EXTENSIONS.sort().join(', ') }}
</div>
</q-tooltip>
Expand Down
24 changes: 12 additions & 12 deletions src/components/media/MediaItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -218,19 +218,19 @@
name="mmm-repeat"
size="sm"
>
<q-tooltip :delay="500">{{
media.repeat ? $t('repeat') : $t('repeat-off')
}}</q-tooltip>
<q-tooltip :delay="500">
{{ media.repeat ? $t('repeat') : $t('repeat-off') }}
</q-tooltip>
</q-icon>
<q-icon
v-if="media.watched"
color="accent-300"
name="mmm-watched-media"
size="sm"
>
<q-tooltip :delay="500">{{
$t('watched-media-item-explain')
}}</q-tooltip>
<q-tooltip :delay="500">
{{ $t('watched-media-item-explain') }}
</q-tooltip>
</q-icon>
<q-icon
v-else-if="
Expand Down Expand Up @@ -436,9 +436,9 @@
</q-item-section>
<q-item-section>
<q-item-label>{{ $t('hide-from-list') }}</q-item-label>
<q-item-label caption>{{
$t('hide-from-list-explain')
}}</q-item-label>
<q-item-label caption>
{{ $t('hide-from-list-explain') }}
</q-item-label>
</q-item-section>
</q-item>
<q-item v-close-popup clickable @click="mediaEditTitleDialog = true">
Expand All @@ -456,9 +456,9 @@
</q-item-section>
<q-item-section>
<q-item-label>{{ $t('change-tag') }}</q-item-label>
<q-item-label caption>{{
$t('change-tag-explain')
}}</q-item-label>
<q-item-label caption>
{{ $t('change-tag-explain') }}
</q-item-label>
</q-item-section>
</q-item>
<q-item
Expand Down
6 changes: 3 additions & 3 deletions src/pages/CongregationSelectorPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@
}}
{{ congregations[id]?.weStartTime }}
</template>
<template v-else-if="invalidSettings(id)">{{
$t('incomplete-configuration')
}}</template>
<template v-else-if="invalidSettings(id)">
{{ $t('incomplete-configuration') }}
</template>
</div>
</div>
<div class="col-shrink">
Expand Down
6 changes: 3 additions & 3 deletions src/pages/SettingsPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,9 @@
>
<q-item-section>
<q-item-label>{{ $t(settingId) }}</q-item-label>
<q-item-label caption>{{
$t(settingId + '-explain')
}}</q-item-label>
<q-item-label caption>
{{ $t(settingId + '-explain') }}
</q-item-label>
</q-item-section>
<q-item-section side style="align-items: end">
<BaseInput
Expand Down

0 comments on commit ba996fa

Please sign in to comment.