This commit is contained in:
Lizandro Guarnizo
2026-05-16 20:54:11 -05:00
parent f08416f11f
commit 562ffa4184
5 changed files with 44 additions and 6 deletions
+19 -3
View File
@@ -37,6 +37,7 @@
<option value="marketing">Marketing</option>
</select>
<textarea x-model="newR.descripcion" placeholder="Descripción breve..." rows="2" class="input-f sm:col-span-2"></textarea>
<input x-model="newR.enlace" type="url" placeholder="Enlace externo (opcional, ej: https://...)" class="input-f sm:col-span-2">
<label class="flex items-center gap-2 text-sm text-slate-600 cursor-pointer">
<input type="checkbox" x-model="newR.activo" class="rounded accent-[#8eb02f]">
Visible para partners
@@ -85,7 +86,22 @@
</template>
</td>
<!-- Descripción -->
<td class="px-4 py-3 hidden md:table-cell text-slate-500 text-xs max-w-xs truncate" x-text="r.descripcion"></td>
<td class="px-4 py-3 hidden md:table-cell text-slate-500 text-xs max-w-xs truncate">
<template x-if="editR?.ID === r.ID">
<div class="space-y-1">
<div x-text="r.descripcion" class="truncate"></div>
<input x-model="editR.enlace" type="url" placeholder="Enlace externo..." class="input-f text-xs w-full">
</div>
</template>
<template x-if="editR?.ID !== r.ID">
<div class="space-y-0.5">
<span x-text="r.descripcion"></span>
<template x-if="r.enlace">
<a :href="r.enlace" target="_blank" class="block text-[#8eb02f] hover:underline text-xs truncate" x-text="r.enlace"></a>
</template>
</div>
</template>
</td>
<!-- Archivo -->
<td class="px-4 py-3 text-center">
<template x-if="r.archivo">
@@ -243,7 +259,7 @@ function partnerRecursos() {
tab: 'recursos',
recursos: [],
comunicados: [],
newR: { nombre:'', descripcion:'', categoria:'general', activo:true },
newR: { nombre:'', descripcion:'', categoria:'general', enlace:'', activo:true },
newC: { titulo:'', contenido:'', activo:true },
editR: null,
editC: null,
@@ -267,7 +283,7 @@ function partnerRecursos() {
try {
const r = await axios.post('/app/partner-recursos', this.newR);
this.recursos.unshift(r.data);
this.newR = { nombre:'', descripcion:'', categoria:'general', activo:true };
this.newR = { nombre:'', descripcion:'', categoria:'general', enlace:'', activo:true };
} catch(e) { alert(e.response?.data?.error || 'Error al crear'); }
},