modificate contribution detail layout

This commit is contained in:
einhornimmond 2025-03-08 09:13:24 +01:00
parent 99a84cbb92
commit bd0c332612
6 changed files with 39 additions and 9 deletions

View File

@ -2,15 +2,17 @@
<div class="contribution-messages-list">
<BListGroup>
<BListGroupItem>
<a :href="mailtoLink">
{{ contribution.firstName }} {{ contribution.lastName }} &lt;{{ contribution.email }}&gt;
</a>
<routerLink :to="searchLink" :title="$t('goTo.userSearch')">
{{ contribution.firstName }} {{ contribution.lastName }}
</routerLink>
&nbsp;
{{
$t('contributionMessagesForm.hasRegisteredAt', {
createdAt: new Date(contribution.createdAt).toLocaleString(),
})
}}
<a :href="mailtoLink">{{ contribution.email }}</a>
&nbsp;
{{ contribution.username }}
&nbsp; Humhub-Profil
</BListGroupItem>
<BListGroupItem>
{{ $t('registered') }}: {{ new Date(contribution.createdAt).toLocaleString() }}
</BListGroupItem>
</BListGroup>
<BContainer>
@ -42,6 +44,7 @@ import { useQuery } from '@vue/apollo-composable'
import { adminListContributionMessages } from '../../graphql/adminListContributionMessages.js'
import { useAppToast } from '@/composables/useToast'
import { BListGroupItem } from 'bootstrap-vue-next'
const props = defineProps({
contribution: {
@ -63,6 +66,9 @@ const { toastError } = useAppToast()
const mailtoLink = computed(() => {
return `mailto:${props.contribution.email}`
})
const searchLink = computed(() => {
return `/user?search=${props.contribution.email}`
})
const messages = ref([])

View File

@ -27,6 +27,7 @@ export const adminListContributions = gql`
firstName
lastName
email
username
amount
memo
createdAt

View File

@ -119,6 +119,10 @@
"describe": "Teilt Koordinaten im Format 'Breitengrad, Längengrad' automatisch auf. Fügen sie hier einfach z.B. ihre Koordinaten von Google Maps, zum Beispiel: 49.28187664243721, 9.740672183943639, ein."
}
},
"goTo": {
"userSearch": "Zur Nutzersuche gehen",
"humhubProfile": "Zum Humhub Profil gehen"
},
"help": {
"help": "Hilfe",
"transactionlist": {
@ -226,6 +230,7 @@
},
"redeemed": "eingelöst",
"removeNotSelf": "Als Admin/Moderator kannst du dich nicht selber löschen.",
"registered": "Registriert",
"reset": "Zurücksetzen",
"save": "Speichern",
"statistic": {

View File

@ -119,6 +119,10 @@
"describe": "Automatically splits coordinates in the format 'latitude, longitude'. Simply enter your coordinates from Google Maps here, for example: 49.28187664243721, 9.740672183943639."
}
},
"goTo": {
"userSearch": "Go to user search",
"humhubProfile": "Go to Humhub profile"
},
"help": {
"help": "Help",
"transactionlist": {
@ -226,6 +230,7 @@
},
"redeemed": "redeemed",
"removeNotSelf": "As an admin/moderator, you cannot delete yourself.",
"registered": "Registered",
"reset": "Reset",
"save": "Save",
"statistic": {

View File

@ -43,8 +43,9 @@
</div>
</template>
<script setup>
import { ref, reactive, computed, watch, watchEffect } from 'vue'
import { ref, reactive, computed, watch, watchEffect, onMounted } from 'vue'
import { useQuery } from '@vue/apollo-composable'
import { useRoute } from 'vue-router'
import { searchUsers } from '../graphql/searchUsers.js'
import useCreationMonths from '../composables/useCreationMonths'
import SearchUserTable from '../components/Tables/SearchUserTable'
@ -68,6 +69,7 @@ const response = ref()
const { creationLabel } = useCreationMonths()
const { toastSuccess } = useAppToast()
const route = useRoute()
const { result, refetch } = useQuery(searchUsers, {
query: criteria.value,
@ -105,6 +107,13 @@ const deletedUserSearch = () => {
refetch()
}
onMounted(() => {
const searchQuery = route.query.search
if (searchQuery) {
criteria.value = searchQuery
}
})
const fields = computed(() => [
{ key: 'email', label: t('e_mail') },
{ key: 'firstName', label: t('firstname') },

View File

@ -10,6 +10,7 @@ export class Contribution {
this.firstName = user?.firstName ?? null
this.lastName = user?.lastName ?? null
this.email = user?.emailContact?.email ?? null
this.username = user?.alias ?? null
this.amount = contribution.amount
this.memo = contribution.memo
this.createdAt = contribution.createdAt
@ -41,6 +42,9 @@ export class Contribution {
@Field(() => String, { nullable: true })
email: string | null
@Field(() => String, { nullable: true })
username: string | null
@Field(() => Decimal)
amount: Decimal