Small changes

This commit is contained in:
William Buezas 2024-08-18 20:10:57 -03:00
parent 95a2bfb69c
commit 17a519e2ee
14 changed files with 100 additions and 33 deletions

View File

@ -227,7 +227,9 @@ defineExpose({
no-caps
flat
v-close-popup
/>
>
<QTooltip>{{ t('cancel') }}</QTooltip>
</QBtn>
<QBtn
v-if="defaultActions"
:label="t('save')"
@ -237,7 +239,9 @@ defineExpose({
flat
:disabled="!showBottomActions && !updatedColumns.length"
@click="submit()"
/>
>
<QTooltip>{{ t('save') }}</QTooltip>
</QBtn>
<slot name="actions" :data="formData" />
</component>
</QForm>

View File

@ -4,6 +4,8 @@ import { useAppStore } from 'stores/app';
import ImageEditor from 'src/components/ui/ImageEditor.vue';
import { useI18n } from 'vue-i18n';
const props = defineProps({
baseURL: {
type: String,
@ -60,6 +62,8 @@ const props = defineProps({
}
});
const { t } = useI18n();
const app = useAppStore();
const showZoom = ref(false);
const showEditForm = ref(false);
@ -77,7 +81,9 @@ const url = computed(() => {
round
text-color="black"
@click.stop.prevent="showEditForm = !showEditForm"
/>
>
<QTooltip>{{ t('addOrEditImage') }}</QTooltip>
</QBtn>
<QImg
:class="{
zoomIn: props.zoomSize,
@ -160,3 +166,16 @@ const url = computed(() => {
border-radius: 0%;
}
</style>
<i18n lang="yaml">
en-US:
addOrEditImage: Add or update an image
es-ES:
addOrEditImage: Añadir o actualizar imagen
ca-ES:
addOrEditImage: Afegir o actualitzar Imatge
fr-FR:
addOrEditImage: Ajouter our mettre à jour l'image
pt-PT:
addOrEditImage: Adicionar ou atualizar imagem
</i18n>

View File

@ -68,10 +68,10 @@ onMounted(() => {
@keyup.enter="search()"
:placeholder="props.placeholder || t('search')"
bg-color="white"
isOutlined
is-outlined
:clearable="false"
>
<template #append>
<template #prepend>
<QIcon name="search" class="cursor-pointer" @click="search()" />
</template>
</VnInput>

View File

@ -62,5 +62,6 @@ export default {
//
orderLoadedIntoBasket: 'Comanda carregada a la cistella!',
at: 'a les',
back: 'Tornar'
back: 'Tornar',
remove: 'Esborrar'
};

View File

@ -76,6 +76,7 @@ export default {
orderLoadedIntoBasket: 'Order loaded into basket!',
at: 'at',
back: 'Back',
remove: 'Remove',
orders: 'Orders',
order: 'Pending order',

View File

@ -82,6 +82,7 @@ export default {
orderLoadedIntoBasket: '¡Pedido cargado en la cesta!',
at: 'a las',
back: 'Volver',
remove: 'Borrar',
orders: 'Pedidos',
order: 'Pedido pendiente',

View File

@ -62,5 +62,6 @@ export default {
//
orderLoadedIntoBasket: 'Commande chargée dans le panier!',
at: 'à',
back: 'Retour'
back: 'Retour',
remove: 'Effacer'
};

View File

@ -63,5 +63,6 @@ export default {
//
orderLoadedIntoBasket: 'Pedido carregado na cesta!',
at: 'às',
back: 'Voltar'
back: 'Voltar',
remove: 'Eliminar'
};

View File

@ -14,6 +14,18 @@ export function date(val, format) {
return qdate.formatDate(val, format, i18n.global.tm('date'));
}
export const formatDate = (timeStamp, format = 'YYYY-MM-DD') => {
if (!timeStamp) return '';
const { messages, locale } = i18n.global;
return qdate.formatDate(timeStamp, format, {
days: messages.value[locale.value].date.days,
months: messages.value[locale.value].date.months,
daysShort: messages.value[locale.value].date.daysShort,
monthsShort: messages.value[locale.value].date.monthsShort
});
};
/**
* @param {Date} timeStamp - La marca de tiempo que se va a formatear. Si no se proporciona, la función devolverá una cadena vacía.
* @param {Object} options - Un objeto que contiene las opciones de formato.
@ -22,24 +34,23 @@ export function date(val, format) {
* @param {boolean} options.shortDay - Indica si se debe usar una versión corta del día (por ejemplo, "Mon" en lugar de "Monday").
* @returns {string} La fecha formateada como un título.
*/
export const formatStringDate = (timeStamp, options) => {
export const formatDateTitle = (
timeStamp,
options = { showTime: false, showSeconds: false, shortDay: false }
) => {
if (!timeStamp) return '';
const { t, messages, locale } = i18n.global;
const { t } = i18n.global;
const timeFormat = options.showTime
? options.showSeconds
? ` [${t('at')}] hh:mm:ss`
: ` [${t('at')}] hh:mm`
? ` [${t('at')}] HH:mm:ss`
: ` [${t('at')}] HH:mm`
: '';
const day = options.shortDay ? 'dd' : 'dddd';
const formatString = `${day}, D [${t('of')}] MMMM [${t('of')}] YYYY${timeFormat}`;
const formattedString = qdate.formatDate(timeStamp, formatString, {
days: messages.value[locale.value].date.days,
months: messages.value[locale.value].date.months
});
const formattedString = formatDate(timeStamp, formatString);
return formattedString;
};

View File

@ -69,7 +69,11 @@ onBeforeUnmount(() => clearInterval(intervalId.value));
rounded
no-caps
class="q-mr-sm"
/>
>
<QTooltip>
{{ t('refresh') }}
</QTooltip>
</QBtn>
<QBadge class="q-pa-sm" v-if="connections.length" color="blue">
{{ connections?.length }} {{ t('connections') }}
</QBadge>
@ -121,7 +125,11 @@ onBeforeUnmount(() => clearInterval(intervalId.value));
flat
rounded
@click="supplantUser(connection.user)"
/>
>
<QTooltip>
{{ t('supplantUser') }}
</QTooltip>
</QBtn>
</template>
</CardList>
</QList>
@ -132,16 +140,21 @@ onBeforeUnmount(() => clearInterval(intervalId.value));
en-US:
refresh: Refresh
connections: Connections
supplantUser: Supplant user
es-ES:
refresh: Actualizar
connections: Conexiones
supplantUser: Suplantar usuario
ca-ES:
refresh: Actualitzar
connections: Connexions
supplantUser: Suplantar usuari
fr-FR:
refresh: Rafraîchir
connections: Connexions
supplantUser: Supplanter l'utilisateur
pt-PT:
refresh: Atualizar
connections: Conexões
supplantUser: Suplantar usuário
</i18n>

View File

@ -21,13 +21,13 @@ onMounted(async () => getLinks());
<template>
<QPage>
<QList class="flex justify-center">
<QList class="flex justify-center q-gutter-md">
<QItem
v-for="(link, index) in links"
:key="index"
:href="link.link"
target="_blank"
class="flex"
class="flex no-padding"
>
<QCard class="card-container">
<QImg

View File

@ -69,7 +69,9 @@ onMounted(async () => {
rounded
no-caps
@click="goBack()"
/>
>
<QTooltip>{{ t('back') }}</QTooltip>
</QBtn>
</Teleport>
<VnForm
ref="vnFormRef"
@ -88,15 +90,16 @@ onMounted(async () => {
>
<template #form="{ data }">
<VnImg
storage="catalog"
:id="data.image"
:edit-image-name="data.image"
storage="news"
edit-schema="news"
size="200x200"
width="80px"
height="80px"
class="full-width"
:id="data.image"
rounded
editable
edit-schema="catalog"
always-show-edit-button
/>
<VnInput

View File

@ -61,7 +61,9 @@ onMounted(async () => getNews());
:to="{ name: 'adminNewsDetails' }"
rounded
no-caps
/>
>
<QTooltip>{{ t('addNew') }}</QTooltip>
</QBtn>
</Teleport>
<QPage class="vn-w-xs">
<QList class="flex justify-center">
@ -80,15 +82,15 @@ onMounted(async () => getNews());
<template #prepend>
<VnImg
:id="newsItem.image"
:edit-image-name="newsItem.image"
storage="news"
editSchema="news"
edit-schema="news"
size="200x200"
width="80px"
height="80px"
class="q-mr-md"
rounded
editable
:editImageName="newsItem.image"
/>
</template>
<template #content>
@ -108,7 +110,9 @@ onMounted(async () => getNews());
() => deleteNew(newsItem.id, index)
)
"
/>
>
<QTooltip>{{ t('remove') }}</QTooltip>
</QBtn>
</template>
</CardList>
</QList>

View File

@ -6,7 +6,7 @@ import { date as qdate } from 'quasar';
import VnInputDate from 'src/components/common/VnInputDate.vue';
import { formatStringDate } from 'src/lib/filters.js';
import { formatDateTitle } from 'src/lib/filters.js';
import { useAppStore } from 'stores/app';
import { storeToRefs } from 'pinia';
@ -79,14 +79,22 @@ watch(
rounded
no-caps
class="q-mr-sm"
/>
>
<QTooltip>
{{ t('refresh') }}
</QTooltip>
</QBtn>
<QBtn
:label="t('connections')"
icon="visibility"
rounded
no-caps
:to="{ name: 'adminConnections' }"
/>
>
<QTooltip>
{{ t('connections') }}
</QTooltip>
</QBtn>
</Teleport>
<QPage class="vn-w-xs column">
<QCard class="column q-pa-lg q-mb-md">
@ -112,7 +120,7 @@ watch(
<span>{{ visitsCardText }}</span>
<span v-if="visitsData">
{{
formatStringDate(visitsData.lastVisit, {
formatDateTitle(visitsData.lastVisit, {
showTime: true,
showSeconds: true,
shortDay: true