ui improvements
This commit is contained in:
@@ -1,7 +1,28 @@
|
||||
<script setup lang="ts">
|
||||
import { Head, Link } from '@inertiajs/vue3';
|
||||
import { route } from 'ziggy-js';
|
||||
import AppLayout from '@/layouts/AppLayout.vue';
|
||||
|
||||
defineOptions({
|
||||
layout: {
|
||||
breadcrumbs: [
|
||||
{
|
||||
name: 'Dynamics',
|
||||
href: route('dynamics.index'),
|
||||
isCurrent: false,
|
||||
},
|
||||
{
|
||||
name: 'dynamic.name',
|
||||
href: 'route(\'dynamics.show\', dynamic.id)',
|
||||
isCurrent: false,
|
||||
},
|
||||
{
|
||||
name: 'participant.display_name',
|
||||
href: 'route(\'dynamics.users.show\', { dynamic: dynamic.id, user: participant.id })',
|
||||
isCurrent: true,
|
||||
},
|
||||
],
|
||||
},
|
||||
});
|
||||
|
||||
const props = defineProps<{
|
||||
dynamic: {
|
||||
@@ -43,44 +64,42 @@ const breadcrumbs = [
|
||||
<template>
|
||||
<Head :title="participant.display_name ?? participant.name" />
|
||||
|
||||
<AppLayout :breadcrumbs="breadcrumbs">
|
||||
<div class="c-participant-show">
|
||||
<div class="c-participant-show__container">
|
||||
<h2 class="c-participant-show__title">
|
||||
Activity for {{ participant.display_name ?? participant.name }} ({{ participant.role.toUpperCase() }}) in {{ dynamic.name }}
|
||||
</h2>
|
||||
<div class="c-participant-show">
|
||||
<div class="c-participant-show__container">
|
||||
<h2 class="c-participant-show__title">
|
||||
Activity for {{ participant.display_name ?? participant.name }} ({{ participant.role.toUpperCase() }}) in {{ dynamic.name }}
|
||||
</h2>
|
||||
|
||||
<div class="c-participant-show__activity-list">
|
||||
<div
|
||||
v-for="mutation in mutations"
|
||||
:key="mutation.id"
|
||||
class="c-participant-show__activity-item"
|
||||
>
|
||||
<Link :href="route('dynamics.ledgers.show', [dynamic.id, mutation.ledger.id])" class="block">
|
||||
<div class="c-participant-show__activity-meta">
|
||||
<span class="c-participant-show__activity-time">
|
||||
{{ new Date(mutation.created_at).toLocaleString() }}
|
||||
</span>
|
||||
<span class="font-semibold ml-2" :class="mutation.amount > 0 ? 'text-green-600 dark:text-green-400' : 'text-red-600 dark:text-red-400'">
|
||||
{{ mutation.amount > 0 ? '+' : '' }}{{ mutation.amount }}
|
||||
</span>
|
||||
<span class="text-neutral-400 ml-2">on {{ mutation.ledger.name }}</span>
|
||||
<span class="uppercase text-xs px-1.5 py-0.5 rounded ml-auto" :class="mutation.status === 'approved' ? 'bg-green-100 text-green-700 dark:bg-green-950/30 dark:text-green-400' : 'bg-yellow-100 text-yellow-700 dark:bg-yellow-950/30 dark:text-yellow-400'">
|
||||
{{ mutation.status }}
|
||||
</span>
|
||||
</div>
|
||||
<p class="c-participant-show__activity-desc">
|
||||
{{ mutation.description }}
|
||||
</p>
|
||||
</Link>
|
||||
</div>
|
||||
<div v-if="mutations.length === 0" class="text-neutral-500 text-sm">
|
||||
No mutations recorded for this participant in this Dynamic yet.
|
||||
</div>
|
||||
<div class="c-participant-show__activity-list">
|
||||
<div
|
||||
v-for="mutation in mutations"
|
||||
:key="mutation.id"
|
||||
class="c-participant-show__activity-item"
|
||||
>
|
||||
<Link :href="route('dynamics.ledgers.show', [dynamic.id, mutation.ledger.id])" class="block">
|
||||
<div class="c-participant-show__activity-meta">
|
||||
<span class="c-participant-show__activity-time">
|
||||
{{ new Date(mutation.created_at).toLocaleString() }}
|
||||
</span>
|
||||
<span class="font-semibold ml-2" :class="mutation.amount > 0 ? 'text-green-600 dark:text-green-400' : 'text-red-600 dark:text-red-400'">
|
||||
{{ mutation.amount > 0 ? '+' : '' }}{{ mutation.amount }}
|
||||
</span>
|
||||
<span class="text-neutral-400 ml-2">on {{ mutation.ledger.name }}</span>
|
||||
<span class="uppercase text-xs px-1.5 py-0.5 rounded ml-auto" :class="mutation.status === 'approved' ? 'bg-green-100 text-green-700 dark:bg-green-950/30 dark:text-green-400' : 'bg-yellow-100 text-yellow-700 dark:bg-yellow-950/30 dark:text-yellow-400'">
|
||||
{{ mutation.status }}
|
||||
</span>
|
||||
</div>
|
||||
<p class="c-participant-show__activity-desc">
|
||||
{{ mutation.description }}
|
||||
</p>
|
||||
</Link>
|
||||
</div>
|
||||
<div v-if="mutations.length === 0" class="text-neutral-500 text-sm">
|
||||
No mutations recorded for this participant in this Dynamic yet.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</AppLayout>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
|
||||
@@ -5,6 +5,23 @@ import LedgerList from '@/components/LedgerList.vue';
|
||||
import { Head, Link as InertiaLink } from '@inertiajs/vue3';
|
||||
import { route } from 'ziggy-js';
|
||||
|
||||
defineOptions({
|
||||
layout: {
|
||||
breadcrumbs: [
|
||||
{
|
||||
name: 'Dynamics',
|
||||
href: route('dynamics.index'),
|
||||
isCurrent: false,
|
||||
},
|
||||
{
|
||||
name: 'dynamic.name',
|
||||
href: 'route(\'dynamics.show\', dynamic.id)',
|
||||
isCurrent: true,
|
||||
},
|
||||
],
|
||||
},
|
||||
});
|
||||
|
||||
const props = defineProps<{
|
||||
dynamic: {
|
||||
id: number;
|
||||
@@ -65,7 +82,7 @@ const breadcrumbs = [
|
||||
<Chat :chat="dynamic.chat" :initial-messages="messages" :participants="dynamic.participants" :dynamic-id="dynamic.id" />
|
||||
|
||||
<!-- Participants Component -->
|
||||
<ParticipantsList :participants="dynamic.participants" />
|
||||
<ParticipantsList :dynamic-id="dynamic.id" :participants="dynamic.participants" />
|
||||
|
||||
<!-- Ledgers List Component -->
|
||||
<LedgerList :dynamic-id="dynamic.id" :ledgers="dynamic.ledgers" />
|
||||
|
||||
Reference in New Issue
Block a user