Replace native with primary where possible

This commit is contained in:
Sander Dorigo
2025-08-01 12:31:01 +02:00
parent 65dcad6898
commit 6278662014
59 changed files with 430 additions and 430 deletions

View File

@@ -59,11 +59,11 @@
</div>
<div class="modal-body">
<div class="row mb-3">
<label class="col-sm-4 col-form-label">Convert to native</label>
<label class="col-sm-4 col-form-label">Convert to primary</label>
<div class="col-sm-8">
<div class="form-check form-switch form-check-inline">
<label>
<input class="form-check-input" x-model="convertToNative" type="checkbox" @change="saveNativeSettings"> <span
<input class="form-check-input" x-model="convertToPrimary" type="checkbox" @change="savePrimarySettings"> <span
>Yes no</span>
</label>
</div>

View File

@@ -75,7 +75,7 @@
<ul class="list-unstyled list-no-margin">
<template x-for="transaction in group.transactions">
<li>
@include('partials.elements.amount', ['convertToNative' => true,'type' => 'transaction.type','amount' => 'transaction.amount','native' => 'transaction.amount'])
@include('partials.elements.amount', ['convertToPrimary' => true,'type' => 'transaction.type','amount' => 'transaction.amount','primary' => 'transaction.amount'])
</li>
</template>
</ul>

View File

@@ -1,38 +1,38 @@
@if($convertToNative)
<template x-if="convertToNative">
@if($convertToPrimary)
<template x-if="convertToPrimary">
<span>
<template x-if="{{ $native }}_raw < 0">
<template x-if="{{ $primary }}_raw < 0">
<span class="text-danger">
<span x-text="{{ $native }}"></span>
<span x-text="{{ $primary }}"></span>
</span>
</template>
<template x-if="{{ $native }}_raw >= 0">
<template x-if="{{ $primary }}_raw >= 0">
<template x-if="'transfer' === {{ $type }}">
<span class="text-primary">
<span x-text="{{ $native }}"></span>
<span x-text="{{ $primary }}"></span>
</span>
</template>
<template x-if="'transfer' !== {{ $type }}">
<span class="text-success">
<span x-text="{{ $native }}"></span>
<span x-text="{{ $primary }}"></span>
</span>
</template>
</template>
</span>
</template>
<template x-if="!convertToNative">
<template x-if="!convertToPrimary">
<span>
<template x-if="{{ $amount }}_raw < 0">
<span>
<template x-if="'transfer' === {{ $type }}">
<span class="text-primary">
<span x-text="{{ $native }}"></span>
<span x-text="{{ $primary }}"></span>
</span>
</template>
<template x-if="'transfer' !== {{ $type }}">
<span class="text-danger">
<span x-text="{{ $native }}"></span>
<span x-text="{{ $primary }}"></span>
</span>
</template>
</span>
@@ -43,12 +43,12 @@
<span>
<template x-if="'transfer' === {{ $type }}">
<span class="text-primary">
<span x-text="{{ $native }}"></span>
<span x-text="{{ $primary }}"></span>
</span>
</template>
<template x-if="'transfer' !== {{ $type }}">
<span class="text-success">
<span x-text="{{ $native }}"></span>
<span x-text="{{ $primary }}"></span>
</span>
</template>
</span>

View File

@@ -8,8 +8,8 @@
<!-- is no longer loading currencies -->
<template x-if="!formStates.loadingCurrencies">
<select class="form-control" :id="'currency_code_' + index" x-model="transaction.currency_code">
<template x-for="currency in formData.nativeCurrencies">
<option :selected="currency.id == formData.defaultCurrency.id"
<template x-for="currency in formData.primaryCurrencies">
<option :selected="currency.id == formData.primaryCurrency.id"
:label="currency.name" :value="currency.code"
x-text="currency.name"></option>
</template>