Skip to content

Firefly III: a personal finances manager

Expand more views.

James Colef9f733f985c0
diff --git a/app/Http/Controllers/PreferencesController.php b/app/Http/Controllers/PreferencesController.php
index f8eb3e703d..9d2b0cd591 100644
--- a/app/Http/Controllers/PreferencesController.php
+++ b/app/Http/Controllers/PreferencesController.php
@@ -125,6 +125,13 @@ final class PreferencesController extends Controller
}
$fiscalYearStart = sprintf('%s-%s', Carbon::now()->format('Y'), (string) $fiscalYearStartStr);
$tjOptionalFields = Preferences::get('transaction_journal_optional_fields', [])->data;
+
+ // missing fields will give an error unless set, so:
+ $tjOptionalFields['external_url'] = $tjOptionalFields['external_url'] ?? false;
+ $tjOptionalFields['location'] = $tjOptionalFields['location'] ?? false;
+ $tjOptionalFields['links'] = $tjOptionalFields['links'] ?? false;
+
+
$availableDarkModes = config('firefly.available_dark_modes');
// notifications settings
diff --git a/app/Support/ExpandedForm.php b/app/Support/ExpandedForm.php
index 0abd117ca2..d1ef179f69 100644
--- a/app/Support/ExpandedForm.php
+++ b/app/Support/ExpandedForm.php
@@ -325,6 +325,23 @@ class ExpandedForm
return $html;
}
+ /**
+ * @throws FireflyException
+ */
+ public function hidden(string $name, mixed $value): string
+ {
+ try {
+ $html = view('form.hidden', ['name' => $name, 'value' => $value])->render();
+ } catch (Throwable $e) {
+ Log::debug(sprintf('Could not render hidden(): %s', $e->getMessage()));
+ $html = sprintf('Could not render hidden: %s', $e->getMessage());
+
+ throw new FireflyException($html, 0, $e);
+ }
+
+ return $html;
+ }
+
/**
* @throws FireflyException
*/
diff --git a/resources/assets/v1/src/components/passport/Clients.vue b/resources/assets/v1/src/components/passport/Clients.vue
index 786dc6c88f..4b4d6c1b9f 100644
--- a/resources/assets/v1/src/components/passport/Clients.vue
+++ b/resources/assets/v1/src/components/passport/Clients.vue
@@ -25,280 +25,7 @@
</style>
<template>
- <div>
- <div class="box box-default">
- <div class="box-header with-border">
- <h3 class="box-title">
- {{ $t('firefly.profile_oauth_clients') }}
- </h3>
- <a class="btn btn-default pull-right" tabindex="-1" @click="showCreateClientForm">
- {{ $t('firefly.profile_oauth_create_new_client') }}
- </a>
- </div>
- <div class="box-body">
- <!-- Current Clients -->
- <p>
- {{ $t('firefly.profile_oauth_clients_explain') }}
- </p>
- <p>
- {{ $t('firefly.profile_oauth_clients_external_auth') }}
- </p>
- <p v-if="clients.length === 0">
- {{ $t('firefly.profile_oauth_no_clients') }}
- </p>
- <table v-if="clients.length > 0" class="table table-responsive table-borderless mb-0">
- <caption>{{ $t('firefly.profile_oauth_clients_header') }}</caption>
- <thead>
- <tr>
- <th class="width-30" scope="col">{{ $t('firefly.profile_oauth_client_id') }}</th>
- <th class="width-30" scope="col">{{ $t('firefly.name') }}</th>
- <th class="width-40" scope="col" style="text-align:right">{{ $t('firefly.actions') }}</th>
- </tr>
- </thead>
- <tbody>
- <tr v-for="client in clients">
- <!-- ID -->
- <td style="vertical-align: middle;">
- {{ client.id }}
- </td>
-
- <!-- Name -->
- <td style="vertical-align: middle;">
- {{ client.name }}
- </td>
-
- <!-- Secret -->
- <td style="vertical-align: middle;text-align:right">
- <div class="btn-group">
- <a v-if="client.confidential" :title="$t('firefly.regenerate_secret')" class="btn btn-default btn-sm" @click="regenerateSecret(client)">
- <em :title="$t('firefly.regenerate_secret')" class="fa fa-retweet"></em>
- {{ $t('firefly.regenerate_secret') }}
- </a>
- <a class="btn btn-sm btn-default" :title="$t('firefly.edit')" tabindex="-1" @click="edit(client)">
- <em :title="$t('firefly.edit')" class="fa fa-pencil"></em>
- {{ $t('firefly.edit') }}
- </a>
- <a :title="$t('firefly.delete')" class="btn btn-sm btn-danger" @click="destroy(client)">
- <em :title="$t('firefly.delete')" class="fa fa-trash"></em>
- {{ $t('firefly.delete') }}
- </a>
- </div>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- <div class="box-footer">
- <a class="btn btn-default pull-right" tabindex="-1" @click="showCreateClientForm">
- {{ $t('firefly.profile_oauth_create_new_client') }}
- </a>
- </div>
- </div>
-
- <!-- Create Client Modal -->
- <div id="modal-create-client" class="modal fade" role="dialog" tabindex="-1">
- <div class="modal-dialog">
- <div class="modal-content">
- <div class="modal-header">
- <h4 class="modal-title">
- {{ $t('firefly.profile_oauth_create_client') }}
- </h4>
-
- <button aria-hidden="true" class="close" data-dismiss="modal" type="button">&times;</button>
- </div>
-
- <div class="modal-body">
- <!-- Form Errors -->
- <div v-if="createForm.errors.length > 0" class="alert alert-danger">
- <p class="mb-0"><strong>{{ $t('firefly.profile_whoops') }}</strong> {{
- $t('firefly.profile_something_wrong')
- }}</p>
- <br>
- <ul>
- <li v-for="error in createForm.errors">
- {{ error }}
- </li>
- </ul>
- </div>
-
- <!-- Create Client Form -->
- <form role="form" aria-label="form">
- <!-- Name -->
- <div class="form-group row">
- <label class="col-md-3 col-form-label">{{ $t('firefly.name') }}</label>
-
- <div class="col-md-9">
- <input id="create-client-name" v-model="createForm.name" class="form-control"
- spellcheck="false"
- type="text" @keyup.enter="store">
-
- <span class="form-text text-muted">
- {{ $t('firefly.profile_oauth_name_help') }}
- </span>
- </div>
- </div>
-
- <!-- Redirect URIs -->
- <div class="form-group row">
- <label class="col-md-3 col-form-label">{{
- $t('firefly.profile_oauth_redirect_url')
- }}</label>
-
- <div class="col-md-9">
- <input v-model="createForm.redirect_uris" class="form-control" name="redirect_uris"
- spellcheck="false"
- type="text" @keyup.enter="store">
-
- <span class="form-text text-muted">
- {{ $t('firefly.profile_oauth_redirect_url_help') }}
- </span>
- </div>
- </div>
-
- <!-- Confidential -->
- <div class="form-group row">
- <label class="col-md-3 col-form-label">{{
- $t('firefly.profile_oauth_confidential')
- }}</label>
-
- <div class="col-md-9">
- <div class="checkbox">
- <label>
- <input v-model="createForm.confidential" type="checkbox">
- </label>
- </div>
-
- <span class="form-text text-muted">
- {{ $t('firefly.profile_oauth_confidential_help') }}
- </span>
- </div>
- </div>
- </form>
- </div>
-
- <!-- Modal Actions -->
- <div class="modal-footer">
- <button class="btn btn-secondary" data-dismiss="modal" type="button">{{
- $t('firefly.close')
- }}
- </button>
-
- <button class="btn btn-primary" type="button" @click="store">
- {{ $t('firefly.profile_create') }}
- </button>
- </div>
- </div>
- </div>
- </div>
-
- <!-- Edit Client Modal -->
- <div id="modal-edit-client" class="modal fade" role="dialog" tabindex="-1">
- <div class="modal-dialog">
- <div class="modal-content">
- <div class="modal-header">
- <h4 class="modal-title">
- {{ $t('firefly.profile_oauth_edit_client') }}
- </h4>
-
- <button aria-hidden="true" class="close" data-dismiss="modal" type="button">&times;</button>
- </div>
-
- <div class="modal-body">
- <!-- Form Errors -->
- <div v-if="editForm.errors.length > 0" class="alert alert-danger">
- <p class="mb-0"><strong>{{ $t('firefly.profile_whoops') }}</strong> {{
- $t('firefly.profile_something_wrong')
- }}</p>
- <br>
- <ul>
- <li v-for="error in editForm.errors">
- {{ error }}
- </li>
- </ul>
- </div>
-
- <!-- Edit Client Form -->
- <form role="form" aria-label="form">
- <!-- Name -->
- <div class="form-group row">
- <label class="col-md-3 col-form-label">{{ $t('firefly.name') }}</label>
-
- <div class="col-md-9">
- <input id="edit-client-name" v-model="editForm.name" class="form-control"
- spellcheck="false"
- type="text" @keyup.enter="update">
-
- <span class="form-text text-muted">
- {{ $t('firefly.profile_oauth_name_help') }}
- </span>
- </div>
- </div>
-
- <!-- Redirect URL -->
- <div class="form-group row">
- <label class="col-md-3 col-form-label">{{
- $t('firefly.profile_oauth_redirect_url')
- }}</label>
-
- <div class="col-md-9">
- <input v-model="editForm.redirect_uris" class="form-control" name="redirect_uris"
- spellcheck="false"
- type="text" @keyup.enter="update">
-
- <span class="form-text text-muted">
- {{ $t('firefly.profile_oauth_redirect_url_help') }}
- </span>
- </div>
- </div>
- </form>
- </div>
-
- <!-- Modal Actions -->
- <div class="modal-footer">
- <button class="btn btn-secondary" data-dismiss="modal" type="button">{{
- $t('firefly.close')
- }}
- </button>
-
- <button class="btn btn-primary" type="button" @click="update">
- {{ $t('firefly.profile_save_changes') }}
- </button>
- </div>
- </div>
- </div>
- </div>
-
- <!-- Client Secret Modal -->
- <div id="modal-client-secret" class="modal fade" role="dialog" tabindex="-1">
- <div class="modal-dialog">
- <div class="modal-content">
- <div class="modal-header">
- <h4 class="modal-title">
- {{ $t('firefly.profile_oauth_client_secret_title') }}
- </h4>
-
- <button aria-hidden="true" class="close" data-dismiss="modal" type="button">&times;</button>
- </div>
-
- <div class="modal-body">
- <p>
- {{ $t('firefly.profile_oauth_client_secret_expl') }}
- </p>
- <input id="secret_box" v-model="clientSecret" class="form-control" type="text" spellcheck="false">
- </div>
-
- <!-- Modal Actions -->
- <div class="modal-footer">
- <button class="btn btn-secondary" data-dismiss="modal" type="button">{{
- $t('firefly.close')
- }}
- </button>
- </div>
- </div>
- </div>
- </div>
- </div>
</template>
<script>
@@ -346,142 +73,14 @@ export default {
* Prepare the component.
*/
prepareComponent() {
- this.getClients();
-
- $('#modal-create-client').on('shown.bs.modal', () => {
- $('#create-client-name').focus();
- });
-
- $('#modal-edit-client').on('shown.bs.modal', () => {
- $('#edit-client-name').focus();
- });
- const textBox = document.getElementById("secret_box");
- textBox.onfocus = function () {
- textBox.select();
-
- // Work around Chrome's little problem
- textBox.onmouseup = function () {
- // Prevent further mouseup intervention
- textBox.onmouseup = null;
- return false;
- };
- };
- },
-
- /**
- * Get all of the OAuth clients for the user.
- */
- getClients() {
- axios.get('./oauth/clients')
- .then(response => {
- console.log(response.data);
- this.clients = response.data;
- });
- },
-
- /**
- * Show the form for creating new clients.
- */
- showCreateClientForm() {
- $('#modal-create-client').modal('show');
- },
-
- /**
- * Create a new OAuth client for the user.
- */
- store() {
- this.persistClient(
- 'post',
- './oauth/clients',
- this.createForm,
- '#modal-create-client'
- );
- },
-
- /**
- * Edit the given client.
- */
- edit(client) {
- this.editForm.id = client.id;
- this.editForm.name = client.name;
- this.editForm.redirect_uris = client.redirect_uris.join(',');
-
- $('#modal-edit-client').modal('show');
- },
- /**
- * Update the client being edited.
- */
- update() {
- this.persistClient(
- 'put',
- './oauth/clients/' + this.editForm.id,
- this.editForm,
- '#modal-edit-client'
- );
},
- /**
- * Persist the client to storage using the given form.
- */
- persistClient(method, uri, form, modal) {
- form.errors = [];
- axios[method](uri, form)
- .then(response => {
- this.getClients();
- form.name = '';
- form.redirect_uris = '';
- form.errors = [];
- $(modal).modal('hide');
- if (response.data.plainSecret) {
- this.showClientSecret(response.data.plainSecret);
- }
- })
- .catch(error => {
- if (typeof error.response.data === 'object') {
- for (const [key, value] of Object.entries(error.response.data.errors)) {
- console.log(`${key}: ${value}`);
- form.errors.push(value);
- }
- } else {
- form.errors = ['Something went wrong. Please try again.'];
- }
- console.log(form.errors);
- });
- },
-
- /**
- * Show the given client secret to the user.
- */
- showClientSecret(clientSecret) {
- this.clientSecret = clientSecret;
-
- $('#modal-client-secret').modal('show');
- },
- regenerateSecret(client) {
- axios.post('./oauth/clients/regenerate/' + client.id)
- .then(response => {
- this.clientSecret = response.data.plainSecret;
-
- $('#modal-client-secret').modal('show');
- });
-
- },
-
- /**
- * Destroy the given client.
- */
- destroy(client) {
- axios.delete('./oauth/clients/' + client.id)
- .then(response => {
- this.getClients();
- });
- }
}
}
</script>
diff --git a/resources/assets/v1/src/components/passport/PersonalAccessTokens.vue b/resources/assets/v1/src/components/passport/PersonalAccessTokens.vue
index 28e23fd51d..5fd746ea63 100644
--- a/resources/assets/v1/src/components/passport/PersonalAccessTokens.vue
+++ b/resources/assets/v1/src/components/passport/PersonalAccessTokens.vue
@@ -25,168 +25,7 @@
</style>
<template>
- <div>
- <div>
- <div class="box box-default">
- <div class="box-header">
- <h3 class="box-title">{{ $t('firefly.profile_personal_access_tokens') }}</h3>
- <a class="btn btn-default pull-right" tabindex="-1" @click="showCreateTokenForm">
- {{ $t('firefly.profile_create_new_token') }}
- </a>
- </div>
- <div class="box-body">
- <p>
- {{ $t('firefly.explain_pats') }}
- </p>
-
- <p v-if="tokens.length === 0" class="mb-0">
- {{ $t('firefly.profile_no_personal_access_token') }}
- </p>
-
- <!-- Personal Access Tokens -->
- <table v-if="tokens.length > 0" class="table table-responsive table-borderless mb-0">
- <caption style="display:none;">{{ $t('firefly.profile_personal_access_tokens') }}</caption>
- <thead>
- <tr>
- <th scope="col">{{ $t('firefly.name') }}</th>
- <th scope="col">{{ $t('firefly.expires_at') }}</th>
- <th scope="col"></th>
- </tr>
- </thead>
-
- <tbody>
- <tr v-for="token in tokens">
- <!-- Client Name -->
- <td style="vertical-align: middle;">
- {{ token.name }}
- </td>
- <!-- expires at -->
- <td style="vertical-align: middle;">
- {{ new Date(token.expires_at).toLocaleString() }}
- </td>
-
- <!-- Delete Button -->
- <td style="vertical-align: middle;">
- <a class="action-link text-danger" @click="revoke(token)">
- {{ $t('firefly.delete') }}
- </a>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- <div class="box-footer">
- <a class="btn btn-default pull-right" tabindex="-1" @click="showCreateTokenForm">
- {{ $t('firefly.profile_create_new_token') }}
- </a>
- </div>
- </div>
- </div>
-
- <!-- Create Token Modal -->
- <div id="modal-create-token" class="modal fade" role="dialog" tabindex="-1">
- <div class="modal-dialog">
- <div class="modal-content">
- <div class="modal-header">
- <h4 class="modal-title">
- {{ $t('firefly.profile_create_token') }}
- </h4>
-
- <button aria-hidden="true" class="close" data-dismiss="modal" type="button">&times;</button>
- </div>
-
- <div class="modal-body">
- <!-- Form Errors -->
- <div v-if="form.errors.length > 0" class="alert alert-danger">
- <p class="mb-0"><strong>{{ $t('firefly.profile_whoops') }}</strong>
- {{ $t('firefly.profile_something_wrong') }}</p>
- <br>
- <ul>
- <li v-for="error in form.errors">
- {{ error }}
- </li>
- </ul>
- </div>
-
- <!-- Create Token Form -->
- <form role="form" @submit.prevent="store">
- <!-- Name -->
- <div class="form-group row">
- <label class="col-md-4 col-form-label">{{ $t('firefly.name') }}</label>
-
- <div class="col-md-6">
- <input id="create-token-name" v-model="form.name" class="form-control" name="name"
- type="text" spellcheck="false">
- </div>
- </div>
-
- <!-- Scopes -->
- <div v-if="scopes.length > 0" class="form-group row">
- <label class="col-md-4 col-form-label">{{ $t('firefly.profile_scopes') }}</label>
-
- <div class="col-md-6">
- <div v-for="scope in scopes">
- <div class="checkbox">
- <label>
- <input :checked="scopeIsAssigned(scope.id)"
- type="checkbox"
- @click="toggleScope(scope.id)">
-
- {{ scope.id }}
- </label>
- </div>
- </div>
- </div>
- </div>
- </form>
- </div>
-
- <!-- Modal Actions -->
- <div class="modal-footer">
- <button class="btn btn-secondary" data-dismiss="modal" type="button">{{
- $t('firefly.close')
- }}
- </button>
-
- <button class="btn btn-primary" type="button" @click="store">
- Create
- </button>
- </div>
- </div>
- </div>
- </div>
-
- <!-- Access Token Modal -->
- <div id="modal-access-token" class="modal fade" role="dialog" tabindex="-1">
- <div class="modal-dialog">
- <div class="modal-content">
- <div class="modal-header">
- <h4 class="modal-title">
- {{ $t('firefly.profile_personal_access_token') }}
- </h4>
-
- <button aria-hidden="true" class="close" data-dismiss="modal" type="button">&times;</button>
- </div>
-
- <div class="modal-body">
- <p>
- {{ $t('firefly.profile_personal_access_token_explanation') }}
- </p>
- <textarea class="form-control" id="token_box" readonly rows="20" style="width:100%;">{{ accessToken }}</textarea>
- </div>
-
- <!-- Modal Actions -->
- <div class="modal-footer">
- <button class="btn btn-secondary" data-dismiss="modal" type="button">{{
- $t('firefly.close')
- }}
- </button>
- </div>
- </div>
- </div>
- </div>
- </div>
</template>
<script>
@@ -196,16 +35,7 @@ export default {
*/
data() {
return {
- accessToken: null,
-
- tokens: [],
- scopes: [],
- form: {
- name: '',
- scopes: [],
- errors: []
- }
};
},
@@ -230,126 +60,15 @@ export default {
* Prepare the component.
*/
prepareComponent() {
- console.log('prepareComponent()');
- this.getTokens();
// this.getScopes();
- $('#modal-create-token').on('shown.bs.modal', () => {
- $('#create-token-name').focus();
- });
- const textBox = document.getElementById("token_box");
- textBox.onfocus = function () {
- textBox.select();
- // Work around Chrome's little problem
- textBox.onmouseup = function () {
- // Prevent further mouseup intervention
- textBox.onmouseup = null;
- return false;
- };
- };
- },
- /**
- * Get all of the personal access tokens for the user.
- */
- getTokens() {
- console.log('getTokens()');
- axios.get('./oauth/personal-access-tokens')
- .then(response => {
- console.log(response.data);
- this.tokens = response.data;
- });
},
- /**
- * Get all the available scopes.
- */
- getScopes() {
- console.log('getScopes()');
- axios.get('./oauth/scopes')
- .then(response => {
- this.scopes = response.data;
- });
- },
- /**
- * Show the form for creating new tokens.
- */
- showCreateTokenForm() {
- console.log('showCreateTokenForm()');
- $('#modal-create-token').modal('show');
- },
-
- /**
- * Create a new personal access token.
- */
- store() {
- console.log('store()');
- this.accessToken = null;
-
- this.form.errors = [];
-
- axios.post('./oauth/personal-access-tokens', this.form)
- .then(response => {
- console.log('Successful POST new token, reset form content.');
- this.form.name = '';
- this.form.scopes = [];
- this.form.errors = [];
- this.getTokens();
- this.showAccessToken(response.data.accessToken);
-
- })
- .catch(error => {
- console.warn('Bad POST new token, show error.');
- if (typeof error.response.data === 'object') {
- this.form.errors = _.flatten(_.toArray(error.response.data.errors));
- } else {
- this.form.errors = ['Something went wrong. Please try again.'];
- }
- });
- },
-
- /**
- * Toggle the given scope in the list of assigned scopes.
- */
- toggleScope(scope) {
- if (this.scopeIsAssigned(scope)) {
- this.form.scopes = _.reject(this.form.scopes, s => s == scope);
- } else {
- this.form.scopes.push(scope);
- }
- },
- /**
- * Determine if the given scope has been assigned to the token.
- */
- scopeIsAssigned(scope) {
- return _.indexOf(this.form.scopes, scope) >= 0;
- },
-
- /**
- * Show the given access token to the user.
- */
- showAccessToken(accessToken) {
- console.log('showAccessToken');
- $('#modal-create-token').modal('hide');
-
- this.accessToken = accessToken;
-
- $('#modal-access-token').modal('show');
- },
-
- /**
- * Revoke the given token.
- */
- revoke(token) {
- axios.delete('./oauth/personal-access-tokens/' + token.id)
- .then(response => {
- this.getTokens();
- });
- }
}
}
</script>
diff --git a/resources/assets/v3/js/pages/generic.js b/resources/assets/v3/js/pages/generic.js
index cad2a829fc..90d03b702b 100644
--- a/resources/assets/v3/js/pages/generic.js
+++ b/resources/assets/v3/js/pages/generic.js
@@ -18,7 +18,6 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
-// CSS
import '../boot/bootstrap.js';
import sidebar from '../pages/shared/sidebar.js';
import dates from './shared/dates.js';
diff --git a/resources/assets/v3/js/pages/profile/oauth.js b/resources/assets/v3/js/pages/profile/oauth.js
new file mode 100644
index 0000000000..a439f0e076
--- /dev/null
+++ b/resources/assets/v3/js/pages/profile/oauth.js
@@ -0,0 +1,303 @@
+/*
+ * oauth.js
+ * Copyright (c) 2026 [email protected]
+ *
+ * This file is part of Firefly III (https://github.com/firefly-iii).
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
+import '../../boot/bootstrap.js';
+import sidebar from '../../pages/shared/sidebar.js';
+import dates from '../shared/dates.js';
+import i18next from "i18next";
+
+let index = function () {
+ return {
+ clients: [],
+ i18next: null,
+
+ clientSecret: null,
+
+ createForm: {
+ errors: [],
+ name: '',
+ redirect_uris: '',
+ confidential: true
+ },
+
+ editForm: {
+ errors: [],
+ name: '',
+ redirect_uris: ''
+ },
+
+ accessToken: null,
+
+ tokens: [],
+ scopes: [],
+
+ form: {
+ name: '',
+ scopes: [],
+ errors: []
+ },
+ // showCreateTokenForm
+
+
+
+ init() {
+ this.i18next = i18next;
+ this.getClients();
+ this.getTokens();
+
+ $('#modal-create-token').on('shown.bs.modal', () => {
+ $('#create-token-name').focus();
+ });
+ $('#modal-create-client').on('shown.bs.modal', () => {
+ $('#create-client-name').focus();
+ });
+
+ $('#modal-edit-client').on('shown.bs.modal', () => {
+ $('#edit-client-name').focus();
+ });
+ const textBox = document.getElementById("secret_box");
+ textBox.onfocus = function () {
+ textBox.select();
+
+ // Work around Chrome's little problem
+ textBox.onmouseup = function () {
+ // Prevent further mouseup intervention
+ textBox.onmouseup = null;
+ return false;
+ };
+ };
+
+ const tokenBox = document.getElementById("token_box");
+ tokenBox.onfocus = function () {
+ tokenBox.select();
+
+ // Work around Chrome's little problem
+ tokenBox.onmouseup = function () {
+ // Prevent further mouseup intervention
+ tokenBox.onmouseup = null;
+ return false;
+ };
+ };
+ },
+ /**
+ * Get all of the personal access tokens for the user.
+ */
+ getTokens() {
+ console.log('getTokens()');
+ axios.get('./oauth/personal-access-tokens')
+ .then(response => {
+ console.log(response.data);
+ this.tokens = response.data;
+ });
+ },
+
+ /**
+ * Show the form for creating new tokens.
+ */
+ showCreateTokenForm() {
+ console.log('showCreateTokenForm()');
+ $('#modal-create-token').modal('show');
+ },
+
+ /**
+ * Create a new personal access token.
+ */
+ storePat() {
+ console.log('storePat()');
+ this.accessToken = null;
+
+ this.form.errors = [];
+
+ axios.post('./oauth/personal-access-tokens', this.form)
+ .then(response => {
+ console.log('Successful POST new token, reset form content.');
+ this.form.name = '';
+ this.form.scopes = [];
+ this.form.errors = [];
+
+ this.getTokens();
+ this.showAccessToken(response.data.accessToken);
+
+ })
+ .catch(error => {
+ console.warn('Bad POST new token, show error.');
+ if (typeof error.response.data === 'object') {
+ this.form.errors = _.flatten(_.toArray(error.response.data.errors));
+ } else {
+ this.form.errors = ['Something went wrong. Please try again.'];
+ }
+ });
+ },
+
+
+ /**
+ * Show the given access token to the user.
+ */
+ showAccessToken(accessToken) {
+ console.log('showAccessToken');
+ $('#modal-create-token').modal('hide');
+
+ this.accessToken = accessToken;
+
+ $('#modal-access-token').modal('show');
+ },
+ getClients() {
+ axios.get('./oauth/clients')
+ .then(response => {
+ console.log(response.data);
+ this.clients = response.data;
+ });
+ },
+ showCreateClientForm() {
+ $('#modal-create-client').modal('show');
+ },
+ /**
+ * Persist the client to storage using the given form.
+ */
+ persistClient(method, uri, form, modal) {
+ form.errors = [];
+
+ axios[method](uri, form)
+ .then(response => {
+ this.getClients();
+
+ form.name = '';
+ form.redirect_uris = '';
+ form.errors = [];
+
+ $(modal).modal('hide');
+
+ if (response.data.plainSecret) {
+ this.showClientSecret(response.data.plainSecret);
+ }
+ })
+ .catch(error => {
+
+ if (typeof error.response.data === 'object') {
+ for (const [key, value] of Object.entries(error.response.data.errors)) {
+ console.log(`${key}: ${value}`);
+ form.errors.push(value);
+ }
+ } else {
+ form.errors = ['Something went wrong. Please try again.'];
+ }
+ console.log(form.errors);
+ });
+ },
+ /**
+ * Revoke the given token.
+ */
+ revoke(token) {
+ axios.delete('./oauth/personal-access-tokens/' + token.id)
+ .then(response => {
+ this.getTokens();
+ });
+ },
+
+ /**
+ * Show the given client secret to the user.
+ */
+ showClientSecret(clientSecret) {
+ this.clientSecret = clientSecret;
+
+ $('#modal-client-secret').modal('show');
+ },
+ regenerateSecret(client) {
+ axios.post('./oauth/clients/regenerate/' + client.id)
+ .then(response => {
+ this.clientSecret = response.data.plainSecret;
+
+ $('#modal-client-secret').modal('show');
+ });
+
+ },
+
+ /**
+ * Destroy the given client.
+ */
+ destroy(client) {
+ axios.delete('./oauth/clients/' + client.id)
+ .then(response => {
+ this.getClients();
+ });
+ },
+ /**
+ * Create a new OAuth client for the user.
+ */
+ store() {
+ this.persistClient(
+ 'post',
+ './oauth/clients',
+ this.createForm,
+ '#modal-create-client'
+ );
+ },
+ /**
+ * Edit the given client.
+ */
+ edit(client) {
+ this.editForm.id = client.id;
+ this.editForm.name = client.name;
+ this.editForm.redirect_uris = client.redirect_uris.join(',');
+
+ $('#modal-edit-client').modal('show');
+ },
+
+ /**
+ * Update the client being edited.
+ */
+ update() {
+ this.persistClient(
+ 'put',
+ './oauth/clients/' + this.editForm.id,
+ this.editForm,
+ '#modal-edit-client'
+ );
+ },
+ }
+};
+
+
+const comps = {
+ index,
+ sidebar,
+ dates
+};
+
+function loadPage(comps) {
+ console.log('loadPage');
+ Object.keys(comps).forEach(comp => {
+ let data = comps[comp]();
+ Alpine.data(comp, () => data);
+ console.log(comp);
+ });
+ Alpine.start();
+}
+
+// wait for load until bootstrapped event is received.
+document.addEventListener('firefly-iii-bootstrapped', () => {
+ console.log('Loaded through event listener.');
+ loadPage(comps);
+});
+// or is bootstrapped before event is triggered.
+if (window.bootstrapped) {
+ console.log('Loaded through window variable.');
+ loadPage(comps);
+}
diff --git a/resources/assets/v3/vite.config.js b/resources/assets/v3/vite.config.js
index 5d9789e172..efd1111bc0 100644
--- a/resources/assets/v3/vite.config.js
+++ b/resources/assets/v3/vite.config.js
@@ -65,6 +65,9 @@ export default defineConfig(({command, mode, isSsrBuild, isPreview}) => {
// object groups
+ // profile
+ 'js/pages/profile/oauth.js',
+
// rules
// recurring transactions
diff --git a/resources/views/attachments/delete.blade.php b/resources/views/attachments/delete.blade.php
index 360d98ec5a..bbbb6b00e9 100644
--- a/resources/views/attachments/delete.blade.php
+++ b/resources/views/attachments/delete.blade.php
@@ -17,8 +17,8 @@
{{ trans('form.attachment_areYouSure', ['name' => $attachment->filename]) }}
</p>
</div>
- <div class="card-footer">
- <input type="submit" name="submit" value="{{ trans('form.deletePermanently') }}" class="btn text-end btn-danger"/>
+ <div class="card-footer text-end">
+ <input type="submit" name="submit" value="{{ trans('form.deletePermanently') }}" class="btn btn-danger"/>
<a href="{{ URL::previous() }}" class="btn-outline-secondary btn">{{ trans('form.cancel') }}</a>
</div>
</div>
diff --git a/resources/views/budgets/create.blade.php b/resources/views/budgets/create.blade.php
index 411034ed8b..d3338250d3 100644
--- a/resources/views/budgets/create.blade.php
+++ b/resources/views/budgets/create.blade.php
@@ -41,8 +41,8 @@
<div class="card-body">
{!! ExpandedForm::optionsList('create','budget') !!}
</div>
- <div class="card-footer">
- <button type="submit" class="btn text-end btn-success">{{ __('firefly.store_new_budget') }}</button>
+ <div class="card-footer text-end">
+ <button type="submit" class="btn btn-success">{{ __('firefly.store_new_budget') }}</button>
</div>
</div>
</div>
diff --git a/resources/views/budgets/edit.blade.php b/resources/views/budgets/edit.blade.php
index b1a5c33b6a..df1cf96ff9 100644
--- a/resources/views/budgets/edit.blade.php
+++ b/resources/views/budgets/edit.blade.php
@@ -44,8 +44,8 @@
<div class="card-body">
{!! ExpandedForm::optionsList('update','budget') !!}
</div>
- <div class="card-footer">
- <button type="submit" class="btn text-end btn-success">{{ __('firefly.update_budget') }}</button>
+ <div class="card-footer text-end">
+ <button type="submit" class="btn btn-success">{{ __('firefly.update_budget') }}</button>
</div>
</div>
</div>
diff --git a/resources/views/budgets/index.blade.php b/resources/views/budgets/index.blade.php
index dd7baf09d0..188964d6ca 100644
--- a/resources/views/budgets/index.blade.php
+++ b/resources/views/budgets/index.blade.php
@@ -402,8 +402,8 @@
<div class="card-header with-border">
<h3 class="card-title">{{ __('firefly.createBudget') }}</h3>
</div>
- <div class="card-body">
- <a href="{{ route('budgets.create') }}" class="btn btn-success text-end">{{ __('firefly.createBudget') }}</a>
+ <div class="card-body text-end">
+ <a href="{{ route('budgets.create') }}" class="btn btn-success">{{ __('firefly.createBudget') }}</a>
</div>
</div>
</div>
diff --git a/resources/views/budgets/no-budget.blade.php b/resources/views/budgets/no-budget.blade.php
index 5641ac2762..9d318cd940 100644
--- a/resources/views/budgets/no-budget.blade.php
+++ b/resources/views/budgets/no-budget.blade.php
@@ -16,7 +16,7 @@
<div class="card-header">
<h3 class="card-title">{{ $subTitle }}</h3>
</div>
- <div class="box-body ">
+ <div class="card-body">
@if(null !== ($periods ?? null) && count($periods) > 0)
<x-lists.groups-large :groups="$groups" />
diff --git a/resources/views/categories/create.blade.php b/resources/views/categories/create.blade.php
index 90d267c41c..ad615c6193 100644
--- a/resources/views/categories/create.blade.php
+++ b/resources/views/categories/create.blade.php
@@ -36,8 +36,8 @@
<div class="card-body">
{!! ExpandedForm::optionsList('create','category') !!}
</div>
- <div class="card-footer">
- <button type="submit" class="btn text-end btn-success">
+ <div class="card-footer text-end">
+ <button type="submit" class="btn btn-success">
{{ __('firefly.store_category') }}
</button>
</div>
diff --git a/resources/views/categories/edit.blade.php b/resources/views/categories/edit.blade.php
index 45b7c32698..67683d7a90 100644
--- a/resources/views/categories/edit.blade.php
+++ b/resources/views/categories/edit.blade.php
@@ -43,8 +43,8 @@
<div class="card-body">
{!! ExpandedForm::optionsList('update','category') !!}
</div>
- <div class="card-footer">
- <button type="submit" class="btn text-end btn-success">
+ <div class="card-footer text-end">
+ <button type="submit" class="btn btn-success">
{{ __('firefly.update_category') }}
</button>
</div>
diff --git a/resources/views/categories/no-category.blade.php b/resources/views/categories/no-category.blade.php
index d43f4d29b5..9bad6d5f1f 100644
--- a/resources/views/categories/no-category.blade.php
+++ b/resources/views/categories/no-category.blade.php
@@ -16,7 +16,7 @@
<div class="card-header">
<h3 class="card-title">{{ $subTitle }}</h3>
</div>
- <div class="box-body ">
+ <div class="card-body">
@if(count($periods) > 0)
<x-lists.groups-large :groups="$groups" />
diff --git a/resources/views/currencies/create.blade.php b/resources/views/currencies/create.blade.php
index bb735a7a08..4307572d74 100644
--- a/resources/views/currencies/create.blade.php
+++ b/resources/views/currencies/create.blade.php
@@ -29,8 +29,8 @@
<div class="card-body">
{!! ExpandedForm::optionsList('create','currency') !!}
</div>
- <div class="card-footer">
- <button type="submit" class="btn text-end btn-success">
+ <div class="card-footer text-end">
+ <button type="submit" class="btn btn-success">
{{ __('firefly.store_currency') }}
</button>
</div>
diff --git a/resources/views/currencies/edit.blade.php b/resources/views/currencies/edit.blade.php
index de1f1b1ae8..9f3dc11234 100644
--- a/resources/views/currencies/edit.blade.php
+++ b/resources/views/currencies/edit.blade.php
@@ -33,8 +33,8 @@
<div class="card-body">
{!! ExpandedForm::optionsList('update','currency') !!}
</div>
- <div class="card-footer">
- <button type="submit" class="btn btn-success text-end">
+ <div class="card-footer text-end">
+ <button type="submit" class="btn btn-success">
{{ __('firefly.update_currency') }}
</button>
</div>
diff --git a/resources/views/exchange-rates/rates.blade.php b/resources/views/exchange-rates/rates.blade.php
index 82c1ceeb42..07583f12a1 100644
--- a/resources/views/exchange-rates/rates.blade.php
+++ b/resources/views/exchange-rates/rates.blade.php
@@ -21,7 +21,7 @@
<div class="card-header">
<h3 class="box-title">{{ __('firefly.header_exchange_rates_table') }}</h3>
</div>
- <div class="box-body p-0">
+ <div class="card-body p-0">
<template x-if="totalPages > 1">
<nav>
<ul class="pagination">
diff --git a/resources/views/form/hidden.blade.php b/resources/views/form/hidden.blade.php
new file mode 100644
index 0000000000..8cf0320c63
--- /dev/null
+++ b/resources/views/form/hidden.blade.php
@@ -0,0 +1 @@
+{{ Html::input('hidden', $name, $value) }}
diff --git a/resources/views/new-user/index.blade.php b/resources/views/new-user/index.blade.php
index 1d57ebf0df..24f690da4a 100644
--- a/resources/views/new-user/index.blade.php
+++ b/resources/views/new-user/index.blade.php
@@ -54,7 +54,7 @@
</div>
<div class="card-footer text-end">
- <input type="submit" name="submit" value="{{ __('firefly.submit') }}" class="btn btn-success text-end"/>
+ <input type="submit" name="submit" value="{{ __('firefly.submit') }}" class="btn btn-success"/>
</div>
</div>
</div>
diff --git a/resources/views/piggy-banks/create.blade.php b/resources/views/piggy-banks/create.blade.php
index fb20efeefd..01b593b4bb 100644
--- a/resources/views/piggy-banks/create.blade.php
+++ b/resources/views/piggy-banks/create.blade.php
@@ -41,8 +41,8 @@
<div class="card-body">
{!! ExpandedForm::optionsList('create','piggy bank') !!}
</div>
- <div class="card-footer">
- <button type="submit" class="btn btn-success text-end">
+ <div class="card-footer text-end">
+ <button type="submit" class="btn btn-success">
{{ __('firefly.store_piggy_bank') }}
</button>
</div>
diff --git a/resources/views/piggy-banks/edit.blade.php b/resources/views/piggy-banks/edit.blade.php
index 46b7a3d657..a278c29f76 100644
--- a/resources/views/piggy-banks/edit.blade.php
+++ b/resources/views/piggy-banks/edit.blade.php
@@ -49,8 +49,8 @@
<div class="card-body">
{!! ExpandedForm::optionsList('update','piggy bank') !!}
</div>
- <div class="card-footer">
- <button type="submit" class="btn btn-success text-end">
+ <div class="card-footer text-end">
+ <button type="submit" class="btn btn-success">
{{ __('firefly.update_piggy_button') }}
</button>
</div>
diff --git a/resources/views/preferences/index.blade.php b/resources/views/preferences/index.blade.php
index a549a16c92..231451a469 100644
--- a/resources/views/preferences/index.blade.php
+++ b/resources/views/preferences/index.blade.php
@@ -1,91 +1,100 @@
@extends('layout.v3.session')
-
-
- {{ Breadcrumbs.render(Route.getCurrentRoute.getName) }}
-@endsection
-
@section('content')
<form method="POST" action="{{ route('preferences.update') }}" accept-charset="UTF-8" class="form-horizontal"
id="preferences">
<input name="_token" type="hidden" value="{{ csrf_token() }}">
+ @if($errors->any())
+ <div class="alert alert-danger" role="alert">
+ <ul>
+ @foreach($errors->getBags() as $bag)
+ @foreach($bag->all() as $error)
+ <li>{{ $error }}</li>
+ @endforeach
+ @endforeach
+ </ul>
+ </div>
+ @endif
+
<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
{{-- start of preferences tabs --}}
- <div class="nav-tabs-custom">
- <ul class="nav nav-tabs">
- <li class="active"><a href="#general" data-toggle="tab"
- aria-expanded="true">{{ 'preferences_general'|_ }}</a></li>
- <li class=""><a href="#frontpage" data-toggle="tab"
- aria-expanded="false">{{ 'preferences_frontpage'|_ }}</a></li>
- <li class=""><a href="#layout" data-toggle="tab"
- aria-expanded="false">{{ 'preferences_layout'|_ }}</a></li>
- <li class=""><a href="#notifications" data-toggle="tab"
- aria-expanded="false">{{ 'preferences_notifications'|_ }}</a></li>
- </ul>
- <div class="tab-content">
- {% if errors.any %}
- <div class="alert alert-danger" role="alert">
- <ul>
- {% for bag in errors.getBags %}
- {% for error in bag.all %}
- <li>{{ error }}</li>
- @endforeach
- @endforeach
- </ul>
- </div>
- @endif
-
- <div class="tab-pane active" id="general">
- {{-- general settings here --}}
- <div class="row">
- {{-- general settings column A --}}
- <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
- {{-- language --}}
- <div class="preferences-box">
- <h3>{{ 'pref_languages'|_ }}</h3>
- <p>{{ 'pref_languages_help'|_ }}</p>
+ <ul class="nav nav-tabs" id="preferencesTab" role="tablist">
+ <li class="nav-item" role="presentation">
+ <button class="nav-link active" id="general-tab" data-bs-toggle="tab"
+ data-bs-target="#general-tab-pane" type="button" role="tab"
+ aria-controls="general-tab-pane"
+ aria-selected="true">{{ __('firefly.preferences_general') }}</button>
+ </li>
+ <li class="nav-item" role="presentation">
+ <button class="nav-link" id="frontpage-tab" data-bs-toggle="tab"
+ data-bs-target="#frontpage-tab-pane" type="button" role="tab"
+ aria-controls="frontpage-tab-pane"
+ aria-selected="false">{{ __('firefly.preferences_frontpage') }}</button>
+ </li>
+ <li class="nav-item" role="presentation">
+ <button class="nav-link" id="layout-tab" data-bs-toggle="tab" data-bs-target="#layout-tab-pane"
+ type="button" role="tab" aria-controls="layout-tab-pane"
+ aria-selected="false">{{ __('firefly.preferences_layout') }}</button>
+ </li>
+ <li class="nav-item" role="presentation">
+ <button class="nav-link" id="notifications-tab" data-bs-toggle="tab"
+ data-bs-target="#notifications-tab-pane" type="button" role="tab"
+ aria-controls="notifications-tab-pane"
+ aria-selected="false">{{ __('firefly.preferences_notifications') }}</button>
+ </li>
+ </ul>
+ <div class="tab-content" id="preferencesTabContent">
+ <div class="tab-pane fade show active" id="general-tab-pane" role="tabpanel" aria-labelledby="general-tab" tabindex="0">
+ {{-- general settings here --}}
+ <div class="row">
+ {{-- general settings column A --}}
+ <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12 pt-1">
+ {{-- language --}}
+ <div class="card mb-2">
+ <div class="card-header">
+ <h3 class="card-title">{{ __('firefly.pref_languages') }}</h3>
+ </div>
+ <div class="card-body">
+ <p>{{ __('firefly.pref_languages_help') }}</p>
<div class="form-group">
<div class="col-sm-12">
<select class="form-control" id="lang_holder" name="language">
- {% for key, lang in languages %}
- <option {% if language == key %}
- selected
- @endif value="{{ $key }}">{{ lang.name_locale }}
- ({{ lang.name_english }})
+ @foreach($languages as $key => $lang)
+ <option @if($language === $key)selected @endif
+ value="{{ $key }}">{{ $lang['name_locale'] }}
+ ({{ $lang['name_english'] }})
</option>
-
@endforeach
</select>
-
-
</div>
</div>
-
-
<p>
<br/>
- {{ 'pref_languages_locale'|_ }}
+ {{ __('firefly.pref_languages_locale') }}
</p>
</div>
+ </div>
- {{-- locale --}}
- {% if not isDocker %}
- <div class="preferences-box">
- <h3>{{ 'pref_locale'|_ }}</h3>
- <p>{{ 'pref_locale_help'|_ }}</p>
- <p class="text-warning">{{ 'pref_locale_exception'|_ }}</p>
+ {{-- locale --}}
+ @if(!$isDocker)
+ <div class="card mb-2">
+ <div class="card-header">
+ <h3 class="card-title">{{ __('firefly.pref_locale') }}</h3>
+ </div>
+ <div class="card-body">
+ <p>{{ __('firefly.pref_locale_help') }}</p>
+ <p class="text-warning">{{ __('firefly.pref_locale_exception') }}</p>
<div class="form-group">
<div class="col-sm-12">
<select class="form-control" id="locale_holder" name="locale">
- {% for key, loc in locales %}
- <option {% if locale == key %}
- selected
- @endif value="{{ $key }}">
- {% if key == 'equal' %}
- {{ 'equal_to_language'|_ }}
+ @foreach($locales as $key => $loc)
+ <option @if($locale === $key) selected @endif
+ value="{{ $key }}">
+ @if('equal' === $key)
+ {{ __('firefly.equal_to_language') }}
@else
- {{ loc }}
+ {{ $loc }}
@endif</option>
@endforeach
@@ -93,98 +102,121 @@
</div>
</div>
<ul class="text-warning">
-
- {% if IS_DEMO_SITE %}
- <li class="text-danger">{{ 'pref_locale_no_demo'|_ }}</li>@endif
+ @if($IS_DEMO_SITE)
+ <li class="text-danger">{{ __('firefly.pref_locale_no_demo') }}</li>
+ @endif
</ul>
</div>
- @else
- <input type="hidden" name="locale" value="equal"/>
- @endif
-
- {{-- fiscal year --}}
- <div class="preferences-box">
- <h3>{{ 'pref_custom_fiscal_year'|_ }}</h3>
- <p>
- {{ 'pref_custom_fiscal_year_help'|_ }}
- </p>
- {% set isCustomFiscalYear = customFiscalYear == 1 ? true : false %}
- {!! ExpandedForm::checkbox('customFiscalYear','1',isCustomFiscalYear,{ 'label' : 'pref_custom_fiscal_year_label'|_ }) }}
- {!! ExpandedForm::date('fiscalYearStart',fiscalYearStart,{ 'label' : 'pref_fiscal_year_start_label'|_ }) }}
</div>
+ @else
+ <input type="hidden" name="locale" value="equal"/>
+ @endif
- {{-- conversion back to primary currency --}}
- {% if fireflyiiiconfig('enable_exchange_rates', true) %}
- <div class="preferences-box">
- <h3>{{ 'pref_convert_to_primary'|_ }}</h3>
+ {{-- fiscal year --}}
+ <div class="card mb-2">
+ <div class="card-header">
+ <h3 class="card-title">{{ __('firefly.pref_custom_fiscal_year') }}</h3>
+ </div>
+ <div class="card-body">
<p>
- {{ 'pref_convert_to_primary_help'|_ }}
+ {{ __('firefly.pref_custom_fiscal_year_help') }}
</p>
- {!! ExpandedForm::checkbox('convertToPrimary','1',convertToPrimary,{ 'label' : 'pref_convert_primary_help'|_ }) }}
+ @php
+ $isCustomFiscalYear = $customFiscalYear === 1;
+ @endphp
+ {!! ExpandedForm::checkbox('customFiscalYear','1',1 === $customFiscalYear,['label' => 'pref_custom_fiscal_year_label' ]) !!}
+ {!! ExpandedForm::date('fiscalYearStart',1 === $customFiscalYear,['label' => 'pref_fiscal_year_start_label' ]) !!}
</div>
- @endif
- {{-- conversion back to primary currency --}}
- <div class="preferences-box">
- <h3>{{ 'pref_anonymous'|_ }}</h3>
+ </div>
+
+ {{-- conversion back to primary currency --}}
+ @if(\FireflyIII\Support\Facades\AppConfiguration::get('enable_exchange_rates', true))
+ <div class="card mb-2">
+ <div class="card-header">
+ <h3 class="card-title">{{ __('firefly.pref_convert_to_primary') }}</h3>
+ </div>
+ <div class="card-body">
<p>
- {{ 'pref_anonymous_help'|_ }}
+ {{ __('firefly.pref_convert_to_primary_help') }}
</p>
- {!! ExpandedForm::checkbox('anonymous','1',anonymous,{ 'label' : 'pref_anonymous_label'|_ }) }}
+ {!! ExpandedForm::checkbox('convertToPrimary','1', $convertToPrimary,['label' => 'pref_convert_primary_help']) !!}
</div>
+ </div>
+ @endif
+ {{-- conversion back to primary currency --}}
+ <div class="card mb-2">
+ <div class="card-header">
+ <h3 class="card-title">{{ __('firefly.pref_anonymous') }}</h3>
+ </div>
+ <div class="card-body">
+ <p>
+ {{ __('firefly.pref_anonymous_help') }}
+ </p>
+ {!! ExpandedForm::checkbox('anonymous','1',$anonymous,[ 'label' => __('firefly.pref_anonymous_label')]) !!}
+ </div>
</div>
+ </div>
- {{-- general settings column B --}}
- <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
- {{-- transaction preferences --}}
- <div class="preferences-box">
- <h3>{{ 'pref_optional_fields_transaction'|_ }}</h3>
+ {{-- general settings column B --}}
+ <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12 pt-1">
+ {{-- transaction preferences --}}
+ <div class="card mb-2">
+ <div class="card-header">
+ <h3 class="card-title">{{ __('firefly.pref_optional_fields_transaction') }}</h3>
+ </div>
+ <div class="card-body">
<p>
- {{ 'pref_optional_fields_transaction_help'|_ }}
+ {{ __('firefly.pref_optional_fields_transaction_help') }}
</p>
- <h4>{{ 'optional_tj_date_fields'|_ }}</h4>
- {!! ExpandedForm::checkbox('tj[interest_date]','1', tjOptionalFields.interest_date,{ 'label' : 'pref_optional_tj_interest_date'|_ }) }}
- {!! ExpandedForm::checkbox('tj[book_date]','1', tjOptionalFields.book_date,{ 'label' : 'pref_optional_tj_book_date'|_ }) }}
- {!! ExpandedForm::checkbox('tj[process_date]','1', tjOptionalFields.process_date,{ 'label' : 'pref_optional_tj_process_date'|_ }) }}
- {!! ExpandedForm::checkbox('tj[due_date]','1', tjOptionalFields.due_date,{ 'label' : 'pref_optional_tj_due_date'|_ }) }}
- {!! ExpandedForm::checkbox('tj[payment_date]','1', tjOptionalFields.payment_date,{ 'label' : 'pref_optional_tj_payment_date'|_ }) }}
- {!! ExpandedForm::checkbox('tj[invoice_date]','1', tjOptionalFields.invoice_date,{ 'label' : 'pref_optional_tj_invoice_date'|_ }) }}
+ <h4>{{ __('firefly.optional_tj_date_fields') }}</h4>
+ {!! ExpandedForm::checkbox('tj[interest_date]','1', $tjOptionalFields['interest_date'],['label' => 'pref_optional_tj_interest_date']) !!}
+ {!! ExpandedForm::checkbox('tj[book_date]','1', $tjOptionalFields['book_date'],['label' => 'pref_optional_tj_book_date']) !!}
+ {!! ExpandedForm::checkbox('tj[process_date]','1', $tjOptionalFields['process_date'],['label' => 'pref_optional_tj_process_date']) !!}
+ {!! ExpandedForm::checkbox('tj[due_date]','1', $tjOptionalFields['due_date'],['label' => 'pref_optional_tj_due_date']) !!}
+ {!! ExpandedForm::checkbox('tj[payment_date]','1', $tjOptionalFields['payment_date'],['label' => 'pref_optional_tj_payment_date']) !!}
+ {!! ExpandedForm::checkbox('tj[invoice_date]','1', $tjOptionalFields['invoice_date'],['label' => 'pref_optional_tj_invoice_date']) !!}
- <h4>{{ 'optional_tj_other_fields'|_ }}</h4>
- {!! ExpandedForm::checkbox('tj[internal_reference]','1', tjOptionalFields.internal_reference,{ 'label' : 'pref_optional_tj_internal_reference'|_ }) }}
- {!! ExpandedForm::checkbox('tj[external_url]','1', tjOptionalFields.external_url,{ 'label' : 'pref_optional_tj_external_url'|_ }) }}
- {!! ExpandedForm::checkbox('tj[notes]','1', tjOptionalFields.notes,{ 'label' : 'pref_optional_tj_notes'|_ }) }}
- {!! ExpandedForm::checkbox('tj[location]','1', tjOptionalFields.location,{ 'label' : 'pref_optional_tj_location'|_ }) }}
- {!! ExpandedForm::checkbox('tj[links]','1', tjOptionalFields.links,{ 'label' : 'pref_optional_tj_links'|_ }) }}
+ <h4>{{ __('firefly.optional_tj_other_fields') }}</h4>
+ {!! ExpandedForm::checkbox('tj[internal_reference]','1', $tjOptionalFields['internal_reference'],['label' => 'pref_optional_tj_internal_reference']) !!}
+ {!! ExpandedForm::checkbox('tj[external_url]','1', $tjOptionalFields['external_url'],['label' => 'pref_optional_tj_external_url']) !!}
+ {!! ExpandedForm::checkbox('tj[notes]','1', $tjOptionalFields['notes'],['label' => 'pref_optional_tj_notes']) !!}
+ {!! ExpandedForm::checkbox('tj[location]','1', $tjOptionalFields['location'],['label' => 'pref_optional_tj_location']) !!}
+ {!! ExpandedForm::checkbox('tj[links]','1', $tjOptionalFields['links'],['label' => 'pref_optional_tj_links']) !!}
- <h4>{{ 'optional_tj_attachment_fields'|_ }}</h4>
- {!! ExpandedForm::checkbox('tj[attachments]','1', tjOptionalFields.attachments,{ 'label' : 'pref_optional_tj_attachments'|_ }) }}
+ <h4>{{ __('firefly.optional_tj_attachment_fields') }}</h4>
+ {!! ExpandedForm::checkbox('tj[attachments]','1', $tjOptionalFields['attachments'], ['label' => 'pref_optional_tj_attachments']) !!}
</div>
+
</div>
</div>
</div>
- <div class="tab-pane" id="frontpage">
- {{-- frontpage settings here --}}
- <div class="row">
- {{-- frontpage settings column a --}}
- <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
- <div class="preferences-box">
- <h3>{{ 'pref_home_screen_accounts'|_ }}</h3>
- <p>{{ 'pref_home_screen_accounts_help'|_ }}</p>
- {% for type, accounts in groupedAccounts %}
+ </div>
+ <div class="tab-pane fade" id="frontpage-tab-pane" role="tabpanel" aria-labelledby="frontpage-tab" tabindex="0">
+ {{-- frontpage settings here --}}
+ <div class="row">
+ {{-- frontpage settings column a --}}
+ <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12 mt-1">
+ <div class="card mb-2">
+ <div class="card-header">
+ <h3 class="card-title">{{ __('firefly.pref_home_screen_accounts') }}</h3>
+ </div>
+ <div class="card-body">
+ <p>{{ __('firefly.pref_home_screen_accounts_help') }}</p>
+ @foreach($groupedAccounts as $type => $accounts)
<strong>{{ $type }}</strong>
- {% for id, name in accounts %}
+ @foreach($accounts as $id => $name)
<div class="form-group">
<div class="col-sm-10">
<div class="checkbox">
<label>
- {% if id in frontpageAccounts or frontpageAccounts|length == 0 %}
+ @if(in_array($id, $frontpageAccounts) || 0 === count($frontpageAccounts))
<input type="checkbox" name="frontpageAccounts[]"
- value="{{ id }}"
- checked> {{ name }}
+ value="{{ $id }}"
+ checked> {{ $name }}
@else
<input type="checkbox" name="frontpageAccounts[]"
- value="{{ id }}"> {{ name }}
+ value="{{ $id }}"> {{ $name }}
@endif
</label>
</div>
@@ -194,136 +226,150 @@
@endforeach
</div>
</div>
- {{-- frontpage settings column b --}}
- <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
- </div>
+ </div>
+ {{-- frontpage settings column b (empty) --}}
+ <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
</div>
</div>
- <div class="tab-pane" id="layout">
- {{-- layout settings here --}}
- <div class="row">
- {{-- layout settings column A --}}
- <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
- {{-- view range --}}
- <div class="preferences-box">
- <h3>{{ 'pref_view_range'|_ }}</h3>
- <p>{{ 'pref_view_range_help'|_ }}</p>
+ </div>
+ <div class="tab-pane fade" id="layout-tab-pane" role="tabpanel" aria-labelledby="layout-tab"
+ tabindex="0">
+ {{-- layout settings here --}}
+ <div class="row">
+ {{-- layout settings column A --}}
+ <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12 mt-1">
+ {{-- view range --}}
+ <div class="card mb-2">
+ <div class="card-header">
+ <h3 class="card-title">{{ __('firefly.pref_view_range') }}</h3>
+ </div>
+ <div class="card-body">
+ <p>{{ __('firefly.pref_view_range_help') }}</p>
<div class="radio">
<label>
<input type="radio" name="viewRange"
- value="1D" {% if viewRange == '1D' %} checked @endif>
- {{ 'pref_1D'|_ }}
+ value="1D" @if($viewRange === '1D') checked @endif>
+ {{ __('firefly.pref_1D') }}
</label>
</div>
<div class="radio">
<label>
<input type="radio" name="viewRange"
- value="1W" {% if viewRange == '1W' %} checked @endif>
- {{ 'pref_1W'|_ }}
+ value="1W" @if($viewRange === '1W') checked @endif>
+ {{ __('firefly.pref_1W') }}
</label>
</div>
<div class="radio">
<label>
<input type="radio" name="viewRange"
- value="last7" {% if viewRange == 'last7' %} checked @endif>
- {{ 'pref_last7'|_ }}
+ value="last7" @if($viewRange === 'last7') checked @endif>
+ {{ __('firefly.pref_last7') }}
</label>
</div>
<div class="radio">
<label>
<input type="radio" name="viewRange"
- value="1M" {% if viewRange == '1M' %} checked @endif>
- {{ 'pref_1M'|_ }}
+ value="1M" @if($viewRange === '1M') checked @endif>
+ {{ __('firefly.pref_1M') }}
</label>
</div>
<div class="radio">
<label>
<input type="radio" name="viewRange"
- value="last30" {% if viewRange == 'last30' %} checked @endif>
- {{ 'pref_last30'|_ }}
+ value="last30" @if($viewRange === 'last30') checked @endif>
+ {{ __('firefly.pref_last30') }}
</label>
</div>
<div class="radio">
<label>
<input type="radio" name="viewRange"
- value="MTD" {% if viewRange == 'MTD' %} checked @endif>
- {{ 'pref_MTD'|_ }}
+ value="MTD" @if($viewRange === 'MTD') checked @endif>
+ {{ __('firefly.pref_MTD') }}
</label>
</div>
<div class="radio">
<label>
<input type="radio" name="viewRange"
- value="3M" {% if viewRange == '3M' %} checked @endif>
- {{ 'pref_3M'|_ }}
+ value="3M" @if($viewRange === '3M') checked @endif>
+ {{ __('firefly.pref_3M') }}
</label>
</div>
<div class="radio">
<label>
<input type="radio" name="viewRange"
- value="last90" {% if viewRange == 'last90' %} checked @endif>
- {{ 'pref_last90'|_ }}
+ value="last90" @if($viewRange === 'last90') checked @endif>
+ {{ __('firefly.pref_last90') }}
</label>
</div>
<div class="radio">
<label>
<input type="radio" name="viewRange"
- value="QTD" {% if viewRange == 'QTD' %} checked @endif>
- {{ 'pref_QTD'|_ }}
+ value="QTD" @if($viewRange === 'QTD') checked @endif>
+ {{ __('firefly.pref_QTD') }}
</label>
</div>
<div class="radio">
<label>
<input type="radio" name="viewRange"
- value="6M" {% if viewRange == '6M' %} checked @endif>
- {{ 'pref_6M'|_ }}
+ value="6M" @if($viewRange === '6M') checked @endif>
+ {{ __('firefly.pref_6M') }}
</label>
</div>
<div class="radio">
<label>
<input type="radio" name="viewRange"
- value="1Y" {% if viewRange == '1Y' %} checked @endif>
- {{ 'pref_1Y'|_ }}
+ value="1Y" @if($viewRange === '1Y') checked @endif>
+ {{ __('firefly.pref_1Y') }}
</label>
</div>
<div class="radio">
<label>
<input type="radio" name="viewRange"
- value="YTD" {% if viewRange == 'YTD' %} checked @endif>
- {{ 'pref_YTD'|_ }}
+ value="YTD" @if($viewRange === 'YTD') checked @endif>
+ {{ __('firefly.pref_YTD') }}
</label>
</div>
<div class="radio">
<label>
<input type="radio" name="viewRange"
- value="last365" {% if viewRange == 'last365' %} checked @endif>
- {{ 'pref_last365'|_ }}
+ value="last365" @if($viewRange === 'last365') checked @endif>
+ {{ __('firefly.pref_last365') }}
</label>
</div>
</div>
</div>
+ </div>
- {{-- layout settings column B --}}
- <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
- <div class="preferences-box">
- <h3>{{ 'list_page_size_title'|_ }}</h3>
- <p>{{ 'list_page_size_help'|_ }}</p>
- {!! ExpandedForm::integer('listPageSize',listPageSize,{'label' : 'list_page_size_label'|_}) }}
+ {{-- layout settings column B --}}
+ <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12 mt-1">
+ <div class="card mb-2">
+ <div class="card-header">
+ <h3 class="card-title">{{ __('firefly.list_page_size_title') }}</h3>
+ </div>
+ <div class="card-body">
+ <p>{{ __('firefly.list_page_size_help') }}</p>
+ {!! ExpandedForm::integer('listPageSize',$listPageSize,['label' => __('firefly.list_page_size_label')]) !!}
</div>
- <div class="preferences-box">
- <h3>{{ 'dark_mode_preference'|_ }}</h3>
- <p>{{ 'dark_mode_preference_help'|_ }}</p>
- {% for mode in availableDarkModes %}
+ </div>
+ <div class="card mb-2">
+ <div class="card-header">
+ <h3 class="card-title">{{ __('firefly.dark_mode_preference') }}</h3>
+ </div>
+ <div class="card-body">
+ <p>{{ __('firefly.dark_mode_preference_help') }}</p>
+ @foreach($availableDarkModes as $mode)
<div class="radio">
<label>
<input type="radio" name="darkMode"
- value="{{ mode }}" {% if darkMode == mode %} checked @endif>
- {{ ('dark_mode_option_'~mode)|_ }}
+ value="{{ $mode }}"
+ @if($darkMode === $mode) checked @endif>
+ {{ __('dark_mode_option_' . $mode) }}
</label>
</div>
@endforeach
@@ -331,42 +377,52 @@
</div>
</div>
</div>
- <div class="tab-pane" id="notifications">
- {{-- layout settings here --}}
- <div class="row">
- {{-- layout settings column A --}}
- <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
- {{-- view range --}}
- <div class="preferences-box">
- <h3>{{ 'pref_notifications'|_ }}</h3>
+ </div>
+ <div class="tab-pane fade" id="notifications-tab-pane" role="tabpanel"
+ aria-labelledby="notifications-tab" tabindex="0">
+ {{-- layout settings here --}}
+ <div class="row mt-1">
+ {{-- layout settings column A --}}
+ <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
+ {{-- view range --}}
+ <div class="card mb-2">
+ <div class="card-header">
+ <h3 class="card-title">{{ __('firefly.pref_notifications') }}</h3>
+ </div>
+ <div class="card-body">
<p>
- {{ 'available_channels_expl'|_ }}
+ {{ __('firefly.available_channels_expl') }}
</p>
<ul>
- {% for name,info in channels %}
+ @foreach($channels as $name => $info)
<li>
- {% if true == info.enabled and true == forcedAvailability[name] %}
- ☑️ {{ trans('firefly.notification_channel_name_'~name) }}
- {% if 0 == info.ui_configurable %}({{ 'configure_channel_in_env'|_ }}) @endif
+ @if(true === $info['enabled'] && true === $forcedAvailability[$name])
+ ☑️ {{ trans('firefly.notification_channel_name_' . $name) }}
+ @if(0 === $info['ui_configurable'])
+ ({{ __('firefly.configure_channel_in_env') }})
+ @endif
@endif
- {% if false == info.enabled or false == forcedAvailability[name] %}
- ⚠️ {{ trans('firefly.notification_channel_name_'~name) }} ({{ 'channel_not_available'|_ }})
+ @if(false === $info['enabled'] || false === $forcedAvailability[$name])
+ ⚠️ {{ trans('firefly.notification_channel_name_' . $name) }}
+ ({{ __('firefly.channel_not_available') }})
@endif
</li>
@endforeach
</ul>
- <p>{{ 'pref_notifications_help'|_ }}</p>
- {% for id, info in notifications %}
+ <p>{{ __('firefly.pref_notifications_help') }}</p>
+ @foreach($notifications as $id => $info)
<div class="form-group">
<div class="col-sm-10">
<div class="checkbox">
<label>
- {% if info.configurable %}
- <input {% if not info.configurable %}readonly@endif type="checkbox" name="notification_{{ id }}" {{ info.enabled == true ? 'checked' : '' }} value="1">
+ @if($info['configurable'])
+ <input type="checkbox" name="notification_{{ $id }}"
+ {{ $info['enabled'] === true ? 'checked' : '' }} value="1">
@else
- <input readonly disabled type="checkbox" checked value="1">
+ <input readonly disabled type="checkbox" checked
+ value="1">
@endif
- {{ trans('firefly.pref_notification_' ~ id) }}
+ {{ trans('firefly.pref_notification_' . $id) }}
</label>
</div>
</div>
@@ -374,33 +430,37 @@
@endforeach
</div>
</div>
- <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
- <div class="preferences-box">
- <h3>{{ 'pref_notifications_settings'|_ }}</h3>
- <p>{{ 'pref_notifications_settings_help'|_ }}</p>
- {!! ExpandedForm::text('slack_webhook_url',slackUrl,{'label' : 'slack_url_label'|_, helpText: 'slack_discord_double'|_}) }}
-
- {!! ExpandedForm::text('pushover_app_token', pushoverAppToken, {}) }}
- {!! ExpandedForm::text('pushover_user_token', pushoverUserToken, {}) }}
+ </div>
+ <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
+ <div class="card mb-2">
+ <div class="card-header">
+ <h3 class="card-title">{{ __('firefly.pref_notifications_settings') }}</h3>
+ </div>
+ <div class="card-body">
+ <p>{{ __('firefly.pref_notifications_settings_help') }}</p>
+ {!! ExpandedForm::text('slack_webhook_url', $slackUrl, ['label' => 'slack_url_label', 'helpText' => 'slack_discord_double']) !!}
+ {!! ExpandedForm::text('pushover_app_token', $pushoverAppToken) !!}
+ {!! ExpandedForm::text('pushover_user_token', $pushoverUserToken) !!}
- {{ Form.hidden('ntfy_server', ntfyServer, {}) }}
- {{ Form.hidden('ntfy_topic', ntfyTopic, {}) }}
- {{ Form.hidden('ntfy_auth','1', ntfyAuth, {}) }}
- {{ Form.hidden('ntfy_user', ntfyUser, {}) }}
- {{ Form.hidden('ntfy_pass', ntfyPass, {autocomplete: 'off'}) }}
+ {!! ExpandedForm::hidden('ntfy_server', $ntfyServer) !!}
+ {!! ExpandedForm::hidden('ntfy_topic', $ntfyTopic) !!}
+ {!! ExpandedForm::hidden('ntfy_auth', $ntfyAuth) !!}
+ {!! ExpandedForm::hidden('ntfy_user', $ntfyUser) !!}
+ {!! ExpandedForm::hidden('ntfy_pass', $ntfyPass) !!}
<p>
- {{ 'pref_notifications_settings_help'|_ }}
+ {{ __('firefly.pref_notifications_settings_help') }}
</p>
- <div class="btn-group">
- {% for name,info in channels %}
- {% if true == info.enabled and true == forcedAvailability[name] %}
- <a href="#" data-channel="{{ name }}" class="btn btn-outline-secondary submit-test">
- {{ trans('firefly.test_notification_channel_name_'~name) }}
- </a>
- @endif
- @endforeach
- </div>
+ <div class="btn-group">
+ @foreach($channels as $name => $info)
+ @if(true === $info['enabled'] && true === $forcedAvailability[$name])
+ <a href="#" data-channel="{{ $name }}"
+ class="btn btn-outline-secondary submit-test">
+ {{ trans('firefly.test_notification_channel_name_'.$name) }}
+ </a>
+ @endif
+ @endforeach
+ </div>
</div>
</div>
</div>
@@ -413,7 +473,7 @@
<div class="col-lg-12 col-md-12 col-sm-12">
<div class="form-group">
<div class="col-sm-12">
- <button type="submit" name="form_submit" value="form_submit" class="btn btn-success btn-lg">{{ 'pref_save_settings'|_ }}</button>
+ <button type="submit" name="form_submit" value="form_submit" class="btn btn-success btn-lg">{{ __('firefly.pref_save_settings') }}</button>
</div>
</div>
</div>
@@ -421,12 +481,25 @@
</form>
@endsection
@section('scripts')
+ @vite(['js/pages/generic.js'])
+
<script type="text/javascript" nonce="{{ $JS_NONCE }}">
var postUrl = "{{ route('preferences.test-notification') }}";
+
+ $(document).ready(function () {
+ $('button[data-bs-toggle="tab"]').on('show.bs.tab', function (e) {
+ localStorage.setItem('preferencesActiveTab', $(e.target).attr('data-bs-target'));
+ });
+ var activeTab = localStorage.getItem('preferencesActiveTab');
+ if (activeTab) {
+ $('#preferencesTab button[data-bs-target="' + activeTab + '"]').click();
+ }
+ });
</script>
<script type="text/javascript" src="v1/js/lib/modernizr-custom.js?v={{ $FF_BUILD_TIME }}"
nonce="{{ $JS_NONCE }}"></script>
- <script type="text/javascript" src="v1/js/lib/jquery-ui.min.js?v={{ $FF_BUILD_TIME }}" nonce="{{ $JS_NONCE }}"></script>
+ <script type="text/javascript" src="v1/js/lib/jquery-ui.min.js?v={{ $FF_BUILD_TIME }}"
+ nonce="{{ $JS_NONCE }}"></script>
<script type="text/javascript" src="v1/js/ff/preferences/index.js?v={{ $FF_BUILD_TIME }}"
nonce="{{ $JS_NONCE }}"></script>
@endsection
diff --git a/resources/views/profile/change-email.blade.php b/resources/views/profile/change-email.blade.php
index 65b1fd87f5..12915a73cf 100644
--- a/resources/views/profile/change-email.blade.php
+++ b/resources/views/profile/change-email.blade.php
@@ -1,9 +1,4 @@
@extends('layout.v3.session')
-
-
- {{ Breadcrumbs.render(Route.getCurrentRoute.getName) }}
-@endsection
-
@section('content')
<form method="POST" action="{{ route('profile.change-email.post') }}" accept-charset="UTF-8" class="form-horizontal" id="change-password">
<input name="_token" type="hidden" value="{{ csrf_token() }}">
@@ -12,14 +7,13 @@
<div class="col-lg-6 col-md-12 col-sm-12">
<div class="card mb-2">
<div class="card-header">
- <h3 class="card-title">{{ 'change_your_email'|_ }}</h3>
+ <h3 class="card-title">{{ __('firefly.change_your_email') }}</h3>
</div>
<div class="card-body">
-
- {% if errors|length > 0 %}
+ @if(count($errors) > 0)
<ul>
- {% for error in errors.all %}
- <li class="text-danger">{{ error }}</li>
+ @foreach($errors->all() as $error)
+ <li class="text-danger">{{ $error }}</li>
@endforeach
</ul>
@@ -29,19 +23,19 @@
<div class="form-group">
<label for="email" class="col-sm-4 control-label">{{ trans('form.new_email_address') }}</label>
<div class="col-sm-8">
- <input type="email" class="form-control" id="email" placeholder="{{ 'new_email_address'|_ }}" spellcheck="false"
- value="{{ old('email')|default(email) }}"
- name="email">
+ <input type="email" class="form-control" id="email" placeholder="{{ __('firefly.new_email_address') }}" spellcheck="false" value="{{ old('email') ?? $email }}" name="email">
</div>
</div>
- {!! ExpandedForm::staticText('verification',trans('firefly.email_verification')) }}
-
+ <p>{!! trans('firefly.email_verification') !!}</p>
</div>
- <div class="card-footer">
- <button type="submit" class="btn btn-success text-end">{{ 'change_your_email'|_ }}</button>
+ <div class="card-footer text-end">
+ <button type="submit" class="btn btn-success ">{{ __('firefly.change_your_email') }}</button>
</div>
</div>
</div>
</div>
</form>
@endsection
+@section('scripts')
+ @vite(['js/pages/generic.js'])
+@endsection
diff --git a/resources/views/profile/change-password.blade.php b/resources/views/profile/change-password.blade.php
index f2e61b9a79..970d3856a4 100644
--- a/resources/views/profile/change-password.blade.php
+++ b/resources/views/profile/change-password.blade.php
@@ -1,9 +1,4 @@
@extends('layout.v3.session')
-
-
- {{ Breadcrumbs.render(Route.getCurrentRoute.getName) }}
-@endsection
-
@section('content')
<form method="POST" action="{{ route('profile.change-password.post') }}" accept-charset="UTF-8" class="form-horizontal" id="change-password">
<input name="_token" type="hidden" value="{{ csrf_token() }}">
@@ -12,58 +7,59 @@
<div class="col-lg-6 col-md-12 col-sm-12">
<div class="card mb-2">
<div class="card-header">
- <h3 class="card-title">{{ 'change_your_password'|_ }}</h3>
+ <h3 class="card-title">{{ __('firefly.change_your_password') }}</h3>
</div>
<div class="card-body">
-
- {% if errors|length > 0 %}
+ @if(count($errors) > 0)
<ul>
- {% for error in errors.all %}
- <li class="text-danger">{{ error }}</li>
+ @foreach($errors->all() as $error)
+ <li class="text-danger">{{ $error }}</li>
@endforeach
</ul>
-
@endif
<div class="form-group">
- <label for="inputOldPassword" class="col-sm-4 control-label">{{ 'current_password'|_ }}</label>
+ <label for="inputOldPassword" class="col-sm-4 control-label">{{ __('firefly.current_password') }}</label>
<div class="col-sm-8">
- <input type="password" class="form-control" id="inputOldPassword" placeholder="{{ 'current_password'|_ }}" spellcheck="false"
+ <input type="password" class="form-control" id="inputOldPassword" placeholder="{{ __('firefly.current_password') }}" spellcheck="false"
name="current_password">
</div>
</div>
<div class="form-group">
- <label for="inputNewPassword1" class="col-sm-4 control-label">{{ 'new_password'|_ }}</label>
+ <label for="inputNewPassword1" class="col-sm-4 control-label">{{ __('firefly.new_password') }}</label>
<div class="col-sm-8">
- <input type="password" class="form-control" id="inputNewPassword1" placeholder="{{ 'new_password'|_ }}" name="new_password" spellcheck="false">
+ <input type="password" class="form-control" id="inputNewPassword1" placeholder="{{ __('firefly.new_password') }}" name="new_password" spellcheck="false">
</div>
</div>
<div class="form-group">
- <label for="inputNewPassword2" class="col-sm-4 control-label">{{ 'new_password_again'|_ }}</label>
+ <label for="inputNewPassword2" class="col-sm-4 control-label">{{ __('firefly.new_password_again') }}</label>
<div class="col-sm-8">
- <input type="password" class="form-control" id="inputNewPassword2" placeholder="{{ 'new_password_again'|_ }}" spellcheck="false"
+ <input type="password" class="form-control" id="inputNewPassword2" placeholder="{{ __('firefly.new_password_again') }}" spellcheck="false"
name="new_password_confirmation">
</div>
</div>
- {!! ExpandedForm::checkbox('verify_password','1', true) }}
+ {!! ExpandedForm::checkbox('verify_password','1', true) !!}
<p>
- <a data-toggle="modal" data-target="#passwordModal" href="#passwordModal">{{ 'what_is_pw_security'|_ }}</a>
+ <a data-bs-toggle="modal" data-target="#passwordModal" href="#passwordModal">{{ __('firefly.what_is_pw_security') }}</a>
</p>
</div>
- <div class="card-footer">
- <button type="submit" class="btn btn-success text-end">{{ 'change_your_password'|_ }}</button>
+ <div class="card-footer text-end">
+ <button type="submit" class="btn btn-success">{{ __('firefly.change_your_password') }}</button>
</div>
</div>
</div>
</div>
</form>
- {% include 'partials.password-modal-twig' %}
+ @include('partials.password-modal')
+@endsection
+@section('scripts')
+ @vite(['js/pages/generic.js'])
@endsection
diff --git a/resources/views/profile/delete-account.blade.php b/resources/views/profile/delete-account.blade.php
index 550605285f..90e9c2e008 100644
--- a/resources/views/profile/delete-account.blade.php
+++ b/resources/views/profile/delete-account.blade.php
@@ -54,6 +54,7 @@
@endsection
@section('scripts')
+ @vite(['js/pages/generic.js'])
<!-- just a bit of inline code -->
<script type="text/javascript" nonce="{{ $JS_NONCE }}">
var confirmText= '{{ 'are_you_sure'|_|escape('js') }}';
diff --git a/resources/views/profile/index.blade.php b/resources/views/profile/index.blade.php
index 4af8802db5..2bfb881c41 100644
--- a/resources/views/profile/index.blade.php
+++ b/resources/views/profile/index.blade.php
@@ -1,69 +1,67 @@
-{% set VUE_SCRIPT_NAME = 'profile' %}
@extends('layout.v3.session')
-
-
- {{ Breadcrumbs.render(Route.getCurrentRoute.getName) }}
-@endsection
-
@section('content')
-
<div class="row">
<div class="col-lg-8 offset-lg-2 col-md-12 col-sm-12">
<!-- Nav tabs -->
- <ul class="nav nav-tabs" role="tablist">
- <li role="presentation" class="active">
- <a href="{{ route('profile.index') }}#options" aria-controls="home" role="tab"
- data-toggle="tab">{{ __('firefly.options') }}</a>
+ <ul class="nav nav-tabs" id="profileTab" role="tablist">
+ <li class="nav-item" role="presentation">
+ <button class="nav-link active" id="options-tab" data-bs-toggle="tab"
+ data-bs-target="#options-tab-pane" type="button" role="tab"
+ aria-controls="options-tab-pane"
+ aria-selected="true">{{ __('firefly.options') }}</button>
</li>
- <li role="presentation">
- <a href="#cmd" aria-controls="profile" role="tab" data-toggle="tab">{{ 'command_line_token'|_ }}</a>
+ <li class="nav-item" role="presentation">
+ <button class="nav-link" id="cmd-tab" data-bs-toggle="tab"
+ data-bs-target="#cmd-tab-pane" type="button" role="tab"
+ aria-controls="cmd-tab-pane"
+ aria-selected="false">{{ __('firefly.command_line_token') }}</button>
</li>
- <li role="presentation">
- <a href="#delete" aria-controls="settings" role="tab"
- data-toggle="tab">{{ 'delete_stuff_header'|_ }}</a>
+ <li class="nav-item" role="presentation">
+ <button class="nav-link" id="delete-tab" data-bs-toggle="tab"
+ data-bs-target="#delete-tab-pane" type="button" role="tab"
+ aria-controls="delete-tab-pane"
+ aria-selected="false">{{ __('firefly.delete_stuff_header') }}</button>
</li>
</ul>
- <div class="tab-content">
-
- <!-- main options -->
- <div role="tabpanel" class="tab-pane active" id="options">
- <div class="card mb-2">
+ <div class="tab-content" id="profileTabContent">
+ <div class="tab-pane fade show active" id="options-tab-pane" role="tabpanel" aria-labelledby="options-tab" tabindex="0">
+ <div class="card mb-2 mt-1">
<div class="card-body">
<p>
- {{ trans('firefly.user_id_is',{user: userId})|raw }}
+ {!! trans('firefly.user_id_is',['user' => $userId]) !!}
</p>
<div class="row">
<div class="col-lg-6">
<ul>
- {% if true == isInternalAuth %}
+ @if(true === $isInternalAuth)
<li>
- <a href="{{ route('profile.change-email') }}">{{ 'change_your_email'|_ }}</a>
+ <a href="{{ route('profile.change-email') }}">{{ __('firefly.change_your_email') }}</a>
</li>
<li>
- <a href="{{ route('profile.change-password') }}">{{ 'change_your_password'|_ }}</a>
- </li>
- {% if enabled2FA == true %}
- <li>
- <a href="{{ route('profile.mfa.index') }}">{{ 'manage_mfa_settings'|_ }}</a>
+ <a href="{{ route('profile.change-password') }}">{{ __('firefly.change_your_password') }}</a>
</li>
+ @if(true === $enabled2FA)
+ <li>
+ <a href="{{ route('profile.mfa.index') }}">{{ __('firefly.manage_mfa_settings') }}</a>
+ </li>
@endif
- {% if enabled2FA == false %}
+ @if(false === $enabled2FA)
<li>
- <a href="{{ route('profile.mfa.index') }}">{{ 'enable_mfa'|_ }}</a>
+ <a href="{{ route('profile.mfa.index') }}">{{ __('firefly.enable_mfa') }}</a>
</li>
@endif
@endif
- <li><a href="{{ route('logout') }}" class="logout-link">{{ 'logout'|_ }}</a>
+ <li><a href="{{ route('logout') }}" class="logout-link">{{ __('firefly.logout') }}</a>
</li>
- {% if true == isInternalAuth %}
+ @if(true === $isInternalAuth)
<li>
- <a href="{{ route('profile.logout-others') }}">{{ 'logout_other_sessions'|_ }}</a>
+ <a href="{{ route('profile.logout-others') }}">{{ __('firefly.logout_other_sessions') }}</a>
</li>
<li><a class="text-danger"
- href="{{ route('profile.delete-account') }}">{{ 'delete_account'|_ }}</a>
+ href="{{ route('profile.delete-account') }}">{{ __('firefly.delete_account') }}</a>
</li>
@endif
</ul>
@@ -72,157 +70,149 @@
</div>
</div>
</div>
-
- <!-- command line options -->
- <div role="tabpanel" class="tab-pane" id="cmd">
- <div class="card mb-2">
+ <div class="tab-pane fade" id="cmd-tab-pane" role="tabpanel" aria-labelledby="cmd-tab" tabindex="0">
+ <div class="card mb-2 mt-1">
<div class="card-body">
<p>
- {{ 'explain_command_line_token'|_ }}
+ {{ __('firefly.explain_command_line_token') }}
</p>
<p>
- <input id="token" type="text" class="form-control" name="token"
- value="{{ accessToken.data }}"
- size="32" maxlength="32" readonly/>
-
+ <input id="token" type="text" class="form-control" name="token" value="{{ $accessToken->data }}" size="32" maxlength="32" readonly/>
</p>
<form action="{{ route('profile.regenerate') }}" method="post">
<p>
<input type="hidden" name="_token" value="{{ csrf_token() }}"/>
<button type="submit" class="btn btn-danger btn-xs"><span
- class="bi bi-arrow-repeat"></span> {{ 'regenerate_command_line_token'|_ }}
+ class="bi bi-arrow-repeat"></span> {{ __('firefly.regenerate_command_line_token') }}
</button>
</p>
</form>
</div>
</div>
</div>
-
- <!-- purge stuff -->
- <div role="tabpanel" class="tab-pane" id="delete">
- <div class="card mb-2">
+ <div class="tab-pane fade" id="delete-tab-pane" role="tabpanel" aria-labelledby="delete-tab" tabindex="0">
+ <div class="card mb-2 mt-1">
<div class="card-header">
- <h3 class="card-title">{{ 'purge_data_title'|_ }}</h3>
+ <h3 class="card-title">{{ __('firefly.purge_data_title') }}</h3>
</div>
- <div class="box-body with-border">
+ <div class="card-body">
<div class="col-lg-12">
<p class="text-info">
- {{ 'purge_data_expl'|_ }}
+ {{ __('firefly.purge_data_expl') }}
</p>
<p>
<button type="button"
- data-success="{{ trans('firefly.purged_all_records')|escape('html') }}"
+ data-success="{{ trans('firefly.purged_all_records') }}"
data-type="purge" class="confirm btn btn-warning btn-sm"><span
- class="bi bi-trash"></span> {{ 'purge_all_data'|_ }}</button>
+ class="bi bi-trash"></span> {{ __('firefly.purge_all_data') }}</button>
</p>
-
</div>
</div>
</div>
- <!-- delete stuff -->
+
<div class="card mb-2">
<div class="card-header">
- <h3 class="card-title">{{ 'delete_data_title'|_ }}</h3>
+ <h3 class="card-title">{{ __('firefly.delete_data_title') }}</h3>
</div>
- <div class="box-body with-border">
+ <div class="card-body">
<div class="col-lg-12">
<p class="text-info">
- {{ 'permanent_delete_stuff'|_ }}
+ {{ __('firefly.permanent_delete_stuff') }}
</p>
- <h4>{{ 'financial_control'|_ }}</h4>
+ <h4>{{ __('firefly.financial_control') }}</h4>
<div class="btn-group">
<button type="button"
- data-success="{{ trans('firefly.deleted_all_budgets')|escape('html') }}"
+ data-success="{{ trans('firefly.deleted_all_budgets') }}"
data-type="budgets" class="confirm btn btn-danger btn-sm"><span
- class="bi bi-pie-chart"></span> {{ 'delete_all_budgets'|_ }}</button>
+ class="bi bi-pie-chart"></span> {{ __('firefly.delete_all_budgets') }}</button>
<button type="button"
- data-success="{{ trans('firefly.deleted_all_bills')|escape('html') }}"
+ data-success="{{ trans('firefly.deleted_all_bills') }}"
data-type="bills" class="confirm btn btn-danger btn-sm"><span
- class="bi bi-calendar-o"></span> {{ 'delete_all_bills'|_ }}</button>
+ class="bi bi-calendar-o"></span> {{ __('firefly.delete_all_bills') }}</button>
<button type="button"
- data-success="{{ trans('firefly.deleted_all_piggy_banks')|escape('html') }}"
+ data-success="{{ trans('firefly.deleted_all_piggy_banks') }}"
data-type="piggy_banks" class="confirm btn btn-danger btn-sm"><span
- class="fa fa-bullseye"></span> {{ 'delete_all_piggy_banks'|_ }}</button>
+ class="fa fa-bullseye"></span> {{ __('firefly.delete_all_piggy_banks') }}</button>
</div>
- <h4>{{ 'automation'|_ }}</h4>
+ <h4>{{ __('firefly.automation') }}</h4>
<div class="btn-group">
<button type="button"
- data-success="{{ trans('firefly.deleted_all_rules')|escape('html') }}"
+ data-success="{{ trans('firefly.deleted_all_rules') }}"
data-type="rules" class="confirm btn btn-danger btn-sm"><span
- class="fa fa-random"></span> {{ 'delete_all_rules'|_ }}</button>
+ class="fa fa-random"></span> {{ __('firefly.delete_all_rules') }}</button>
<button type="button"
- data-success="{{ trans('firefly.deleted_all_recurring')|escape('html') }}"
+ data-success="{{ trans('firefly.deleted_all_recurring') }}"
data-type="recurring" class="confirm btn btn-danger btn-sm"><span
- class="fa fa-paint-brush"></span> {{ 'delete_all_recurring'|_ }}
+ class="fa fa-paint-brush"></span> {{ __('firefly.delete_all_recurring') }}
</button>
</div>
- <h4>{{ 'classification'|_ }}</h4>
+ <h4>{{ __('firefly.classification') }}</h4>
<div class="btn-group">
<button type="button"
- data-success="{{ trans('firefly.deleted_all_categories')|escape('html') }}"
+ data-success="{{ trans('firefly.deleted_all_categories') }}"
data-type="categories" class="confirm btn btn-danger btn-sm"><span
- class="bi bi-bookmark"></span> {{ 'delete_all_categories'|_ }}</button>
+ class="bi bi-bookmark"></span> {{ __('firefly.delete_all_categories') }}</button>
<button type="button"
- data-success="{{ trans('firefly.deleted_all_tags')|escape('html') }}"
+ data-success="{{ trans('firefly.deleted_all_tags') }}"
data-type="tags" class="confirm btn btn-danger btn-sm"><span
- class="bi bi-tag"></span> {{ 'delete_all_tags'|_ }}</button>
+ class="bi bi-tag"></span> {{ __('firefly.delete_all_tags') }}</button>
<button type="button"
- data-success="{{ trans('firefly.deleted_all_object_groups')|escape('html') }}"
+ data-success="{{ trans('firefly.deleted_all_object_groups') }}"
data-type="object_groups" class="confirm btn btn-danger btn-sm"><span
- class="fa fa-envelope-o"></span> {{ 'delete_all_object_groups'|_ }}
+ class="fa fa-envelope-o"></span> {{ __('firefly.delete_all_object_groups') }}
</button>
</div>
<h4>{{ __('firefly.accounts') }}</h4>
<p>
- <em class="text-danger">{{ 'also_delete_transactions'|_ }}</em>
+ <em class="text-danger">{{ __('firefly.also_delete_transactions') }}</em>
</p>
<div class="btn-group">
<button type="button"
- data-success="{{ trans('firefly.deleted_all_accounts')|escape('html') }}"
+ data-success="{{ trans('firefly.deleted_all_accounts') }}"
data-type="accounts" class="confirm btn btn-danger btn-sm"><span
- class="fa fa-credit-card"></span> {{ 'delete_all_accounts'|_ }}</button>
+ class="fa fa-credit-card"></span> {{ __('firefly.delete_all_accounts') }}</button>
<button type="button"
- data-success="{{ trans('firefly.deleted_all_asset_accounts')|escape('html') }}"
+ data-success="{{ trans('firefly.deleted_all_asset_accounts') }}"
data-type="asset_accounts" class="confirm btn btn-danger btn-sm"><span
- class="bi bi-cash"></span> {{ 'delete_all_asset_accounts'|_ }}</button>
+ class="bi bi-cash"></span> {{ __('firefly.delete_all_asset_accounts') }}</button>
<button type="button"
- data-success="{{ trans('firefly.deleted_all_expense_accounts')|escape('html') }}"
+ data-success="{{ trans('firefly.deleted_all_expense_accounts') }}"
data-type="expense_accounts" class="confirm btn btn-danger btn-sm"><span
- class="fa fa-shopping-cart"></span> {{ 'delete_all_expense_accounts'|_ }}
+ class="fa fa-shopping-cart"></span> {{ __('firefly.delete_all_expense_accounts') }}
</button>
<button type="button"
- data-success="{{ trans('firefly.deleted_all_revenue_accounts')|escape('html') }}"
+ data-success="{{ trans('firefly.deleted_all_revenue_accounts') }}"
data-type="revenue_accounts" class="confirm btn btn-danger btn-sm"><span
- class="bi bi-download"></span> {{ 'delete_all_revenue_accounts'|_ }}
+ class="bi bi-download"></span> {{ __('firefly.delete_all_revenue_accounts') }}
</button>
<button type="button"
- data-success="{{ trans('firefly.deleted_all_liabilities')|escape('html') }}"
+ data-success="{{ trans('firefly.deleted_all_liabilities') }}"
data-type="liabilities" class="confirm btn btn-danger btn-sm"><span
- class="fa fa-ticket"></span> {{ 'delete_all_liabilities'|_ }}</button>
+ class="fa fa-ticket"></span> {{ __('firefly.delete_all_liabilities') }}</button>
</div>
<h4>{{ __('firefly.accounts') }}</h4>
<p>
<em class="text-info">
- {{ 'delete_unused_accounts'|_ }}
+ {{ __('firefly.delete_unused_accounts') }}
</em>
</p>
<div class="btn-group">
<button type="button"
- data-success="{{ trans('firefly.deleted_all_unused_accounts')|escape('html') }}"
+ data-success="{{ trans('firefly.deleted_all_unused_accounts') }}"
data-type="unused_accounts" class="confirm btn btn-warning btn-sm"><span
- class="fa fa-credit-card"></span> {{ 'delete_all_unused_accounts'|_ }}
+ class="fa fa-credit-card"></span> {{ __('firefly.delete_all_unused_accounts') }}
</button>
</div>
@@ -230,41 +220,52 @@
<h4> {{ __('firefly.transactions') }}</h4>
<div class="btn-group">
<button type="button"
- data-success="{{ trans('firefly.deleted_all_transactions')|escape('html') }}"
+ data-success="{{ trans('firefly.deleted_all_transactions') }}"
data-type="transactions" class="confirm btn btn-danger btn-sm"><span
- class="bi bi-arrow-left-right"></span> {{ 'delete_all_transactions'|_ }}
+ class="bi bi-arrow-left-right"></span> {{ __('firefly.delete_all_transactions') }}
</button>
<button type="button"
- data-success="{{ trans('firefly.deleted_all_withdrawals')|escape('html') }}"
+ data-success="{{ trans('firefly.deleted_all_withdrawals') }}"
data-type="withdrawals" class="confirm btn btn-danger btn-sm"><span
- class="bi bi-arrow-left"></span> {{ 'delete_all_withdrawals'|_ }}
+ class="bi bi-arrow-left"></span> {{ __('firefly.delete_all_withdrawals') }}
</button>
<button type="button"
- data-success="{{ trans('firefly.deleted_all_deposits')|escape('html') }}"
+ data-success="{{ trans('firefly.deleted_all_deposits') }}"
data-type="deposits" class="confirm btn btn-danger btn-sm"><span
- class="bi bi-arrow-right"></span> {{ 'delete_all_deposits'|_ }}
+ class="bi bi-arrow-right"></span> {{ __('firefly.delete_all_deposits') }}
</button>
<button type="button"
- data-success="{{ trans('firefly.deleted_all_transfers')|escape('html') }}"
+ data-success="{{ trans('firefly.deleted_all_transfers') }}"
data-type="transfers" class="confirm btn btn-danger btn-sm"><span
- class="bi bi-arrow-left-right"></span> {{ 'delete_all_transfers'|_ }}</button>
+ class="bi bi-arrow-left-right"></span> {{ __('firefly.delete_all_transfers') }}</button>
</div>
</div>
</div>
</div>
</div>
-
</div>
</div>
</div>
@endsection
@section('scripts')
+ @vite(['js/pages/generic.js'])
<script type="text/javascript" nonce="{{ $JS_NONCE }}">
+ var postUrl = "{{ route('preferences.test-notification') }}";
+
+ $(document).ready(function () {
+ $('button[data-bs-toggle="tab"]').on('show.bs.tab', function (e) {
+ localStorage.setItem('profileActiveTab', $(e.target).attr('data-bs-target'));
+ });
+ var activeTab = localStorage.getItem('profileActiveTab');
+ if (activeTab) {
+ $('#profileTab button[data-bs-target="' + activeTab + '"]').click();
+ }
+ });
var deleteAPIRoute = '{{ route('api.v1.data.destroy') }}';
- var confirmText = '{{ trans('firefly.are_you_sure')|escape('js') }}';
+ var confirmText = '{{ trans('firefly.are_you_sure') }}';
$(document).ready(function () {
$('.confirm').on('click', function (e) {
if(!confirm(confirmText)) {
diff --git a/resources/views/profile/logout-other-sessions.blade.php b/resources/views/profile/logout-other-sessions.blade.php
index 02167d8f85..109dc7c90c 100644
--- a/resources/views/profile/logout-other-sessions.blade.php
+++ b/resources/views/profile/logout-other-sessions.blade.php
@@ -24,8 +24,8 @@
</div>
</div>
</div>
- <div class="card-footer">
- <button type="submit" class="btn btn-success text-end">{{ 'logout_other_sessions'|_ }}</button>
+ <div class="card-footer text-end ">
+ <button type="submit" class="btn btn-success ">{{ 'logout_other_sessions'|_ }}</button>
</div>
</div>
</div>
@@ -33,3 +33,6 @@
</form>
{% include 'partials.password-modal' %}
@endsection
+@section('scripts')
+ @vite(['js/pages/generic.js'])
+@endsection
diff --git a/resources/views/profile/mfa/backup-codes-intro.blade.php b/resources/views/profile/mfa/backup-codes-intro.blade.php
index 0459d130a4..5c1b3f192a 100644
--- a/resources/views/profile/mfa/backup-codes-intro.blade.php
+++ b/resources/views/profile/mfa/backup-codes-intro.blade.php
@@ -1,9 +1,4 @@
@extends('layout.v3.session')
-
-
- {{ Breadcrumbs.render(Route.getCurrentRoute.getName) }}
-@endsection
-
@section('content')
<form method="POST" action="{{ route('profile.mfa.backup-codes.post') }}" accept-charset="UTF-8" class="form-horizontal" id="preferences_code">
<input name="_token" type="hidden" value="{{ csrf_token() }}">
@@ -11,15 +6,15 @@
<div class="col-lg-6 offset-lg-3 col-md-12 col-sm-12 col-xs-12">
<div class="card mb-2">
<div class="card-header">
- <h3 class="card-title">{{ 'mfa_backup_codes_title'|_ }}</h3>
+ <h3 class="card-title">{{ __('firefly.mfa_backup_codes_title') }}</h3>
</div>
<div class="card-body">
<div class="form group">
<p>
- {{ 'mfa_backup_codes_intro'|_ }}
+ {{ __('firefly.mfa_backup_codes_intro') }}
</p>
<p class="text-danger">
- {{ 'mfa_backup_codes_quick'|_ }}
+ {{ __('firefly.mfa_backup_codes_quick') }}
</p>
</div>
</div>
@@ -31,11 +26,11 @@
<div class="col-lg-6 offset-lg-3 col-md-12 col-sm-12 col-xs-12">
<div class="card mb-2">
<div class="card-body">
- {!! ExpandedForm::password('password', {helpText: 'current_password_confirm_mfa'|_}) }}
- {!! ExpandedForm::text('code', code) }}
+ {!! ExpandedForm::password('password', ['helpText' => __('firefly.current_password_confirm_mfa')]) !!}
+ {!! ExpandedForm::text('code', $code ?? '') !!}
</div>
<div class="card-footer">
- <button type="submit" class="btn btn-success">{{ 'pref_save_settings'|_ }}</button>
+ <button type="submit" class="btn btn-success">{{ __('firefly.pref_save_settings') }}</button>
</div>
</div>
</div>
@@ -44,3 +39,6 @@
</form>
@endsection
+@section('scripts')
+ @vite(['js/pages/generic.js'])
+@endsection
diff --git a/resources/views/profile/mfa/backup-codes-post.blade.php b/resources/views/profile/mfa/backup-codes-post.blade.php
index 594c3c09f0..deb8665dcd 100644
--- a/resources/views/profile/mfa/backup-codes-post.blade.php
+++ b/resources/views/profile/mfa/backup-codes-post.blade.php
@@ -1,28 +1,26 @@
@extends('layout.v3.session')
-
-
- {{ Breadcrumbs.render(Route.getCurrentRoute.getName) }}
-@endsection
-
@section('content')
<div class="row">
<div class="col-lg-6 offset-lg-3 col-md-12 col-sm-12 col-xs-12">
<div class="card mb-2">
<div class="card-header">
- <h3 class="card-title">{{ 'mfa_backup_codes_post_title'|_ }}</h3>
+ <h3 class="card-title">{{ __('firefly.mfa_backup_codes_post_title') }}</h3>
</div>
<div class="card-body">
<div class="form group">
<p>
- {{ '2fa_backup_codes'|_ }}
+ {{ __('firefly.2fa_backup_codes') }}
</p>
- <textarea rows="10" class="form-control" readonly>{{ codes }}</textarea>
+ <textarea rows="10" class="form-control" readonly>{{ $codes }}</textarea>
</div>
</div>
<div class="card-footer">
- <a class="btn btn-success" href="{{ route('profile.mfa.index') }}">{{ '2fa_i_have_them'|_ }}</a>
+ <a class="btn btn-success" href="{{ route('profile.mfa.index') }}">{{ __('firefly.2fa_i_have_them') }}</a>
</div>
</div>
</div>
</div>
@endsection
+@section('scripts')
+ @vite(['js/pages/generic.js'])
+@endsection
diff --git a/resources/views/profile/mfa/disable-mfa.blade.php b/resources/views/profile/mfa/disable-mfa.blade.php
index 88b69a6cb2..82b16784b5 100644
--- a/resources/views/profile/mfa/disable-mfa.blade.php
+++ b/resources/views/profile/mfa/disable-mfa.blade.php
@@ -1,9 +1,4 @@
@extends('layout.v3.session')
-
-
- {{ Breadcrumbs.render(Route.getCurrentRoute.getName) }}
-@endsection
-
@section('content')
<form method="POST" action="{{ route('profile.mfa.disableMFA.post') }}" accept-charset="UTF-8" class="form-horizontal">
<input name="_token" type="hidden" value="{{ csrf_token() }}">
@@ -11,11 +6,11 @@
<div class="col-lg-6 offset-lg-3 col-md-12 col-sm-12 col-xs-12">
<div class="card mb-2">
<div class="card-header">
- <h3 class="card-title">{{ 'disable_mfa_page'|_ }}</h3>
+ <h3 class="card-title">{{ __('firefly.disable_mfa_page') }}</h3>
</div>
<div class="card-body">
<p class="hidden-print">
- {{ 'disable_mfa_intro'|_ }}
+ {!! __('firefly.disable_mfa_intro') !!}
</p>
</div>
</div>
@@ -25,11 +20,11 @@
<div class="col-lg-6 offset-lg-3 col-md-12 col-sm-12 col-xs-12">
<div class="card mb-2">
<div class="card-body">
- {!! ExpandedForm::password('password', {helpText: 'current_password_confirm_mfa'|_}) }}
- {!! ExpandedForm::text('code', code) }}
+ {!! ExpandedForm::password('password', ['helpText' => __('firefly.current_password_confirm_mfa')]) !!}
+ {!! ExpandedForm::text('code', $code ?? '') !!}
</div>
<div class="card-footer">
- <button type="submit" class="btn btn-danger">{{ 'pref_disable_mfa'|_ }}</button>
+ <button type="submit" class="btn btn-danger">{{__('firefly.pref_disable_mfa') }}</button>
</div>
</div>
</div>
@@ -37,6 +32,7 @@
</form>
@endsection
@section('scripts')
+ @vite(['js/pages/generic.js'])
<script type="text/javascript" nonce="{{ $JS_NONCE }}">
$(function () {
"use strict";
diff --git a/resources/views/profile/mfa/enable-mfa.blade.php b/resources/views/profile/mfa/enable-mfa.blade.php
index 8e4f8b492d..0a60aa80c0 100644
--- a/resources/views/profile/mfa/enable-mfa.blade.php
+++ b/resources/views/profile/mfa/enable-mfa.blade.php
@@ -1,9 +1,4 @@
@extends('layout.v3.session')
-
-
- {{ Breadcrumbs.render(Route.getCurrentRoute.getName) }}
-@endsection
-
@section('content')
<form method="POST" action="{{ route('profile.mfa.enableMFA.post') }}" accept-charset="UTF-8" class="form-horizontal" id="preferences_code">
<input name="_token" type="hidden" value="{{ csrf_token() }}">
@@ -11,21 +6,21 @@
<div class="col-lg-6 offset-lg-3 col-md-12 col-sm-12 col-xs-12">
<div class="card mb-2">
<div class="card-header">
- <h3 class="card-title">{{ 'pref_two_factor_auth_code'|_ }}</h3>
+ <h3 class="card-title">{{ __('firefly.pref_two_factor_auth_code') }}</h3>
</div>
<div class="card-body">
<p class="hidden-print">
- {{ 'pref_two_factor_auth_code_help'|_ }}
+ {{ __('firefly.pref_two_factor_auth_code_help') }}
</p>
<div class="form group">
<div class="col-sm-8 col-md-offset-4 hidden-print">
- <img src="{{ image }}" alt="{{ 'pref_two_factor_qr_code'|_ }}">
+ <img src="{{ $image }}" alt="{{ __('firefly.pref_two_factor_qr_code') }}">
</div>
<p class="hidden-print">
- {{ trans('firefly.2fa_use_secret_instead', {secret: secret|escape})|raw }}
+ {!! trans('firefly.2fa_use_secret_instead', ['secret' => $secret]) !!}
</p>
<p class="hidden-print text-danger">
- {{ 'mfa_warning_code_changes'|_ }}
+ {{ __('firefly.mfa_warning_code_changes') }}
</p>
</div>
</div>
@@ -36,11 +31,11 @@
<div class="col-lg-6 offset-lg-3 col-md-12 col-sm-12 col-xs-12">
<div class="card mb-2">
<div class="card-body">
- {!! ExpandedForm::password('password', {helpText: 'current_password_confirm_mfa'|_}) }}
- {!! ExpandedForm::text('code', code) }}
+ {!! ExpandedForm::password('password', ['helpText' => __('firefly.current_password_confirm_mfa')]) !!}
+ {!! ExpandedForm::text('code', $code ?? '') !!}
</div>
- <div class="card-footer">
- <button type="submit" class="btn btn-success btn-lg">{{ 'pref_save_settings'|_ }}</button>
+ <div class="card-footer text-end">
+ <button type="submit" class="btn btn-success btn-lg">{{ __('firefly.pref_save_settings') }}</button>
</div>
</div>
</div>
@@ -48,6 +43,8 @@
</form>
@endsection
@section('scripts')
+ @vite(['js/pages/generic.js'])
+
<script type="text/javascript" nonce="{{ $JS_NONCE }}">
$(function () {
"use strict";
diff --git a/resources/views/profile/mfa/index.blade.php b/resources/views/profile/mfa/index.blade.php
index 94f8c58825..fed97a87d0 100644
--- a/resources/views/profile/mfa/index.blade.php
+++ b/resources/views/profile/mfa/index.blade.php
@@ -1,44 +1,38 @@
@extends('layout.v3.session')
-
-
- {{ Breadcrumbs.render(Route.getCurrentRoute.getName) }}
-@endsection
-
@section('content')
-
<div class="row">
<div class="col-lg-8 offset-lg-2 col-md-12 col-sm-12">
<div class="card mb-2">
<div class="card-header">
<h3 class="card-title">
- {{ 'mfa_index_title'|_ }}
+ {{ __('firefly.mfa_index_title') }}
</h3>
</div>
<div class="card-body">
<p>
- {% if enabledMFA == true %}
- {{ 'mfa_index_enabled'|_ }}
+ @if(true === $enabledMFA)
+ {{ __('firefly.mfa_index_enabled') }}
@endif
- {% if enabledMFA == false %}
- {{ 'mfa_index_disabled'|_ }}
+ @if(false === $enabledMFA)
+ {{ __('firefly.mfa_index_disabled') }}
@endif
</p>
<p>
- {{ 'mfa_index_intro'|_ }}
+ {{ __('firefly.mfa_index_intro') }}
</p>
<p>
- {{ 'mfa_index_owner'|_ }}
+ {{ __('firefly.mfa_index_owner') }}
</p>
- {% if enabledMFA == true %}
+ @if(true === $enabledMFA)
<div class="btn-group">
- <a href="{{ route('profile.mfa.disableMFA') }}" class="btn btn-danger"><em class="fa fa-unlock-alt"></em> {{ 'pref_two_factor_auth_disable_2fa'|_ }}</a>
- <a href="{{ route('profile.mfa.backup-codes') }}" class="btn btn-outline-secondary"><em class="bi bi-calculator"></em> {{ 'pref_two_factor_new_backup_codes'|_ }}</a>
+ <a href="{{ route('profile.mfa.disableMFA') }}" class="btn btn-danger"><em class="fa fa-unlock-alt"></em> {{ __('firefly.pref_two_factor_auth_disable_2fa') }}</a>
+ <a href="{{ route('profile.mfa.backup-codes') }}" class="btn btn-outline-secondary"><em class="bi bi-calculator"></em> {{ __('firefly.pref_two_factor_new_backup_codes') }}</a>
</div>
@endif
- {% if enabledMFA == false %}
+ @if(false === $enabledMFA)
<p>
- <a class="btn btn-info" href="{{ route('profile.mfa.enableMFA') }}"><em class="bi bi-calculator"></em> {{ 'pref_enable_two_factor_auth'|_ }}</a>
+ <a class="btn btn-info" href="{{ route('profile.mfa.enableMFA') }}"><em class="bi bi-calculator"></em> {{ __('firefly.pref_enable_two_factor_auth') }}</a>
</p>
@endif
</div>
@@ -46,3 +40,6 @@
</div>
</div>
@endsection
+@section('scripts')
+ @vite(['js/pages/generic.js'])
+@endsection
diff --git a/resources/views/profile/new-backup-codes.blade.php b/resources/views/profile/new-backup-codes.blade.php
index 7c113e0634..53a90bffae 100644
--- a/resources/views/profile/new-backup-codes.blade.php
+++ b/resources/views/profile/new-backup-codes.blade.php
@@ -1,29 +1 @@
-@extends('layout.v3.session')
-
-
- {{ Breadcrumbs.render(Route.getCurrentRoute.getName) }}
-@endsection
-
-@section('content')
- <div class="row">
- <div class="col-lg-6 offset-lg-3 col-md-12 col-sm-12 col-xs-12">
- <div class="card mb-2">
- <div class="card-header">
- <h3 class="card-title">{{ 'pref_two_factor_auth_code'|_ }}</h3>
- </div>
- <div class="card-body">
- <div class="form group">
- <p>
- {{ '2fa_backup_codes'|_ }}
- </p>
- <pre>{{ codes }}</pre>
- </div>
- </div>
- <div class="card-footer">
- <a class="btn btn-success" href="{{ route('profile.index') }}">{{ '2fa_i_have_them'|_ }}</a>
- </div>
- </div>
- </div>
- </div>
-
-@endsection
+Empty
diff --git a/resources/views/profile/oauth/index.blade.php b/resources/views/profile/oauth/index.blade.php
index f2fc3318a3..0803dac996 100644
--- a/resources/views/profile/oauth/index.blade.php
+++ b/resources/views/profile/oauth/index.blade.php
@@ -1,76 +1,533 @@
-{% set VUE_SCRIPT_NAME = 'profile' %}
@extends('layout.v3.session')
-
-
- {{ Breadcrumbs.render(Route.getCurrentRoute.getName) }}
-@endsection
-
@section('content')
-
<div class="row">
<div class="col-lg-8 offset-lg-2 col-md-12 col-sm-12">
<div class="row">
<div class="col-lg-12">
<div class="card mb-2">
- <div class="box-header">
- <h3 class="card-title">{{ 'oauth_tokens'|_ }}</h3>
+ <div class="card-header">
+ <h3 class="card-title">{{ __('firefly.oauth_tokens') }}</h3>
</div>
<div class="card-body">
<p>
- {{ trans('firefly.oauth_tokens_explain', {link: link})|raw }}
+ {!! trans('firefly.oauth_tokens_explain', ['link' => $link]) !!}
</p>
</div>
</div>
</div>
</div>
- <div role="tabpanel" class="tab-pane" id="oauth">
- <div id="passport_clients"></div>
+ <div x-data="index">
+ <div class="row">
+ <div class="col-lg-12">
+ <div>
+ <div class="card mb-2">
+ <div class="card-header">
+ <div class="row">
+ <div class="col">
+ <h3 class="card-title">
+ {{ __('firefly.profile_oauth_clients') }}
+ </h3>
+ </div>
+ <div class="col text-end">
+ <a class="btn btn-default" tabindex="-1" @click="showCreateClientForm">
+ {{ __('firefly.profile_oauth_create_new_client') }}
+ </a>
+ </div>
+ </div>
+
+
+ </div>
+ <div class="card-body">
+ <!-- Current Clients -->
+ <p>
+ {{ __('firefly.profile_oauth_clients_explain') }}
+ </p>
+ <p>
+ {{ __('firefly.profile_oauth_clients_external_auth') }}
+ </p>
+ <template x-if="clients.length === 0">
+ <p>
+ {{ __('firefly.profile_oauth_no_clients') }}
+ </p>
+ </template>
+ <template x-if="clients.length > 0">
+ <table class="table table-responsive table-borderless mb-0">
+ <thead>
+ <tr>
+ <th class="width-30"
+ scope="col">{{ __('firefly.profile_oauth_client_id') }}</th>
+ <th class="width-30" scope="col">{{ __('firefly.name') }}</th>
+ <th class="width-40" scope="col"
+ style="text-align:right">{{ __('firefly.actions') }}</th>
+ </tr>
+ </thead>
+
+ <tbody>
+ <template x-for="client in clients">
+ <tr>
+ <!-- ID -->
+ <td style="vertical-align: middle;">
+ <span x-text="client.id"></span>
+ </td>
+
+ <!-- Name -->
+ <td style="vertical-align: middle;">
+ <span x-text="client.name"></span>
+ </td>
+
+ <!-- Secret -->
+ <td style="vertical-align: middle;text-align:right">
+ <div class="btn-group">
+ <template x-if="client.confidential">
+ <a :title="i18next.t('firefly.regenerate_secret')"
+ class="btn btn-default btn-sm"
+ @click="regenerateSecret(client)">
+ <em :title="i18next.t('firefly.regenerate_secret')"
+ class="fa fa-retweet"></em>
+ {{ __('firefly.regenerate_secret') }}
+ </a>
+ </template>
+ <a class="btn btn-sm btn-default"
+ :title="i18next.t('firefly.edit')" tabindex="-1"
+ @click="edit(client)">
+ <em :title="i18next.t('firefly.edit')"
+ class="fa fa-pencil"></em>
+ {{ __('firefly.edit') }}
+ </a>
+ <a :title="i18next.t('firefly.delete')"
+ class="btn btn-sm btn-danger" @click="destroy(client)">
+ <em :title="i18next.t('firefly.delete')"
+ class="fa fa-trash"></em>
+ {{ __('firefly.delete') }}
+ </a>
+ </div>
+ </td>
+ </tr>
+ </template>
+ </tbody>
+ </table>
+ </template>
+ </div>
+ <div class="card-footer text-end">
+ <a class="btn btn-default" tabindex="-1" @click="showCreateClientForm">
+ {{ __('firefly.profile_oauth_create_new_client') }}
+ </a>
+ </div>
+ </div>
+
+ <!-- Create Client Modal -->
+ <div id="modal-create-client" class="modal fade" role="dialog" tabindex="-1">
+ <div class="modal-dialog">
+ <div class="modal-content">
+ <div class="modal-header">
+ <h4 class="modal-title">
+ {{ __('firefly.profile_oauth_create_client') }}
+ </h4>
+
+ <button aria-hidden="true" class="close" data-bs-dismiss="modal"
+ type="button">&times;
+ </button>
+ </div>
+
+ <div class="modal-body">
+ <!-- Form Errors -->
+ <template x-if="createForm.errors.length > 0">
+ <div class="alert alert-danger">
+ <p class="mb-0">
+ <strong>{{ __('firefly.profile_whoops') }}</strong> {{__('firefly.profile_something_wrong')}}
+ </p>
+ <br>
+ <ul>
+ <template x-for="error in createForm.errors">
+ <li>
+ <span x-text="error"></span>
+ </li>
+ </template>
+ </ul>
+ </div>
+ </template>
+
+ <!-- Create Client Form -->
+ <form role="form" aria-label="form">
+ <!-- Name -->
+ <div class="form-group row">
+ <label
+ class="col-md-3 col-form-label">{{ __('firefly.name') }}</label>
+
+ <div class="col-md-9">
+ <input id="create-client-name" x-model="createForm.name"
+ class="form-control"
+ spellcheck="false"
+ type="text" @keyup.enter="store">
+
+ <span
+ class="form-text text-muted">{{ __('firefly.profile_oauth_name_help') }}</span>
+ </div>
+ </div>
+
+ <!-- Redirect URIs -->
+ <div class="form-group row">
+ <label class="col-md-3 col-form-label">{{
+ __('firefly.profile_oauth_redirect_url')
+ }}</label>
+
+ <div class="col-md-9">
+ <input x-model="createForm.redirect_uris" class="form-control"
+ name="redirect_uris"
+ spellcheck="false"
+ type="text" @keyup.enter="store">
+
+ <span
+ class="form-text text-muted">{{ __('firefly.profile_oauth_redirect_url_help') }}</span>
+ </div>
+ </div>
+
+ <!-- Confidential -->
+ <div class="form-group row">
+ <label class="col-md-3 col-form-label">{{
+ __('firefly.profile_oauth_confidential')
+ }}</label>
+
+ <div class="col-md-9">
+ <div class="checkbox">
+ <label>
+ <input x-model="createForm.confidential"
+ type="checkbox">
+ </label>
+ </div>
+
+ <span class="form-text text-muted">
+ {{ __('firefly.profile_oauth_confidential_help') }}
+ </span>
+ </div>
+ </div>
+ </form>
+ </div>
+
+ <!-- Modal Actions -->
+ <div class="modal-footer">
+ <button class="btn btn-secondary" data-bs-dismiss="modal" type="button">{{
+ __('firefly.close')
+ }}
+ </button>
+
+ <button class="btn btn-primary" type="button" @click="store">
+ {{ __('firefly.profile_create') }}
+ </button>
+ </div>
+ </div>
+ </div>
+ </div>
+
+ <!-- Edit Client Modal -->
+ <div id="modal-edit-client" class="modal fade" role="dialog" tabindex="-1">
+ <div class="modal-dialog">
+ <div class="modal-content">
+ <div class="modal-header">
+ <h4 class="modal-title">
+ {{ __('firefly.profile_oauth_edit_client') }}
+ </h4>
+
+ <button aria-hidden="true" class="close" data-bs-dismiss="modal"
+ type="button">&times;
+ </button>
+ </div>
+
+ <div class="modal-body">
+ <!-- Form Errors -->
+ <template x-if="editForm.errors.length > 0">
+ <div class="alert alert-danger">
+ <p class="mb-0"><strong>{{ __('firefly.profile_whoops') }}</strong> {{
+ __('firefly.profile_something_wrong')
+ }}</p>
+ <br>
+ <ul>
+ <template x-for="error in editForm.errors">
+ <li>
+ <span x-text="error"></span>
+ </li>
+ </template>
+ </ul>
+ </div>
+ </template>
+
+ <!-- Edit Client Form -->
+ <form role="form" aria-label="form">
+ <!-- Name -->
+ <div class="form-group row">
+ <label
+ class="col-md-3 col-form-label">{{ __('firefly.name') }}</label>
+
+ <div class="col-md-9">
+ <input id="edit-client-name" x-model="editForm.name"
+ class="form-control"
+ spellcheck="false"
+ type="text" @keyup.enter="update">
+
+ <span class="form-text text-muted">
+ {{ __('firefly.profile_oauth_name_help') }}
+ </span>
+ </div>
+ </div>
+
+ <!-- Redirect URL -->
+ <div class="form-group row">
+ <label class="col-md-3 col-form-label">{{
+ __('firefly.profile_oauth_redirect_url')
+ }}</label>
+
+ <div class="col-md-9">
+ <input x-model="editForm.redirect_uris" class="form-control"
+ name="redirect_uris"
+ spellcheck="false"
+ type="text" @keyup.enter="update">
+
+ <span class="form-text text-muted">
+ {{ __('firefly.profile_oauth_redirect_url_help') }}
+ </span>
+ </div>
+ </div>
+ </form>
+ </div>
+
+ <!-- Modal Actions -->
+ <div class="modal-footer">
+ <button class="btn btn-secondary" data-bs-dismiss="modal" type="button">{{
+ __('firefly.close')
+ }}
+ </button>
+
+ <button class="btn btn-primary" type="button" @click="update">
+ {{ __('firefly.profile_save_changes') }}
+ </button>
+ </div>
+ </div>
+ </div>
+ </div>
+
+ <!-- Client Secret Modal -->
+ <div id="modal-client-secret" class="modal fade" role="dialog" tabindex="-1">
+ <div class="modal-dialog">
+ <div class="modal-content">
+ <div class="modal-header">
+ <h4 class="modal-title">
+ {{ __('firefly.profile_oauth_client_secret_title') }}
+ </h4>
+
+ <button aria-hidden="true" class="close" data-bs-dismiss="modal"
+ type="button">&times;
+ </button>
+ </div>
+
+ <div class="modal-body">
+ <p>
+ {{ __('firefly.profile_oauth_client_secret_expl') }}
+ </p>
+ <input id="secret_box" x-model="clientSecret" class="form-control"
+ type="text" spellcheck="false">
+ </div>
+
+ <!-- Modal Actions -->
+ <div class="modal-footer">
+ <button class="btn btn-secondary" data-bs-dismiss="modal"
+ type="button">{{__('firefly.close') }}
+ </button>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ {{-- personal access tokens --}}
+ <div class="row">
+ <div class="col-lg-12">
+ <div class="card mb-2">
+ <div class="card-header">
+ <div class="row">
+ <div class="col">
+ <h3 class="card-title">{{ __('firefly.profile_personal_access_tokens') }}</h3>
+ </div>
+ <div class="col text-end">
+ <a class="btn btn-default " tabindex="-1" @click="showCreateTokenForm">
+ {{ __('firefly.profile_create_new_token') }}
+ </a>
+ </div>
+ </div>
+ </div>
+ <div class="card-body">
+ <p>
+ {{ __('firefly.explain_pats') }}
+ </p>
+
+ <template x-if="tokens.length === 0">
+ <p class="mb-0">
+ {{ __('firefly.profile_no_personal_access_token') }}
+ </p>
+ </template>
+
+ <!-- Personal Access Tokens -->
+ <template x-if="tokens.length > 0">
+ <table class="table table-responsive table-borderless mb-0">
+ <thead>
+ <tr>
+ <th scope="col">{{ __('firefly.name') }}</th>
+ <th scope="col">{{ __('firefly.expires_at') }}</th>
+ <th scope="col"></th>
+ </tr>
+ </thead>
+
+ <tbody>
+ <template x-for="token in tokens">
+ <tr>
+ <!-- Client Name -->
+ <td style="vertical-align: middle;">
+ <span x-text="token.name"></span>
+ </td>
+ <!-- expires at -->
+ <td style="vertical-align: middle;">
+ <span x-text="new Date(token.expires_at).toLocaleString()"></span>
+ </td>
+
+ <!-- Delete Button -->
+ <td style="vertical-align: middle;">
+ <a class="action-link text-danger" @click="revoke(token)">
+ {{ __('firefly.delete') }}
+ </a>
+ </td>
+ </tr>
+ </template>
+ </tbody>
+ </table>
+ </template>
+ </div>
+ <div class="card-footer text-end">
+ <a class="btn btn-default" tabindex="-1" @click="showCreateTokenForm">
+ {{ __('firefly.profile_create_new_token') }}
+ </a>
+ </div>
+ </div>
+ </div>
+
+ <!-- Create Token Modal -->
+ <div id="modal-create-token" class="modal fade" role="dialog" tabindex="-1">
+ <div class="modal-dialog">
+ <div class="modal-content">
+ <div class="modal-header">
+ <h4 class="modal-title">
+ {{ __('firefly.profile_create_token') }}
+ </h4>
+
+ <button aria-hidden="true" class="close" data-dismiss="modal" type="button">
+ &times;
+ </button>
+ </div>
+
+ <div class="modal-body">
+ <!-- Form Errors -->
+ <template x-if="form.errors.length > 0">
+ <div class="alert alert-danger">
+ <p class="mb-0"><strong>{{ __('firefly.profile_whoops') }}</strong>
+ {{ __('firefly.profile_something_wrong') }}</p>
+ <br>
+ <ul>
+ <template x-for="error in form.errors">
+ <li>
+ <span x-text="error"></span>
+ </li>
+ </template>
+ </ul>
+ </div>
+ </template>
+
+ <!-- Create Token Form -->
+ <form role="form" @submit.prevent="storePat">
+ <!-- Name -->
+ <div class="form-group row">
+ <label class="col-md-4 col-form-label">{{ __('firefly.name') }}</label>
+
+ <div class="col-md-6">
+ <input id="create-token-name" x-model="form.name" class="form-control"
+ name="name" type="text" spellcheck="false">
+ </div>
+ </div>
+
+ <!-- Scopes -->
+ <template x-if="scopes.length > 0">
+ <div class="form-group row">
+ <label
+ class="col-md-4 col-form-label">{{ __('firefly.profile_scopes') }}</label>
+
+ <div class="col-md-6">
+ <template x-for="scope in scopes">
+ <div>
+ <div class="checkbox">
+ <label>
+ <input :checked="scopeIsAssigned(scope.id)"
+ type="checkbox"
+ @click="toggleScope(scope.id)">
+ <span x-text="scope.id"></span>
+ </label>
+ </div>
+ </div>
+ </template>
+ </div>
+ </div>
+ </template>
+ </form>
+ </div>
+
+ <!-- Modal Actions -->
+ <div class="modal-footer">
+ <button class="btn btn-secondary" data-dismiss="modal"
+ type="button">{{__('firefly.close')}}
+ </button>
+ <button class="btn btn-primary" type="button" @click="storePat">
+ Create
+ </button>
+ </div>
+ </div>
+ </div>
+ </div>
+
+ <!-- Access Token Modal -->
+ <div id="modal-access-token" class="modal fade" role="dialog" tabindex="-1">
+ <div class="modal-dialog">
+ <div class="modal-content">
+ <div class="modal-header">
+ <h4 class="modal-title">
+ {{ __('firefly.profile_personal_access_token') }}
+ </h4>
+
+ <button aria-hidden="true" class="close" data-dismiss="modal" type="button">
+ &times;
+ </button>
+ </div>
+
+ <div class="modal-body">
+ <p>
+ {{ __('firefly.profile_personal_access_token_explanation') }}
+ </p>
+ <textarea class="form-control" id="token_box" readonly rows="20"
+ style="width:100%;" x-text="accessToken"></textarea>
+ </div>
+
+ <!-- Modal Actions -->
+ <div class="modal-footer">
+ <button class="btn btn-secondary" data-dismiss="modal" type="button">{{
+ __('firefly.close')
+ }}
+ </button>
+ </div>
+ </div>
+ </div>
+ </div>
</div>
+ </div>
</div>
</div>
@endsection
@section('scripts')
- <script type="text/javascript" nonce="{{ $JS_NONCE }}">
- var deleteAPIRoute = '{{ route('api.v1.data.destroy') }}';
- var confirmText = '{{ trans('firefly.are_you_sure')|escape('js') }}';
- $(document).ready(function () {
- $('.confirm').on('click', function (e) {
- if(!confirm(confirmText)) {
- return false;
- }
- var link = $(e.currentTarget);
- var classes = link.find('i').attr('class');
- var url = deleteAPIRoute + '?objects=' + link.data('type');
- // different URL for purge route:
- if (link.data('type') === 'purge') {
- url = '{{ route('api.v1.data.purge') }}';
- }
- if (link.data('type') === 'unused_accounts') {
- url = deleteAPIRoute + '?objects=not_assets_liabilities&unused=true';
- }
-
- // replace icon with loading thing
- link.prop('disabled', true);
- link.find('i').removeClass().addClass('fa fa-spin fa-spinner');
-
- // call API:
- $.ajax({
- method: 'DELETE',
- url: url,
- }).done(
- function () {
- // enable button again:
- link.prop('disabled', false);
- link.find('i').removeClass().addClass(classes);
- alert(link.data('success'));
- }
- ).fail(function () {
- link.find('i').removeClass().addClass('fa fa-exclamation-triangle');
- alert('Could not delete. Sorry.');
- });
- return false;
- });
- });
- </script>
+ @vite(['js/pages/profile/oauth.js'])
@endsection
diff --git a/resources/views/recurring/create.blade.php b/resources/views/recurring/create.blade.php
index beb2c0d599..bcddfe6905 100644
--- a/resources/views/recurring/create.blade.php
+++ b/resources/views/recurring/create.blade.php
@@ -157,8 +157,8 @@
<div class="card-body">
{!! ExpandedForm::optionsList('create','recurrence') }}
</div>
- <div class="card-footer">
- <button type="submit" class="btn text-end btn-success">
+ <div class="card-footer text-end">
+ <button type="submit" class="btn btn-success">
{{ ('store_new_recurrence')|_ }}
</button>
</div>
diff --git a/resources/views/recurring/edit.blade.php b/resources/views/recurring/edit.blade.php
index 461d43fee2..ba9ffdef4f 100644
--- a/resources/views/recurring/edit.blade.php
+++ b/resources/views/recurring/edit.blade.php
@@ -159,8 +159,8 @@
<div class="card-body">
{!! ExpandedForm::optionsList('update','recurrence') }}
</div>
- <div class="card-footer">
- <button type="submit" class="btn text-end btn-success">
+ <div class="card-footer text-end">
+ <button type="submit" class="btn btn-success">
{{ ('update_recurrence')|_ }}
</button>
</div>
diff --git a/resources/views/recurring/old-index.blade.php b/resources/views/recurring/old-index.blade.php
deleted file mode 100644
index 18ba5f1468..0000000000
--- a/resources/views/recurring/old-index.blade.php
+++ /dev/null
@@ -1,166 +0,0 @@
-@extends('layout.v3.session')
-
-
- {{ Breadcrumbs.render(Route.getCurrentRoute.getName) }}
-@endsection
-
-@section('content')
- <!-- block with list of recurring transaction -->
- {% if total > 0 %}
- <div class="row">
- <div class="col-lg-12 col-md-12 col-sm-12">
- <div class="card mb-2">
- <div class="card-header">
- <h3 class="card-title">
- {{ 'recurrences'|_ }}
- </h3>
- <div class="box-tools text-end">
- <div class="btn-group">
- <button class="btn btn-box-tool dropdown-toggle" data-toggle="dropdown"><span class="bi bi-list"></span></button>
- <ul class="dropdown-menu" role="menu">
- <li><a href="{{ route('recurring.create') }}"><span class="bi bi-plus-circle"></span> {{ ('make_new_recurring')|_ }}</a></li>
- </ul>
- </div>
- </div>
- </div>
-
- <div class="card-body p-0">
- <div class="p-2">
- <a href="{{ route('recurring.create') }}" class="btn btn-success"><span class="bi bi-plus-circle"></span> {{ ('make_new_recurring')|_ }}
- </a>
- </div>
-
- <!-- list of recurring here -->
- <div class="pl-2">
- {{ paginator.links('pagination.bootstrap-4')|raw }}
- </div>
- <table class="table table-responsive table-hover sortable">
- <thead>
- <tr>
- <th class="hidden-sm hidden-xs" data-defaultsort="disabled">&nbsp;</th>
- <th data-defaultsign="az">{{ trans('list.title') }}</th>
- <th data-defaultsort="disabled">{{ trans('list.transaction_s') }}</th>
- <th data-defaultsort="disabled">{{ trans('list.repetitions') }}</th>
- <th data-defaultsign="month" data-dateformat="{{ madMomentJS }}">{{ trans('list.next_due') }}</th>
- </tr>
- </thead>
- <tbody>
- {% for rt in paginator %}
- <tr>
- <td class="hidden-sm hidden-xs">
- <div class="btn-group btn-group-sm edit_tr_buttons">
- <a class="btn btn-outline-secondary btn-xs" title="{{ __('firefly.edit') }}" href="{{ route('recurring.edit',rt.id) }}"><span
- class="bi bi-pencil"></span></a><a class="btn btn-danger btn-xs" title="{{ __('firefly.delete') }}"
- href="{{ route('recurring.delete',rt.id) }}"><span
- class="bi bi-trash"></span></a>
- </div>
- </td>
- <td data-value="{{ rt.title }}">
- {% if rt.attachments > 0 %}
- <span class="bi bi-paperclip"></span>
- @endif
- {% if rt.active == false %}<s>@endif
- {{ rt.type|_ }}:
- <a href="{{ route('recurring.show',rt.id) }}">{{ rt.title }}</a>
- {% if rt.active == false %}</s> ({{ 'inactive'|_|lower }})@endif
- {% if rt.description|length > 0 %}
- <small><br>{{ rt.description }}</small>
- @endif
-
-
- </td>
- <td data-value="0">
- <ol>
- {% for rtt in rt.transactions %}
- <li>
- {{-- normal amount + comma --}}
- {!! format_amount_by_symbol(rtt['amount'],rtt['currency_symbol'],rtt['currency_decimal_places']) !!}{% if rtt['foreign_amount'] == null %},@endif
-
- {{-- foreign amount + comma --}}
- {% if null != rtt['foreign_amount'] %}
- ({!! format_amount_by_symbol(rtt['foreign_amount'],rtt['foreign_currency_symbol'],rtt['foreign_currency_decimal_places']) !!}),
- @endif
- <a href="{{ route('accounts.show', rtt['source_id']) }}">{{ rtt['source_name'] }}</a>
- &rarr;
- <a href="{{ route('accounts.show', rtt['destination_id']) }}">{{ rtt['destination_name'] }}</a>
- </li>
- @endforeach
- </ol>
- </td>
- <td>
- {% if null != rt.repeat_until and today > rt.repeat_until %}
- <span class="text-danger">
- {{ trans('firefly.repeat_until_in_past', {date: rt.repeat_until.isoFormat($monthAndDayFormat) }) }}
- </span>
- @endif
- <ul>
- {% for rep in rt.repetitions %}
- <li>{{ rep.description }}
- {% if rep.repetition_skip == 1 %}
- ({{ trans('firefly.recurring_skips_one')|lower }}).
- @endif
- {% if rep.repetition_skip > 1 %}
- ({{ trans('firefly.recurring_skips_more', {count: rep.repetition_skip})|lower }}).
- @endif
- {% if rep.weekend == 3 %}
- <br>{{ 'will_jump_friday'|_ }}
- @endif
- {% if rep.weekend == 4 %}
- <br>{{ 'will_jump_monday'|_ }}
- @endif
- {% if rep.weekend == 2 %}
- <br>{{ 'except_weekends'|_ }}
- @endif
- </li>
- @endforeach
- </ul>
- <p>
- {% if null == rt.repeat_until and rt.repetitions == 0 %}
- {{ 'recurring_repeats_forever'|_ }}.
- @endif
- {% if null != rt.repeat_until and rt.repetitions == 0 %}
- {{ trans('firefly.recurring_repeats_until', {date: rt.repeat_until.isoFormat($monthAndDayFormat)}) }}.
- @endif
- {% if null == rt.repeat_until and rt.nr_of_repetitions != 0 %}
- {{ trans_choice('firefly.recurring_repeats_x_times', rt.nr_of_repetitions) }}.
- @endif
- </p>
- </td>
- <td>
- <ul>
- {% for rep in rt.repetitions %}
- {% for occ in rep.occurrences %}
- {% if loop.index0 < 2 %}
- <li>{{ occ.isoFormat($monthAndDayFormat) }}</li>
- @endif
- @endforeach
- @endforeach
- </ul>
- </td>
- </tr>
- @endforeach
- </tbody>
- </table>
- <div class="pl-2">
- {{ paginator.links('pagination.bootstrap-4')|raw }}
- </div>
- </div>
- <div class="card-footer">
- <a href="{{ route('recurring.create') }}" class="btn btn-success"><span class="bi bi-plus-circle"></span> {{ ('make_new_recurring')|_ }}</a>
- </div>
- </div>
- </div>
- </div>
- @endif
- {% if total == 0 and page == 1 %}
- {% include 'partials.empty' with {objectType: 'default', type: 'recurring',route: route('recurring.create')} %}
- @endif
-@endsection
-
-@section('styles')
- <link rel="stylesheet" href="v1/css/bootstrap-sortable.css?v={{ $FF_BUILD_TIME }}" type="text/css" media="all" nonce="{{ $JS_NONCE }}">
-@endsection
-
-@section('scripts')
- <script type="text/javascript" src="v1/js/lib/bootstrap-sortable.js?v={{ $FF_BUILD_TIME }}" nonce="{{ $JS_NONCE }}"></script>
-@endsection
diff --git a/resources/views/rules/rule-group/edit.blade.php b/resources/views/rules/rule-group/edit.blade.php
index a14619cf02..1b8285259f 100644
--- a/resources/views/rules/rule-group/edit.blade.php
+++ b/resources/views/rules/rule-group/edit.blade.php
@@ -44,8 +44,8 @@
<div class="card-body">
{!! ExpandedForm::optionsList('update','rule-group') !!}
</div>
- <div class="card-footer">
- <button type="submit" class="btn text-end btn-success">{{ __('firefly.update_rule_group') }}</button>
+ <div class="card-footer text-end">
+ <button type="submit" class="btn btn-success">{{ __('firefly.update_rule_group') }}</button>
</div>
</div>
</div>
diff --git a/resources/views/rules/rule-group/select-transactions.blade.php b/resources/views/rules/rule-group/select-transactions.blade.php
index 0877b12687..9a9c0005eb 100644
--- a/resources/views/rules/rule-group/select-transactions.blade.php
+++ b/resources/views/rules/rule-group/select-transactions.blade.php
@@ -26,9 +26,9 @@
</div>
</div>
</div>
- <div class="card-footer">
+ <div class="card-footer text-end">
<input type="submit" name="submit" value="{{ __('firefly.execute') }}" id="do-execute-button"
- class="btn btn-success text-end"/>
+ class="btn btn-success "/>
</div>
</div>
</div>
diff --git a/resources/views/rules/rule/create.blade.php b/resources/views/rules/rule/create.blade.php
index eca4617520..5a23c2be8a 100644
--- a/resources/views/rules/rule/create.blade.php
+++ b/resources/views/rules/rule/create.blade.php
@@ -59,7 +59,7 @@
<div class="card-header">
<h3 class="card-title">{{ __('firefly.rule_triggers') }}</h3>
</div>
- <div class="box-body rule-trigger-box">
+ <div class="card-body rule-trigger-box">
<table class="table table-sm table-bordered table-striped">
<thead>
<tr>
@@ -94,7 +94,7 @@
<div class="card-header">
<h3 class="card-title">{{ __('firefly.rule_actions') }}</h3>
</div>
- <div class="box-body rule-action-box">
+ <div class="card-body rule-action-box">
<table class="table table-sm table-bordered table-striped">
<thead>
<tr>
@@ -130,8 +130,8 @@
{!! ExpandedForm::checkbox('run_after_form',1,null, ['helpText' => trans('firefly.rule_run_after_creation')]) !!}
{!! ExpandedForm::optionsList('create','rule') !!}
</div>
- <div class="card-footer">
- <button type="submit" class="btn text-end btn-success">{{ __('firefly.store_new_rule') }}</button>
+ <div class="card-footer text-end">
+ <button type="submit" class="btn btn-success">{{ __('firefly.store_new_rule') }}</button>
</div>
</div>
diff --git a/resources/views/rules/rule/edit.blade.php b/resources/views/rules/rule/edit.blade.php
index 0b57e65cf8..d6a9bcb586 100644
--- a/resources/views/rules/rule/edit.blade.php
+++ b/resources/views/rules/rule/edit.blade.php
@@ -42,7 +42,7 @@
<div class="card-header">
<h3 class="card-title">{{ __('firefly.rule_triggers') }}</h3>
</div>
- <div class="box-body rule-trigger-box">
+ <div class="card -body rule-trigger-box">
<table class="table table-sm table-bordered table-striped">
<thead>
<tr>
@@ -114,8 +114,8 @@
{!! ExpandedForm::checkbox('run_after_form',1,null, ['helpText' => trans('firefly.rule_run_after_edit')]) !!}
{!! ExpandedForm::optionsList('update','rule') !!}
</div>
- <div class="card-footer">
- <button type="submit" class="btn text-end btn-success">{{ __('firefly.update_rule') }}</button>
+ <div class="card-footer text-end">
+ <button type="submit" class="btn btn-success">{{ __('firefly.update_rule') }}</button>
</div>
</div>
diff --git a/resources/views/settings/link/create.blade.php b/resources/views/settings/link/create.blade.php
index 99dcfe2640..02795c225a 100644
--- a/resources/views/settings/link/create.blade.php
+++ b/resources/views/settings/link/create.blade.php
@@ -26,8 +26,8 @@
<div class="card-body">
{!! ExpandedForm::optionsList('create','link_type') !!}
</div>
- <div class="card-footer">
- <button type="submit" class="btn text-end btn-success">{{ __('firefly.store_new_link_type') }}</button>
+ <div class="card-footer text-end">
+ <button type="submit" class="btn btn-success">{{ __('firefly.store_new_link_type') }}</button>
</div>
</div>
diff --git a/resources/views/settings/link/delete.blade.php b/resources/views/settings/link/delete.blade.php
index 4d59dceab5..0e48a7f0fc 100644
--- a/resources/views/settings/link/delete.blade.php
+++ b/resources/views/settings/link/delete.blade.php
@@ -37,9 +37,9 @@
@endif
</div>
- <div class="card-footer">
+ <div class="card-footer text-end">
<input type="submit" name="submit" value="{{ trans('form.deletePermanently') }}"
- class="btn text-end btn-danger"/>
+ class="btn btn-danger"/>
<a href="{{ URL::previous() }}" class="btn-outline-secondary btn">{{ trans('form.cancel') }}</a>
</div>
</div>
diff --git a/resources/views/settings/link/edit.blade.php b/resources/views/settings/link/edit.blade.php
index d9fcd3aa1c..145e4a8445 100644
--- a/resources/views/settings/link/edit.blade.php
+++ b/resources/views/settings/link/edit.blade.php
@@ -30,8 +30,8 @@
<div class="card-body">
{!! ExpandedForm::optionsList('update','link_type') !!}
</div>
- <div class="card-footer">
- <button type="submit" class="btn text-end btn-success">
+ <div class="card-footer text-end">
+ <button type="submit" class="btn btn-success">
{{ __('firefly.update_link_type') }}
</button>
</div>
diff --git a/resources/views/settings/users/edit.blade.php b/resources/views/settings/users/edit.blade.php
index b20c000ea7..c70fc574d9 100644
--- a/resources/views/settings/users/edit.blade.php
+++ b/resources/views/settings/users/edit.blade.php
@@ -43,8 +43,8 @@
<div class="card-body">
{!! ExpandedForm::optionsList('update','user') !!}
</div>
- <div class="card-footer">
- <button type="submit" class="btn text-end btn-success">
+ <div class="card-footer text-end">
+ <button type="submit" class="btn btn-success">
{{ __('firefly.update_user') }}
</button>
</div>
diff --git a/resources/views/settings/users/index.blade.php b/resources/views/settings/users/index.blade.php
index 7ae668eb35..acae76cd3c 100644
--- a/resources/views/settings/users/index.blade.php
+++ b/resources/views/settings/users/index.blade.php
@@ -15,8 +15,8 @@
</p>
{!! ExpandedForm::text('invited_user',null, ['type' => 'email', 'label' => __('firefly.invited_user_mail')]) !!}
</div>
- <div class="card-footer">
- <button type="submit" class="btn text-end btn-success">
+ <div class="card-footer text-end">
+ <button type="submit" class="btn btn-success">
{{ __('firefly.invite_user') }}
</button>
</div>
diff --git a/resources/views/tags/create.blade.php b/resources/views/tags/create.blade.php
index 4cae79bfc7..b3588784f7 100644
--- a/resources/views/tags/create.blade.php
+++ b/resources/views/tags/create.blade.php
@@ -1,13 +1,8 @@
@extends('layout.v3.session')
-
-
- {{ Breadcrumbs.render(Route.getCurrentRoute.getName) }}
-@endsection
-
@section('content')
<!-- set location data high up -->
<script type="text/javascript" nonce="{{ $JS_NONCE }}">
- var locations = {{ locations|json_encode|raw }};
+ var locations = {!! json_encode($locations) !!};
var mapboxToken = "{{ config('firefly.mapbox_api_key') }}";
</script>
<form method="POST" action="{{ route('tags.store') }}" accept-charset="UTF-8" class="form-horizontal" id="store"
@@ -20,7 +15,7 @@
<h3 class="card-title">{{ __('firefly.mandatoryFields') }}</h3>
</div>
<div class="card-body">
- {!! ExpandedForm::text('tag') }}
+ {!! ExpandedForm::text('tag') !!}
</div>
</div>
</div>
@@ -32,9 +27,9 @@
<h3 class="card-title">{{ __('firefly.optionalFields') }}</h3>
</div>
<div class="card-body">
- {!! ExpandedForm::date('date') }}
- {!! ExpandedForm::textarea('description') }}
- {!! ExpandedForm::file('attachments[]', ['multiple' => 'multiple','helpText' => trans('firefly.upload_max_file_size', ['size' => print_nice_filesize($uploadSize)])]) }}
+ {!! ExpandedForm::date('date') !!}
+ {!! ExpandedForm::textarea('description') !!}
+ {!! ExpandedForm::file('attachments[]', ['multiple' => 'multiple','helpText' => trans('firefly.upload_max_file_size', ['size' => print_nice_filesize($uploadSize)])]) !!}
</div>
</div>
</div>
@@ -47,11 +42,11 @@
<h3 class="card-title">{{ __('firefly.options') }}</h3>
</div>
<div class="card-body">
- {!! ExpandedForm::optionsList('create','tag') }}
+ {!! ExpandedForm::optionsList('create','tag') !!}
</div>
- <div class="card-footer">
- <button type="submit" class="btn btn-success text-end">
- {{ 'store_new_tag'|_ }}
+ <div class="card-footer text-end">
+ <button type="submit" class="btn btn-success">
+ {{ __('firefly.store_new_tag') }}
</button>
</div>
</div>
@@ -61,6 +56,7 @@
</form>
@endsection
@section('scripts')
+ @vite(['js/pages/generic.js'])
<script type="text/javascript" src="v1/js/lib/modernizr-custom.js?v={{ $FF_BUILD_TIME }}"
nonce="{{ $JS_NONCE }}"></script>
<script type="text/javascript" src="v1/js/lib/jquery-ui.min.js?v={{ $FF_BUILD_TIME }}" nonce="{{ $JS_NONCE }}"></script>
diff --git a/resources/views/tags/delete.blade.php b/resources/views/tags/delete.blade.php
index 54a399e1f4..28998617bc 100644
--- a/resources/views/tags/delete.blade.php
+++ b/resources/views/tags/delete.blade.php
@@ -1,18 +1,12 @@
@extends('layout.v3.session')
-
-
- {{ Breadcrumbs.render(Route.getCurrentRoute.getName, tag) }}
-@endsection
-
@section('content')
-
- <form method="POST" action="{{ route('tags.destroy',tag.id) }}" accept-charset="UTF-8" class="form-horizontal" id="destroy">
+ <form method="POST" action="{{ route('tags.destroy',$tag->id) }}" accept-charset="UTF-8" class="form-horizontal" id="destroy">
<input name="_token" type="hidden" value="{{ csrf_token() }}">
<div class="row">
<div class="col-lg-6 offset-lg-3 col-md-6 col-sm-12">
<div class="card card-danger card-outline">
<div class="card-header">
- <h3 class="card-title">{{ trans('firefly.delete_tag',{tag: tag.tag}) }}</h3>
+ <h3 class="card-title">{{ trans('firefly.delete_tag',['tag' => $tag->tag]) }}</h3>
</div>
<div class="card-body">
<p class="text-danger">
@@ -20,17 +14,17 @@
</p>
<p>
- {{ trans('form.tag_areYouSure', {'tag': tag.tag}) }}
+ {{ trans('form.tag_areYouSure', ['tag' => $tag->tag]) }}
</p>
<p>
- {% if tag.transactionjournals.count() > 0 %}
- {{ Lang::choice('form.tag_keep_transactions', tag.transactionjournals.count(), {count: tag.transactionjournals.count()}) }}
+ @if($tag->transactionJournals->count() > 0)
+ {{ trans_choice('form.tag_keep_transactions', $tag->transactionjournals->count(), ['count' => $tag->transactionjournals->count()]) }}
@endif
</p>
</div>
- <div class="card-footer">
- <input type="submit" name="submit" value="{{ trans('form.deletePermanently') }}" class="btn text-end btn-danger"/>
+ <div class="card-footer text-end">
+ <input type="submit" name="submit" value="{{ trans('form.deletePermanently') }}" class="btn btn-danger"/>
<a href="{{ URL::previous() }}" class="btn-outline-secondary btn">{{ trans('form.cancel') }}</a>
</div>
</div>
@@ -38,3 +32,6 @@
</div>
</form>
@endsection
+@section('scripts')
+ @vite(['js/pages/generic.js'])
+@endsection
diff --git a/resources/views/tags/edit.blade.php b/resources/views/tags/edit.blade.php
index b681479227..22e48c747a 100644
--- a/resources/views/tags/edit.blade.php
+++ b/resources/views/tags/edit.blade.php
@@ -1,21 +1,16 @@
@extends('layout.v3.session')
-
-
- {{ Breadcrumbs.render(Route.getCurrentRoute.getName, tag) }}
-@endsection
-
@section('content')
<!-- set location data high up -->
<script type="text/javascript" nonce="{{ $JS_NONCE }}">
- var locations = {{ locations|json_encode|raw }};
+ var locations = {{ json_encode($locations) }};
var mapboxToken = "{{ config('firefly.mapbox_api_key') }}";
</script>
- <form method="post" action="{{ route('tags.update',tag.id) }}" class="form-horizontal" accept-charset="UTF-8"
+ <form method="post" action="{{ route('tags.update',$tag->id) }}" class="form-horizontal" accept-charset="UTF-8"
enctype="multipart/form-data">
<input type="hidden" name="_token" value="{{ csrf_token() }}"/>
- <input type="hidden" name="id" value="{{ tag.id }}"/>
+ <input type="hidden" name="id" value="{{ $tag->id }}"/>
<div class="row">
<div class="col-lg-5 col-md-5 col-sm-12">
@@ -24,7 +19,7 @@
<h3 class="card-title">{{ __('firefly.mandatoryFields') }}</h3>
</div>
<div class="card-body">
- {!! ExpandedForm::text('tag', tag.tag) }}
+ {!! ExpandedForm::text('tag', $tag->tag) !!}
</div>
</div>
</div>
@@ -36,9 +31,9 @@
<h3 class="card-title">{{ __('firefly.optionalFields') }}</h3>
</div>
<div class="card-body">
- {!! ExpandedForm::date('date', tag.date.format('Y-m-d')) }}
- {!! ExpandedForm::textarea('description', tag.description) }}
- {!! ExpandedForm::file('attachments[]', ['multiple' => 'multiple','helpText' => trans('firefly.upload_max_file_size', ['size' => print_nice_filesize($uploadSize)])]) }}
+ {!! ExpandedForm::date('date', $tag->date->format('Y-m-d')) !!}
+ {!! ExpandedForm::textarea('description', $tag->description) !!}
+ {!! ExpandedForm::file('attachments[]', ['multiple' => 'multiple','helpText' => trans('firefly.upload_max_file_size', ['size' => print_nice_filesize($uploadSize)])]) !!}
</div>
</div>
</div>
@@ -51,11 +46,11 @@
<h3 class="card-title">{{ __('firefly.options') }}</h3>
</div>
<div class="card-body">
- {!! ExpandedForm::optionsList('update','tag') }}
+ {!! ExpandedForm::optionsList('update','tag') !!}
</div>
- <div class="card-footer">
- <button type="submit" class="btn text-end btn-success">
- {{ 'update_tag'|_ }}
+ <div class="card-footer text-end">
+ <button type="submit" class="btn btn-success">
+ {{ __('firefly.update_tag') }}
</button>
</div>
</div>
@@ -67,6 +62,7 @@
@endsection
@section('scripts')
+ @vite(['js/pages/generic.js'])
<script type="text/javascript" src="v1/js/lib/modernizr-custom.js?v={{ $FF_BUILD_TIME }}"
nonce="{{ $JS_NONCE }}"></script>
<script type="text/javascript" src="v1/js/lib/jquery-ui.min.js?v={{ $FF_BUILD_TIME }}" nonce="{{ $JS_NONCE }}"></script>
diff --git a/resources/views/tags/index.blade.php b/resources/views/tags/index.blade.php
index b2736d4051..a3d05104a3 100644
--- a/resources/views/tags/index.blade.php
+++ b/resources/views/tags/index.blade.php
@@ -35,8 +35,8 @@
@endforeach
<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
- <p>
- <button type="submit" class="btn text-end btn-danger confirm-tag-delete">
+ <p class="text-end">
+ <button type="submit" class="btn btn-danger confirm-tag-delete">
<span class="bi bi-trash"></span> {{ __('firefly.delete_all_selected_tags') }}
</button>
</p>
diff --git a/resources/views/tags/show.blade.php b/resources/views/tags/show.blade.php
index cd8529f2ec..7ecf5a26b0 100644
--- a/resources/views/tags/show.blade.php
+++ b/resources/views/tags/show.blade.php
@@ -293,6 +293,7 @@
<link rel="stylesheet" href="v1/lib/leaflet/leaflet.css?v={{ $FF_BUILD_TIME }}"/>
@endsection
@section('scripts')
+ @vite(['js/pages/generic.js'])
<script type="text/javascript" nonce="{{ $JS_NONCE }}">
// location stuff
@if($location)
diff --git a/resources/views/transactions/bulk/edit.blade.php b/resources/views/transactions/bulk/edit.blade.php
index ae2eb88ae5..c053e990ff 100644
--- a/resources/views/transactions/bulk/edit.blade.php
+++ b/resources/views/transactions/bulk/edit.blade.php
@@ -168,8 +168,8 @@
<div class="card-footer">
<div class="row">
- <div class="col-lg-8">
- <input type="submit" name="submit" value="{{ trans('form.update_all_journals') }}" class="btn btn-success text-end"/>
+ <div class="col-lg-8 text-end">
+ <input type="submit" name="submit" value="{{ trans('form.update_all_journals') }}" class="btn btn-success "/>
<a href="{{ route('index') }}" class="btn-outline-secondary btn">{{ trans('form.cancel') }}</a>
</div>
</div>
diff --git a/resources/views/transactions/convert.blade.php b/resources/views/transactions/convert.blade.php
index e8ab1432af..1540263b7c 100644
--- a/resources/views/transactions/convert.blade.php
+++ b/resources/views/transactions/convert.blade.php
@@ -280,9 +280,9 @@
@endforeach
</table>
</div>
- <div class="card-footer">
+ <div class="card-footer text-end">
<a href="{{ route('transactions.show', group.id) }}" class="btn btn-danger">{{ 'cancel'|_ }}</a>
- <button type="submit" id="transaction-btn" class="btn btn-success text-end">
+ <button type="submit" id="transaction-btn" class="btn btn-success ">
{{ trans('form.convert_'~sourceType.type) }}
</button>
</div>
diff --git a/resources/views/transactions/links/delete.blade.php b/resources/views/transactions/links/delete.blade.php
index a3ff926cc4..1214697a08 100644
--- a/resources/views/transactions/links/delete.blade.php
+++ b/resources/views/transactions/links/delete.blade.php
@@ -22,8 +22,8 @@
{{ trans('form.journal_link_areYouSure', {source: link.source.description|escape, destination: link.destination.description|escape, source_link: route('transactions.show', [link.source_id]) , destination_link: route('transactions.show',link.destination_id)})|raw }}
</p>
</div>
- <div class="card-footer">
- <input type="submit" name="submit" value="{{ trans('form.deletePermanently') }}" class="btn text-end btn-danger"/>
+ <div class="card-footer text-end">
+ <input type="submit" name="submit" value="{{ trans('form.deletePermanently') }}" class="btn btn-danger"/>
<a href="{{ URL::previous() }}" class="btn-outline-secondary btn">{{ trans('form.cancel') }}</a>
</div>
</div>
diff --git a/resources/views/transactions/mass/edit.blade.php b/resources/views/transactions/mass/edit.blade.php
index 14c50da933..4683da2fd1 100644
--- a/resources/views/transactions/mass/edit.blade.php
+++ b/resources/views/transactions/mass/edit.blade.php
@@ -171,8 +171,8 @@
@endforeach
</table>
</div>
- <div class="card-footer">
- <input type="submit" name="submit" value="{{ trans('form.update_all_journals') }}" class="btn btn-success text-end"/>
+ <div class="card-footer text-end">
+ <input type="submit" name="submit" value="{{ trans('form.update_all_journals') }}" class="btn btn-success "/>
<a href="{{ route('index') }}" class="btn-outline-secondary btn">{{ trans('form.cancel') }}</a>
</div>
</div>
diff --git a/resources/views/webhooks/delete.blade.php b/resources/views/webhooks/delete.blade.php
index be4dcda219..5741db6272 100644
--- a/resources/views/webhooks/delete.blade.php
+++ b/resources/views/webhooks/delete.blade.php
@@ -20,9 +20,9 @@
{{ trans('form.webhook_areYouSure', {'title': webhook.title}) }}
</p>
</div>
- <div class="card-footer">
+ <div class="card-footer text-end">
<input type="submit" id="button" name="submit" value="{{ trans('form.deletePermanently') }}"
- class="btn text-end btn-danger"/>
+ class="btn btn-danger"/>
<a href="{{ URL::previous() }}" class="btn-outline-secondary btn">{{ trans('form.cancel') }}</a>
</div>
</div>