From 9e77c9e5d51828ebce84df50bd2d003389170fa7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cihan=20=C5=9Eent=C3=BCrk?= Date: Tue, 7 Jun 2022 17:19:49 +0300 Subject: [PATCH] contact modal updated --- .../View/Components/Documents/Form.php | 6 +- .../Components/Documents/Form/Contact.php | 4 +- app/View/Components/Form/Group/Country.php | 12 +++ .../js/components/AkauntingContactCard.vue | 9 +- .../documents/form/contact.blade.php | 2 +- .../views/modals/customers/create.blade.php | 90 +++++++++++++++++-- .../views/modals/customers/edit.blade.php | 90 +++++++++++++++++-- .../views/modals/vendors/create.blade.php | 90 +++++++++++++++++-- resources/views/modals/vendors/edit.blade.php | 90 +++++++++++++++++-- 9 files changed, 346 insertions(+), 47 deletions(-) diff --git a/app/Abstracts/View/Components/Documents/Form.php b/app/Abstracts/View/Components/Documents/Form.php index c6f7f76e7..2ffa97220 100644 --- a/app/Abstracts/View/Components/Documents/Form.php +++ b/app/Abstracts/View/Components/Documents/Form.php @@ -603,20 +603,18 @@ abstract class Form extends Component return $textCreateNewContact; } - /* $default_key = Str::plural(config('type.document.' . $type . '.contact_type'), 2); $translation = $this->getTextFromConfig($type, 'create_new_contact', $default_key, 'trans_choice'); if (!empty($translation)) { return [ - 'general.form.add_new', + 'general.title.new', $translation, ]; } - */ - return 'general.add_new'; + return 'general.title.add'; } protected function getTextEditContact($type, $textEditContact) diff --git a/app/View/Components/Documents/Form/Contact.php b/app/View/Components/Documents/Form/Contact.php index cffaeecbc..01ffbfb2b 100644 --- a/app/View/Components/Documents/Form/Contact.php +++ b/app/View/Components/Documents/Form/Contact.php @@ -132,8 +132,8 @@ class Contact extends Component protected function getTextCreateNewContact($type, $textCreateNewContact) { - if (!empty($textCreateNewContact)) { - return $textCreateNewContact; + if (!empty($textCreateNewContact) && is_array($textCreateNewContact)) { + return trans($textCreateNewContact[0], ['type' => trans_choice($textCreateNewContact[1], 1)]); } switch ($type) { diff --git a/app/View/Components/Form/Group/Country.php b/app/View/Components/Form/Group/Country.php index b54a86b17..14caf9a76 100644 --- a/app/View/Components/Form/Group/Country.php +++ b/app/View/Components/Form/Group/Country.php @@ -8,6 +8,18 @@ class Country extends Form { public $type = 'country'; + /** @var string */ + public $formGroupClass; + + /** + * Create a new component instance. + * + * @return void + */ + public function __construct(string $formGroupClass = 'sm:col-span-3') { + $this->formGroupClass = $formGroupClass; + } + /** * Get the view / contents that represent the component. * diff --git a/resources/assets/js/components/AkauntingContactCard.vue b/resources/assets/js/components/AkauntingContactCard.vue index 1e9d54a49..4b335816a 100644 --- a/resources/assets/js/components/AkauntingContactCard.vue +++ b/resources/assets/js/components/AkauntingContactCard.vue @@ -46,8 +46,9 @@ -
- {{ createNewContactText }} +
+ add + {{ createNewContactText }}
@@ -367,7 +368,7 @@ export default { this.add_new_html = Vue.component('add-new-component', function (resolve, reject) { resolve({ - template: '
', + template: '
', components: { [Select.name]: Select, @@ -426,7 +427,7 @@ export default { this.add_new_html = Vue.component('add-new-component', function (resolve, reject) { resolve({ - template: '
', + template: '
', components: { [Select.name]: Select, diff --git a/resources/views/components/documents/form/contact.blade.php b/resources/views/components/documents/form/contact.blade.php index d515a93de..3d643567e 100644 --- a/resources/views/components/documents/form/contact.blade.php +++ b/resources/views/components/documents/form/contact.blade.php @@ -14,7 +14,7 @@ choose-different-contact-text="{{ is_array($textChooseDifferentContact) ? trans($textChooseDifferentContact[0], ['field' => Str::lower(trans_choice($textChooseDifferentContact[1], 1))]) : trans($textChooseDifferentContact) }}" :add-new="{{ json_encode([ 'status' => true, - 'text' => trans('general.add_new'), + 'text' => is_array($textCreateNewContact) ? trans($textCreateNewContact[0], ['field' => trans_choice($textCreateNewContact[1], 1)]) : trans($textCreateNewContact), 'new_text' => trans('modules.new'), 'buttons' => [ 'cancel' => [ diff --git a/resources/views/modals/customers/create.blade.php b/resources/views/modals/customers/create.blade.php index cd8bddddf..635760be7 100644 --- a/resources/views/modals/customers/create.blade.php +++ b/resources/views/modals/customers/create.blade.php @@ -1,18 +1,90 @@ -
- +
+
+
+
    + - + - + +
+
+
- - +
+
+ + + + + + + + + +
+
+ +
+
+ + + + + + + + + +
+
+ +
+
+ + + + + + +
+
diff --git a/resources/views/modals/customers/edit.blade.php b/resources/views/modals/customers/edit.blade.php index 03c307b5d..2f5edb840 100644 --- a/resources/views/modals/customers/edit.blade.php +++ b/resources/views/modals/customers/edit.blade.php @@ -1,18 +1,90 @@ -
- +
+
+
+
    + - + - + +
+
+
- - +
+
+ + + + + + + + + +
+
+ +
+
+ + + + + + + + + +
+
+ +
+
+ + + + + + +
+
diff --git a/resources/views/modals/vendors/create.blade.php b/resources/views/modals/vendors/create.blade.php index 3815d8621..acf33f18a 100644 --- a/resources/views/modals/vendors/create.blade.php +++ b/resources/views/modals/vendors/create.blade.php @@ -1,18 +1,90 @@ -
- +
+
+
+
    + - + - + +
+
+
- - +
+
+ + + + + + + + + +
+
+ +
+
+ + + + + + + + + +
+
+ +
+
+ + + + + + +
+
diff --git a/resources/views/modals/vendors/edit.blade.php b/resources/views/modals/vendors/edit.blade.php index 1c3c8fc27..8e1fc92e6 100644 --- a/resources/views/modals/vendors/edit.blade.php +++ b/resources/views/modals/vendors/edit.blade.php @@ -1,18 +1,90 @@ -
- +
+
+
+
    + - + - + +
+
+
- - +
+
+ + + + + + + + + +
+
+ +
+
+ + + + + + + + + +
+
+ +
+
+ + + + + + +
+