416 lines
26 KiB
PHP
416 lines
26 KiB
PHP
<x-app-layout>
|
|
<x-slot name="header">
|
|
<h2 class="font-semibold text-xl text-gray-800 dark:text-gray-200 leading-tight">
|
|
{{ __('configuration.Options') }}
|
|
</h2>
|
|
</x-slot>
|
|
|
|
<div class="py-12" x-data="optionForm">
|
|
<div class="max-w-7xl mx-auto sm:px-6 lg:px-8 space-y-6">
|
|
|
|
<!-- Company details -->
|
|
<div class="p-4 sm:p-8 bg-white dark:bg-gray-800 shadow sm:rounded-lg">
|
|
<div class="max-w">
|
|
<section>
|
|
<details>
|
|
<summary class="text-lg font-medium text-gray-900 dark:text-gray-100 cursor-pointer">
|
|
{{ __('configuration.Company details') }}
|
|
</summary>
|
|
<form class="mt-6 space-y-2" @submit.prevent="">
|
|
<p class="text-red-600 font-bold" x-text="message" x-show="error"></p>
|
|
<div class="flex flex-row items-start">
|
|
<x-input-label class="w-1/4" for="company_logo"
|
|
:value="__('configuration.Company logo')"/>
|
|
<x-text-input id="company_logo" name="company_logo" type="file"
|
|
class="mt-1 block w-full"
|
|
x-show="options.company_logo == null"
|
|
@change="updatePreview()"/>
|
|
<div class="w-full flex flex-row" x-show="options.company_logo != null">
|
|
<img class="w-1/4" :src="options.company_logo"/>
|
|
<div class="ml-12">
|
|
<x-primary-button @click="clearPreview()">{{ __('form.Change') }}</x-primary-button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="flex flex-row items-center">
|
|
<x-input-label class="w-1/4" for="company_name"
|
|
:value="__('configuration.Company name')"/>
|
|
<x-text-input id="company_name" name="company_name" type="text"
|
|
class="mt-1 block w-full"
|
|
:value="old('company_name')" required autofocus
|
|
autocomplete="company_name"
|
|
x-model="options.company_name"/>
|
|
</div>
|
|
<div class="flex flex-row items-center">
|
|
<x-input-label class="w-1/4" for="company_additional"
|
|
:value="__('configuration.Company additional')"/>
|
|
<x-text-input id="company_additional" name="company_additional" type="text"
|
|
class="mt-1 block w-full"
|
|
:value="old('company_additional')" autofocus
|
|
autocomplete="company_additional"
|
|
x-model="options.company_additional"/>
|
|
</div>
|
|
<div class="flex flex-row items-center">
|
|
<div class="w-1/4 flex flex-row items-center">
|
|
<x-input-label for="representative"
|
|
:value="__('configuration.Representative')"/>
|
|
<x-tooltip>{{ __('configuration.Tooltip representative') }}</x-tooltip>
|
|
</div>
|
|
<x-text-input id="representative" name="representative" type="text"
|
|
class="mt-1 block w-full"
|
|
:value="old('representative')" required autofocus
|
|
autocomplete="representative"
|
|
x-model="options.representative"/>
|
|
</div>
|
|
<div class="flex flex-row items-center">
|
|
<x-input-label class="w-1/4" for="address" :value="__('configuration.Address')"/>
|
|
<x-text-input id="address" name="address" type="text" class="mt-1 block w-full"
|
|
:value="old('address')" required autofocus autocomplete="address"
|
|
x-model="options.address"/>
|
|
</div>
|
|
<div class="flex flex-row items-center">
|
|
<x-input-label class="w-1/4" for="zip" :value="__('configuration.Zip')"/>
|
|
<x-text-input id="zip" name="zip" type="text" class="mt-1 block w-full"
|
|
:value="old('zip')" required autofocus autocomplete="zip"
|
|
x-model="options.zip"/>
|
|
</div>
|
|
<div class="flex flex-row items-center">
|
|
<x-input-label class="w-1/4" for="city" :value="__('configuration.City')"/>
|
|
<x-text-input id="city" name="city" type="text" class="mt-1 block w-full"
|
|
:value="old('city')" required autofocus autocomplete="city"
|
|
x-model="options.city"/>
|
|
</div>
|
|
<div class="flex flex-row items-center">
|
|
<x-input-label class="w-1/4" for="phone" :value="__('configuration.Phone')"/>
|
|
<x-text-input id="phone" name="phone" type="text" class="mt-1 block w-full"
|
|
:value="old('phone')" autofocus autocomplete="phone"
|
|
x-model="options.phone"/>
|
|
</div>
|
|
<div class="flex flex-row items-center">
|
|
<div class="w-1/4 flex flex-row items-center">
|
|
<x-input-label for="email"
|
|
:value="__('configuration.Email')"/>
|
|
<x-tooltip>{{ __('configuration.Tooltip email') }}</x-tooltip>
|
|
</div>
|
|
<x-text-input id="email" name="email" type="email" class="mt-1 block w-full"
|
|
:value="old('email')" required autofocus autocomplete="email"
|
|
x-model="options.email"/>
|
|
</div>
|
|
<div class="flex flex-row items-center">
|
|
<x-input-label class="w-1/4" for="website" :value="__('configuration.Website')"/>
|
|
<x-text-input id="website" name="website" type="url" class="mt-1 block w-full"
|
|
:value="old('website')" autofocus autocomplete="website"
|
|
x-model="options.website"/>
|
|
</div>
|
|
<div class="flex flex-row items-center">
|
|
<x-input-label class="w-1/4" for="tax_number"
|
|
:value="__('configuration.Tax number')"/>
|
|
<x-text-input id="tax_number" name="tax_number" type="text"
|
|
class="mt-1 block w-full"
|
|
:value="old('tax_number')" required autofocus
|
|
autocomplete="tax_number"
|
|
x-model="options.tax_number"/>
|
|
</div>
|
|
<div class="flex flex-row items-center">
|
|
<x-input-label class="w-1/4" for="jurisdiction"
|
|
:value="__('configuration.Jurisdiction')"/>
|
|
<x-text-input id="jurisdiction" name="jurisdiction" type="text"
|
|
class="mt-1 block w-full"
|
|
:value="old('jurisdiction')" required autofocus
|
|
autocomplete="jurisdiction"
|
|
x-model="options.jurisdiction"/>
|
|
</div>
|
|
<div class="flex flex-row items-center">
|
|
<x-input-label class="w-1/4" for="activity"
|
|
:value="__('configuration.Activity')"/>
|
|
<textarea id="activity" name="activity" rows="5"
|
|
class="border-gray-300 dark:border-gray-700 dark:bg-gray-900 dark:text-gray-300 focus:border-indigo-500 dark:focus:border-indigo-600 focus:ring-indigo-500 dark:focus:ring-indigo-600 rounded-md shadow-sm mt-1 block w-full"
|
|
autocomplete="activity"
|
|
x-model="options.activity"></textarea>
|
|
</div>
|
|
</form>
|
|
</details>
|
|
</section>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Bank details -->
|
|
<div class="p-4 sm:p-8 bg-white dark:bg-gray-800 shadow sm:rounded-lg">
|
|
<div class="max-w">
|
|
<section>
|
|
<details>
|
|
<summary class="text-lg font-medium text-gray-900 dark:text-gray-100 cursor-pointer">
|
|
{{ __('configuration.Bank details') }}
|
|
</summary>
|
|
<form class="mt-6 space-y-2" @submit.prevent="">
|
|
<div class="flex flex-row items-center">
|
|
<x-input-label class="w-1/4" for="institute_1"
|
|
:value="__('configuration.Institute'). ' 1'"/>
|
|
<x-text-input id="institute_1" name="institute_1" type="text"
|
|
class="mt-1 block w-full"
|
|
:value="old('institute_1')" required autofocus
|
|
autocomplete="institute_1"
|
|
x-model="options.institute_1"/>
|
|
</div>
|
|
<div class="flex flex-row items-center">
|
|
<x-input-label class="w-1/4" for="bic_1"
|
|
:value="__('configuration.BIC'). ' 1'"/>
|
|
<x-text-input id="bic_1" name="bic_1" type="text"
|
|
class="mt-1 block w-full"
|
|
:value="old('bic_1')" required autofocus
|
|
autocomplete="bic_1"
|
|
x-model="options.bic_1"/>
|
|
</div>
|
|
<div class="flex flex-row items-center">
|
|
<x-input-label class="w-1/4" for="iban_1"
|
|
:value="__('configuration.IBAN'). ' 1'"/>
|
|
<x-text-input id="iban_1" name="iban_1" type="text"
|
|
class="mt-1 block w-full"
|
|
:value="old('iban_1')" required autofocus
|
|
autocomplete="iban_1"
|
|
x-model="options.iban_1"/>
|
|
</div>
|
|
<div class="flex flex-row items-center">
|
|
<x-input-label class="w-1/4" for="institute_2"
|
|
:value="__('configuration.Institute'). ' 2'"/>
|
|
<x-text-input id="institute_2" name="institute_2" type="text"
|
|
class="mt-1 block w-full"
|
|
:value="old('institute_2')" required autofocus
|
|
autocomplete="institute_2"
|
|
x-model="options.institute_2"/>
|
|
</div>
|
|
<div class="flex flex-row items-center">
|
|
<x-input-label class="w-1/4" for="bic_2"
|
|
:value="__('configuration.BIC'). ' 2'"/>
|
|
<x-text-input id="bic_2" name="bic_2" type="text"
|
|
class="mt-1 block w-full"
|
|
:value="old('bic_2')" required autofocus
|
|
autocomplete="bic_2"
|
|
x-model="options.bic_2"/>
|
|
</div>
|
|
<div class="flex flex-row items-center">
|
|
<x-input-label class="w-1/4" for="iban_2"
|
|
:value="__('configuration.IBAN'). ' 2'"/>
|
|
<x-text-input id="iban_2" name="iban_2" type="text"
|
|
class="mt-1 block w-full"
|
|
:value="old('iban_2')" required autofocus
|
|
autocomplete="iban_2"
|
|
x-model="options.iban_2"/>
|
|
</div>
|
|
</form>
|
|
|
|
</details>
|
|
</section>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Correspondence -->
|
|
<div class="p-4 sm:p-8 bg-white dark:bg-gray-800 shadow sm:rounded-lg">
|
|
<div class="max-w">
|
|
<section>
|
|
<details>
|
|
<summary class="text-lg font-medium text-gray-900 dark:text-gray-100 cursor-pointer">
|
|
{{ __('configuration.Correspondence') }}
|
|
</summary>
|
|
<form class="mt-6 space-y-2" @submit.prevent="">
|
|
<div class="flex flex-row items-center">
|
|
<div class="w-1/4 flex flex-row items-center">
|
|
<x-input-label for="color_1"
|
|
:value="__('configuration.Color'). ' 1'"/>
|
|
<x-tooltip>{{ __('configuration.Tooltip color 1') }}</x-tooltip>
|
|
</div>
|
|
<x-text-input id="color_1" name="color_1" type="color"
|
|
class="mt-1 block"
|
|
:value="old('color_1')" required autofocus
|
|
autocomplete="color_1"
|
|
x-model="options.color_1"/>
|
|
</div>
|
|
<div class="flex flex-row items-center">
|
|
<div class="w-1/4 flex flex-row items-center">
|
|
<x-input-label for="color_2"
|
|
:value="__('configuration.Color'). ' 2'"/>
|
|
<x-tooltip>{{ __('configuration.Tooltip color 2') }}</x-tooltip>
|
|
</div>
|
|
<x-text-input id="color_2" name="color_2" type="color"
|
|
class="mt-1 block"
|
|
:value="old('color_2')" required autofocus
|
|
autocomplete="color_2"
|
|
x-model="options.color_2"/>
|
|
</div>
|
|
</form>
|
|
|
|
</details>
|
|
</section>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Mail derlivery -->
|
|
<div class="p-4 sm:p-8 bg-white dark:bg-gray-800 shadow sm:rounded-lg">
|
|
<div class="max-w">
|
|
<section>
|
|
<details>
|
|
<summary class="text-lg font-medium text-gray-900 dark:text-gray-100 cursor-pointer">
|
|
{{ __('configuration.Mail delivery') }}
|
|
</summary>
|
|
<form class="mt-6 space-y-2" @submit.prevent="">
|
|
<div class="flex flex-row items-center">
|
|
<div class="w-1/4 flex flex-row items-center">
|
|
<x-input-label for="mail_transport"
|
|
:value="__('configuration.Mail transport')"/>
|
|
<x-tooltip>{!! __('configuration.Tooltip Mail transport') !!}</x-tooltip>
|
|
</div>
|
|
<x-text-input id="mail_transport" name="mail_transport" type="text"
|
|
class="mt-1 block w-full"
|
|
:value="old('mail_transport')" autofocus
|
|
placeholder="smtp"
|
|
autocomplete="mail_transport"
|
|
x-model="options.mail_transport"/>
|
|
</div>
|
|
|
|
<div class="flex flex-row items-center">
|
|
<div class="w-1/4 flex flex-row items-center">
|
|
<x-input-label for="mail_host"
|
|
:value="__('configuration.Mail host')"/>
|
|
<x-tooltip>{!! __('configuration.Tooltip Mail host') !!}</x-tooltip>
|
|
</div>
|
|
<x-text-input id="mail_host" name="mail_host" type="text"
|
|
class="mt-1 block w-full"
|
|
:value="old('mail_host')" autofocus
|
|
placeholder="mail.example.com"
|
|
autocomplete="mail_host"
|
|
x-model="options.mail_host"/>
|
|
</div>
|
|
|
|
<div class="flex flex-row items-center">
|
|
<div class="w-1/4 flex flex-row items-center">
|
|
<x-input-label for="mail_port"
|
|
:value="__('configuration.Mail port')"/>
|
|
<x-tooltip>{!! __('configuration.Tooltip Mail port') !!}</x-tooltip>
|
|
</div>
|
|
<x-text-input id="mail_port" name="mail_port" type="text"
|
|
class="mt-1 block w-full"
|
|
:value="old('mail_port')" autofocus
|
|
placeholder="587"
|
|
autocomplete="mail_port"
|
|
x-model="options.mail_port"/>
|
|
</div>
|
|
|
|
<div class="flex flex-row items-center">
|
|
<div class="w-1/4 flex flex-row items-center">
|
|
<x-input-label for="mail_encryption"
|
|
:value="__('configuration.Mail encryption')"/>
|
|
<x-tooltip>{!! __('configuration.Tooltip Mail encryption') !!}</x-tooltip>
|
|
</div>
|
|
<x-text-input id="mail_encryption" name="mail_encryption" type="text"
|
|
class="mt-1 block w-full"
|
|
:value="old('mail_encryption')" autofocus
|
|
placeholder="tls"
|
|
autocomplete="mail_encryption"
|
|
x-model="options.mail_encryption"/>
|
|
</div>
|
|
|
|
<div class="flex flex-row items-center">
|
|
<div class="w-1/4 flex flex-row items-center">
|
|
<x-input-label for="mail_username"
|
|
:value="__('configuration.Mail username')"/>
|
|
<x-tooltip>{{ __('configuration.Tooltip Mail username') }}</x-tooltip>
|
|
</div>
|
|
<x-text-input id="mail_username" name="mail_username" type="text"
|
|
class="mt-1 block w-full"
|
|
:value="old('mail_username')" autofocus
|
|
placeholder="Username"
|
|
autocomplete="mail_username"
|
|
x-model="options.mail_username"/>
|
|
</div>
|
|
|
|
<div class="flex flex-row items-center">
|
|
<div class="w-1/4 flex flex-row items-center">
|
|
<x-input-label for="mail_password"
|
|
:value="__('configuration.Mail password')"/>
|
|
<x-tooltip>{{ __('configuration.Tooltip Mail password') }}</x-tooltip>
|
|
</div>
|
|
<x-text-input id="mail_password" name="mail_password" type="password"
|
|
class="mt-1 block w-full"
|
|
:value="old('mail_password')" autofocus
|
|
autocomplete="mail_password"
|
|
x-model="options.mail_password"/>
|
|
</div>
|
|
|
|
<div class="flex flex-row items-center">
|
|
<div class="w-1/4 flex flex-row items-center">
|
|
<x-input-label for="bcc_copy"
|
|
:value="__('configuration.Bcc copy')"/>
|
|
<x-tooltip>{!! __('configuration.Tooltip Bcc copy') !!}</x-tooltip>
|
|
</div>
|
|
<x-text-input id="bcc_copy" name="bcc_copy" type="checkbox"
|
|
class="mt-1 block"
|
|
:value="old('bcc_copy')" required autofocus
|
|
autocomplete="bcc_copy"
|
|
x-model="options.bcc_copy"/>
|
|
</div>
|
|
|
|
</form>
|
|
</details>
|
|
</section>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div class="flex items-center gap-4">
|
|
<x-primary-button @click="submit">{{ __('form.Save') }}</x-primary-button>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
</x-app-layout>
|
|
|
|
<script>
|
|
function optionForm() {
|
|
return {
|
|
options: {},
|
|
error: false,
|
|
message: '',
|
|
|
|
init() {
|
|
let vm = this;
|
|
axios.get('/option')
|
|
.then(function (response) {
|
|
response.data.forEach((value) => {
|
|
vm.options[value.name] = value.value;
|
|
});
|
|
})
|
|
},
|
|
|
|
updatePreview() {
|
|
let reader, files = document.getElementById('company_logo').files;
|
|
reader = new FileReader();
|
|
reader.onload = e => {
|
|
this.options.company_logo = e.target.result;
|
|
console.log(e.target.result);
|
|
|
|
};
|
|
reader.readAsDataURL(files[0]);
|
|
},
|
|
|
|
clearPreview() {
|
|
this.options.company_logo = null;
|
|
},
|
|
|
|
submit() {
|
|
let vm = this;
|
|
console.log(vm.options);
|
|
axios.post('/option', vm.options)
|
|
.then(function (response) {
|
|
console.log(response.data);
|
|
|
|
})
|
|
.catch(function (error) {
|
|
console.log(error);
|
|
})
|
|
}
|
|
}
|
|
|
|
}
|
|
</script>
|