Added button bar, cleaned up button styling.
This commit is contained in:
parent
074b4ded1d
commit
71e99d1c94
|
|
@ -139,7 +139,7 @@ struct Page(T) {
|
||||||
totalCount,
|
totalCount,
|
||||||
pageCount,
|
pageCount,
|
||||||
pageRequest.page == 1,
|
pageRequest.page == 1,
|
||||||
pageRequest.page == pageCount
|
pageRequest.page == pageCount || totalCount == 0
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,14 @@
|
||||||
|
<script setup lang="ts">
|
||||||
|
</script>
|
||||||
|
<template>
|
||||||
|
<div class="button-bar">
|
||||||
|
<slot></slot>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<style lang="css">
|
||||||
|
.button-bar {
|
||||||
|
display: flex;
|
||||||
|
justify-content: end;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -1,4 +1,7 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
import ButtonBar from '@/components/ButtonBar.vue';
|
||||||
|
|
||||||
|
|
||||||
defineProps<{ title: string }>()
|
defineProps<{ title: string }>()
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
|
|
@ -7,9 +10,9 @@ defineProps<{ title: string }>()
|
||||||
<h2 class="app-module-header">{{ title }}</h2>
|
<h2 class="app-module-header">{{ title }}</h2>
|
||||||
<slot></slot>
|
<slot></slot>
|
||||||
</div>
|
</div>
|
||||||
<div class="app-module-actions">
|
<ButtonBar>
|
||||||
<slot name="actions"></slot>
|
<slot name="actions"></slot>
|
||||||
</div>
|
</ButtonBar>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<style lang="css">
|
<style lang="css">
|
||||||
|
|
@ -28,8 +31,4 @@ defineProps<{ title: string }>()
|
||||||
.app-module-header {
|
.app-module-header {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.app-module-actions {
|
|
||||||
text-align: right;
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ import { getSelectedProfile } from '@/api/profile';
|
||||||
import AddValueRecordModal from '@/components/AddValueRecordModal.vue';
|
import AddValueRecordModal from '@/components/AddValueRecordModal.vue';
|
||||||
import AppButton from '@/components/AppButton.vue';
|
import AppButton from '@/components/AppButton.vue';
|
||||||
import AppPage from '@/components/AppPage.vue';
|
import AppPage from '@/components/AppPage.vue';
|
||||||
|
import ButtonBar from '@/components/ButtonBar.vue';
|
||||||
import AccountHistory from '@/components/history/AccountHistory.vue';
|
import AccountHistory from '@/components/history/AccountHistory.vue';
|
||||||
import PropertiesTable from '@/components/PropertiesTable.vue';
|
import PropertiesTable from '@/components/PropertiesTable.vue';
|
||||||
import { showConfirm } from '@/util/alert';
|
import { showConfirm } from '@/util/alert';
|
||||||
|
|
@ -88,13 +89,13 @@ async function addValueRecord() {
|
||||||
<td>{{ formatMoney(account.currentBalance, account.currency) }}</td>
|
<td>{{ formatMoney(account.currentBalance, account.currency) }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
</PropertiesTable>
|
</PropertiesTable>
|
||||||
<div>
|
<ButtonBar>
|
||||||
<AppButton @click="addValueRecord()">Record Value</AppButton>
|
<AppButton @click="addValueRecord()">Record Value</AppButton>
|
||||||
<AppButton icon="wrench"
|
<AppButton icon="wrench"
|
||||||
@click="router.push(`/profiles/${getSelectedProfile(route)}/accounts/${account?.id}/edit`)">
|
@click="router.push(`/profiles/${getSelectedProfile(route)}/accounts/${account?.id}/edit`)">
|
||||||
Edit</AppButton>
|
Edit</AppButton>
|
||||||
<AppButton icon="trash" @click="deleteAccount()">Delete</AppButton>
|
<AppButton icon="trash" @click="deleteAccount()">Delete</AppButton>
|
||||||
</div>
|
</ButtonBar>
|
||||||
|
|
||||||
<AccountHistory :account-id="account.id" v-if="account" />
|
<AccountHistory :account-id="account.id" v-if="account" />
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ import { getSelectedProfile } from '@/api/profile';
|
||||||
import { TransactionApiClient, type TransactionCategory, type TransactionCategoryTree } from '@/api/transaction';
|
import { TransactionApiClient, type TransactionCategory, type TransactionCategoryTree } from '@/api/transaction';
|
||||||
import AppButton from '@/components/AppButton.vue';
|
import AppButton from '@/components/AppButton.vue';
|
||||||
import AppPage from '@/components/AppPage.vue';
|
import AppPage from '@/components/AppPage.vue';
|
||||||
|
import ButtonBar from '@/components/ButtonBar.vue';
|
||||||
import CategoryDisplayItem from '@/components/CategoryDisplayItem.vue';
|
import CategoryDisplayItem from '@/components/CategoryDisplayItem.vue';
|
||||||
import EditCategoryModal from '@/components/EditCategoryModal.vue';
|
import EditCategoryModal from '@/components/EditCategoryModal.vue';
|
||||||
import { showConfirm } from '@/util/alert';
|
import { showConfirm } from '@/util/alert';
|
||||||
|
|
@ -76,9 +77,9 @@ async function addCategory() {
|
||||||
<CategoryDisplayItem v-for="category in categories" :key="category.id" :category="category" :editable="true"
|
<CategoryDisplayItem v-for="category in categories" :key="category.id" :category="category" :editable="true"
|
||||||
@edited="editCategory" @deleted="deleteCategory" />
|
@edited="editCategory" @deleted="deleteCategory" />
|
||||||
</div>
|
</div>
|
||||||
<div style="text-align: right;">
|
<ButtonBar>
|
||||||
<AppButton icon="plus" @click="addCategory()">Add Category</AppButton>
|
<AppButton icon="plus" @click="addCategory()">Add Category</AppButton>
|
||||||
</div>
|
</ButtonBar>
|
||||||
|
|
||||||
<EditCategoryModal ref="editCategoryModal" :category="editedCategory" />
|
<EditCategoryModal ref="editCategoryModal" :category="editedCategory" />
|
||||||
</AppPage>
|
</AppPage>
|
||||||
|
|
|
||||||
|
|
@ -5,11 +5,13 @@ pages.
|
||||||
-->
|
-->
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { AuthApiClient } from '@/api/auth';
|
import { AuthApiClient } from '@/api/auth';
|
||||||
|
import { getSelectedProfile } from '@/api/profile';
|
||||||
import { secondsUntilExpired } from '@/api/token-util';
|
import { secondsUntilExpired } from '@/api/token-util';
|
||||||
import { useAuthStore } from '@/stores/auth-store';
|
import { useAuthStore } from '@/stores/auth-store';
|
||||||
import { onMounted, ref, type Ref } from 'vue';
|
import { onMounted, ref, type Ref } from 'vue';
|
||||||
import { useRouter } from 'vue-router';
|
import { useRoute, useRouter } from 'vue-router';
|
||||||
|
|
||||||
|
const route = useRoute()
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const authStore = useAuthStore()
|
const authStore = useAuthStore()
|
||||||
|
|
||||||
|
|
@ -24,6 +26,14 @@ onMounted(async () => {
|
||||||
authCheckTimer.value = setInterval(checkAuth, 1000)
|
authCheckTimer.value = setInterval(checkAuth, 1000)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
function onHeaderClicked() {
|
||||||
|
try {
|
||||||
|
router.push('/profiles/' + getSelectedProfile(route))
|
||||||
|
} catch {
|
||||||
|
router.push('/')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
async function checkAuth() {
|
async function checkAuth() {
|
||||||
if (!authStore.state) {
|
if (!authStore.state) {
|
||||||
clearInterval(authCheckTimer.value)
|
clearInterval(authCheckTimer.value)
|
||||||
|
|
@ -51,7 +61,7 @@ async function checkAuth() {
|
||||||
<div>
|
<div>
|
||||||
<header class="app-header-bar">
|
<header class="app-header-bar">
|
||||||
<div>
|
<div>
|
||||||
<h1 class="app-header-text" @click="router.push('/')">Finnow</h1>
|
<h1 class="app-header-text" @click="onHeaderClicked()">Finnow</h1>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<span class="app-user-widget" @click="router.push('/me')">
|
<span class="app-user-widget" @click="router.push('/me')">
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ import { getSelectedProfile } from '@/api/profile';
|
||||||
import { TransactionApiClient, type TransactionVendor } from '@/api/transaction';
|
import { TransactionApiClient, type TransactionVendor } from '@/api/transaction';
|
||||||
import AppButton from '@/components/AppButton.vue';
|
import AppButton from '@/components/AppButton.vue';
|
||||||
import AppPage from '@/components/AppPage.vue';
|
import AppPage from '@/components/AppPage.vue';
|
||||||
|
import ButtonBar from '@/components/ButtonBar.vue';
|
||||||
import EditVendorModal from '@/components/EditVendorModal.vue';
|
import EditVendorModal from '@/components/EditVendorModal.vue';
|
||||||
import { showConfirm } from '@/util/alert';
|
import { showConfirm } from '@/util/alert';
|
||||||
import { onMounted, ref, useTemplateRef, type Ref } from 'vue';
|
import { onMounted, ref, useTemplateRef, type Ref } from 'vue';
|
||||||
|
|
@ -65,9 +66,9 @@ async function deleteVendor(vendor: TransactionVendor) {
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<div style="text-align: right;">
|
<ButtonBar>
|
||||||
<AppButton button-type="button" icon="plus" @click="addVendor()">Add Vendor</AppButton>
|
<AppButton button-type="button" icon="plus" @click="addVendor()">Add Vendor</AppButton>
|
||||||
</div>
|
</ButtonBar>
|
||||||
|
|
||||||
<EditVendorModal ref="editVendorModal" :vendor="editedVendor" />
|
<EditVendorModal ref="editVendorModal" :vendor="editedVendor" />
|
||||||
</AppPage>
|
</AppPage>
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ onMounted(async () => {
|
||||||
<td>{{ account.type }}</td>
|
<td>{{ account.type }}</td>
|
||||||
<td>
|
<td>
|
||||||
<span v-if="account.currentBalance">{{ formatMoney(account.currentBalance, account.currency) }}</span>
|
<span v-if="account.currentBalance">{{ formatMoney(account.currentBalance, account.currency) }}</span>
|
||||||
<span v-if="!account.currentBalance">Unknown</span>
|
<span v-if="!account.currentBalance">-</span>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|
|
||||||
|
|
@ -70,7 +70,7 @@ async function fetchPage(pageRequest: PageRequest) {
|
||||||
<PaginationControls :page="transactions" @update="pr => fetchPage(pr)"></PaginationControls>
|
<PaginationControls :page="transactions" @update="pr => fetchPage(pr)"></PaginationControls>
|
||||||
</template>
|
</template>
|
||||||
<template v-slot:actions>
|
<template v-slot:actions>
|
||||||
<AppButton size="sm" icon="plus" @click="router.push(`/profiles/${getSelectedProfile(route)}/add-transaction`)">
|
<AppButton icon="plus" @click="router.push(`/profiles/${getSelectedProfile(route)}/add-transaction`)">
|
||||||
Add
|
Add
|
||||||
Transaction</AppButton>
|
Transaction</AppButton>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue