From 622de49c645a9faa31e56944270fa8c08f9b350d Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Mon, 19 Mar 2018 21:18:04 +0200 Subject: [PATCH] Fixes for proposals --- app/Ninja/Mailers/ContactMailer.php | 1 + resources/lang/en/texts.php | 2 +- resources/views/proposals/grapesjs.blade.php | 12 ++++++------ 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/app/Ninja/Mailers/ContactMailer.php b/app/Ninja/Mailers/ContactMailer.php index 714943bb54..5e20d8f531 100644 --- a/app/Ninja/Mailers/ContactMailer.php +++ b/app/Ninja/Mailers/ContactMailer.php @@ -201,6 +201,7 @@ class ContactMailer extends Mailer 'notes' => $reminder, 'bccEmail' => $isFirst ? $account->getBccEmail() : false, 'fromEmail' => $account->getFromEmail(), + 'proposal' => $proposal, ]; if (! $proposal) { diff --git a/resources/lang/en/texts.php b/resources/lang/en/texts.php index 1aebde2081..e195912719 100644 --- a/resources/lang/en/texts.php +++ b/resources/lang/en/texts.php @@ -2656,7 +2656,7 @@ $LANG = array( 'tax_amount' => 'Tax Amount', 'tax_paid' => 'Tax Paid', 'none' => 'None', - + 'proposal_message_button' => 'To view your proposal for :amount, click the button below.', 'proposal' => 'Proposal', 'proposals' => 'Proposals', 'list_proposals' => 'List Proposals', diff --git a/resources/views/proposals/grapesjs.blade.php b/resources/views/proposals/grapesjs.blade.php index 6c6804e96f..907583c213 100644 --- a/resources/views/proposals/grapesjs.blade.php +++ b/resources/views/proposals/grapesjs.blade.php @@ -4,8 +4,8 @@ $(function() { window.grapesjsEditor = grapesjs.init({ container : '#gjs', - components: '{!! $entity ? $entity->html : '' !!}', - style: '{!! $entity ? $entity->css : '' !!}', + components: {!! json_encode($entity ? $entity->html : '') !!}, + style: {!! json_encode($entity ? $entity->css : '') !!}, showDevices: false, plugins: ['gjs-preset-newsletter'], pluginsOpts: { @@ -42,11 +42,11 @@ $(function() { blockManager.add("h{{ ($loop->index + 1) }}-block", { label: '{{ $snippet->name }}', category: '{{ $snippet->proposal_category ? $snippet->proposal_category->name : trans('texts.custom') }}', - content: '{!! $snippet->html !!}', - style: '{!! $snippet->css !!}', + content: {!! json_encode($snippet->html) !!}, + style: {!! json_encode($snippet->css) !!}, attributes: { - title: '{!! $snippet->private_notes !!}', - class:'fa fa-{!! $snippet->icon ?: 'font' !!}' + title: {!! json_encode($snippet->private_notes) !!}, + class:'fa fa-{{ $snippet->icon ?: 'font' }}' } }); @endforeach