This commit is contained in:
tree🌴 2023-11-24 13:16:13 +01:00
parent ba84d9ac5b
commit ceee85926a
2 changed files with 29 additions and 5 deletions

View file

@ -43,6 +43,23 @@ function dateEnd(str, days) {
return format(addDays(new Date(str), days), 'yyyy-MM-dd'); return format(addDays(new Date(str), days), 'yyyy-MM-dd');
} }
const statuses = {
preregistration: {
title: 'Pre-registration',
color: 'text-orange-500',
},
unconfirmed: {
title: 'Planned',
color: ''
},
confirmed: {
title: 'Confirmed',
color: 'text-green-500',
}
}
const status = item.confirmed ? statuses.confirmed : (item.links?.rsvp ? statuses.preregistration : statuses.unconfirmed)
--- ---
<div class="w3pn-event-item"> <div class="w3pn-event-item">
@ -66,11 +83,13 @@ function dateEnd(str, days) {
</div> </div>
</div> </div>
</div> </div>
{item.links?.rsvp && <div class="py-1 grow text-right items-center flex gap-4">
<div class="py-1 grow text-right"> <div class="grow"></div>
<a href={item.links?.rsvp} class="button inverted"><button>Join</button></a> {/*<div class="text-sm"></div>*/}
</div> {item.links?.rsvp &&
} <a href={item.links?.rsvp} class="button inverted"><button>Join</button></a>
}
</div>
</div> </div>
@ -79,6 +98,7 @@ function dateEnd(str, days) {
<div class="w-0 sm:w-28"></div> <div class="w-0 sm:w-28"></div>
<div> <div>
<div>Date: <span class="text-white">{dateFormat(item.date)} {item.days ? ' - ' + dateFormat(dateEnd(item.date, item.days)) + ` (${item.days} days)` : ''}</span></div> <div>Date: <span class="text-white">{dateFormat(item.date)} {item.days ? ' - ' + dateFormat(dateEnd(item.date, item.days)) + ` (${item.days} days)` : ''}</span></div>
<div>Status: <span class:list={[status.color]} class="mr-1.5 text-xs">●</span> {status.title}</div>
<div>Lead: <span class="text-white">{item.lead || 'n/a'}</span></div> <div>Lead: <span class="text-white">{item.lead || 'n/a'}</span></div>
<div class="mt-4 mb-2"> <div class="mt-4 mb-2">

View file

@ -57,6 +57,10 @@ for (const year of pastYears.reverse()) {
))} ))}
</div> </div>
))} ))}
<p>
<a href="https://github.com/web3privacy/events" class="hover:underline">Source repository</a>
</p>
</div> </div>
<script> <script>