Use json_encode for JS variables in views

This commit is contained in:
Hillel Coren 2018-03-27 12:52:37 +03:00
parent d1218f0b1c
commit ff05d41ca3
28 changed files with 85 additions and 85 deletions

View File

@ -39,7 +39,7 @@ class PaymentTermApiController extends BaseAPIController
* @SWG\Response( * @SWG\Response(
* response=200, * response=200,
* description="A list of payment terms", * description="A list of payment terms",
* @SWG\Schema(type="array", @SWG\Items(ref="#/definitions/PaymentTerms")) * @SWG\Schema(type="array", @SWG\Items(ref="#/definitions/PaymentTerm"))
* ), * ),
* @SWG\Response( * @SWG\Response(
* response="default", * response="default",
@ -73,7 +73,7 @@ class PaymentTermApiController extends BaseAPIController
* @SWG\Response( * @SWG\Response(
* response=200, * response=200,
* description="A single payment term", * description="A single payment term",
* @SWG\Schema(type="object", @SWG\Items(ref="#/definitions/PaymentTerms")) * @SWG\Schema(type="object", @SWG\Items(ref="#/definitions/PaymentTerm"))
* ), * ),
* @SWG\Response( * @SWG\Response(
* response="default", * response="default",

View File

@ -52,8 +52,8 @@
invoice_settings:{{ Auth::user()->hasFeature(FEATURE_INVOICE_SETTINGS) ? 'true' : 'false' }} invoice_settings:{{ Auth::user()->hasFeature(FEATURE_INVOICE_SETTINGS) ? 'true' : 'false' }}
}; };
invoice.account.hide_paid_to_date = {!! Auth::user()->account->hide_paid_to_date ? 'true' : 'false' !!}; invoice.account.hide_paid_to_date = {!! Auth::user()->account->hide_paid_to_date ? 'true' : 'false' !!};
NINJA.primaryColor = '{!! Auth::user()->account->primary_color !!}'; NINJA.primaryColor = {!! json_encode(Auth::user()->account->primary_color) !!};
NINJA.secondaryColor = '{!! Auth::user()->account->secondary_color !!}'; NINJA.secondaryColor = {!! json_encode(Auth::user()->account->secondary_color) !!};
NINJA.fontSize = {!! Auth::user()->account->font_size !!}; NINJA.fontSize = {!! Auth::user()->account->font_size !!};
NINJA.headerFont = {!! json_encode(Auth::user()->account->getHeaderFontName()) !!}; NINJA.headerFont = {!! json_encode(Auth::user()->account->getHeaderFontName()) !!};
NINJA.bodyFont = {!! json_encode(Auth::user()->account->getBodyFontName()) !!}; NINJA.bodyFont = {!! json_encode(Auth::user()->account->getBodyFontName()) !!};

View File

@ -498,7 +498,7 @@
function setQuoteNumberEnabled() { function setQuoteNumberEnabled() {
var disabled = $('#share_counter').prop('checked'); var disabled = $('#share_counter').prop('checked');
$('#quote_number_counter').prop('disabled', disabled); $('#quote_number_counter').prop('disabled', disabled);
$('#quote_number_counter').val(disabled ? '' : '{!! $account->quote_number_counter !!}'); $('#quote_number_counter').val(disabled ? '' : {!! json_encode($account->quote_number_counter) !!});
} }
function onNumberTypeChange(entityType) { function onNumberTypeChange(entityType) {

View File

@ -98,7 +98,7 @@
$('#reportrange').css('color', '#000'); $('#reportrange').css('color', '#000');
$('#reportrange').css('pointer-events', 'auto'); $('#reportrange').css('pointer-events', 'auto');
} }
var url = "{!! url('/clients/statement/' . $client->public_id) !!}/" + statusId + '/' + var url = '{{ url('/clients/statement/' . $client->public_id) }}' + '/' + statusId + '/' +
statementStartDate.format('YYYY-MM-DD') + '/' + statementEndDate.format('YYYY-MM-DD') + '?json=true'; statementStartDate.format('YYYY-MM-DD') + '/' + statementEndDate.format('YYYY-MM-DD') + '?json=true';
$.get(url, function(response) { $.get(url, function(response) {
invoice = currentInvoice = JSON.parse(response); invoice = currentInvoice = JSON.parse(response);

View File

@ -5,7 +5,7 @@
@include('money_script') @include('money_script')
<script src="{!! asset('js/Chart.min.js') !!}" type="text/javascript"></script> <script src="{{ asset('js/Chart.min.js') }}" type="text/javascript"></script>
<script src="{{ asset('js/daterangepicker.min.js') }}" type="text/javascript"></script> <script src="{{ asset('js/daterangepicker.min.js') }}" type="text/javascript"></script>
<link href="{{ asset('css/daterangepicker.css') }}" rel="stylesheet" type="text/css"/> <link href="{{ asset('css/daterangepicker.css') }}" rel="stylesheet" type="text/css"/>
@ -171,7 +171,7 @@
function loadData() { function loadData() {
var includeExpenses = "{{ $showExpenses ? 'true' : 'false' }}"; var includeExpenses = "{{ $showExpenses ? 'true' : 'false' }}";
var url = "{!! url('/dashboard_chart_data') !!}/" + chartGroupBy + '/' + chartStartDate.format('YYYY-MM-DD') + '/' + chartEndDate.format('YYYY-MM-DD') + '/' + chartCurrencyId + '/' + includeExpenses; var url = '{{ url('/dashboard_chart_data') }}/' + chartGroupBy + '/' + chartStartDate.format('YYYY-MM-DD') + '/' + chartEndDate.format('YYYY-MM-DD') + '/' + chartCurrencyId + '/' + includeExpenses;
$.get(url, function(response) { $.get(url, function(response) {
response = JSON.parse(response); response = JSON.parse(response);
loadChart(response.data); loadChart(response.data);

View File

@ -15,7 +15,7 @@
"broker": { "broker": {
"@type": "Organization", "@type": "Organization",
"name": "Invoice Ninja", "name": "Invoice Ninja",
"url": "{!! NINJA_WEB_URL !!}" "url": "{{ NINJA_WEB_URL }}"
}, },
"totalPaymentDue": { "totalPaymentDue": {
"@type": "PriceSpecification", "@type": "PriceSpecification",
@ -23,7 +23,7 @@
}, },
"action": { "action": {
"@type": "ViewAction", "@type": "ViewAction",
"url": "{!! $link !!}" "url": "{{ $link }}"
} }
}, },
@endif @endif
@ -32,9 +32,9 @@
"@type": "EmailMessage", "@type": "EmailMessage",
"action": { "action": {
"@type": "ViewAction", "@type": "ViewAction",
"url": "{!! $link !!}", "url": "{{ $link }}",
"name": "{{ trans("texts.view_{$entityType}") }}" "name": {!! json_encode(trans("texts.view_{$entityType}")) !!}
} }
} }
] ]
</script> </script>

View File

@ -5,9 +5,9 @@
"@type": "EmailMessage", "@type": "EmailMessage",
"action": { "action": {
"@type": "ViewAction", "@type": "ViewAction",
"url": "{!! $invoiceLink !!}", "url": "{{ $invoiceLink }}",
"name": "{{ trans("texts.view_{$entityType}") }}" "name": {!! json_encode(trans("texts.view_{$entityType}")) !!}
} }
} }
] ]
</script> </script>

View File

@ -272,7 +272,7 @@
function onFormSubmit(event) { function onFormSubmit(event) {
if (window.countUploadingDocuments > 0) { if (window.countUploadingDocuments > 0) {
swal("{!! trans('texts.wait_for_upload') !!}"); swal({!! json_encode(trans('texts.wait_for_upload')) !!});
return false; return false;
} }

View File

@ -365,7 +365,7 @@
</nav> </nav>
<div id="wrapper" class='{!! session(SESSION_LEFT_SIDEBAR) ? 'toggled-left' : '' !!} {!! session(SESSION_RIGHT_SIDEBAR, true) ? 'toggled-right' : '' !!}'> <div id="wrapper" class='{{ session(SESSION_LEFT_SIDEBAR) ? 'toggled-left' : '' }} {{ session(SESSION_RIGHT_SIDEBAR, true) ? 'toggled-right' : '' }}'>
<!-- Sidebar --> <!-- Sidebar -->
<div id="left-sidebar-wrapper" class="hide-phone"> <div id="left-sidebar-wrapper" class="hide-phone">

View File

@ -893,11 +893,11 @@
@if ($account->invoice_taxes) @if ($account->invoice_taxes)
@if (! empty($account->tax_name1)) @if (! empty($account->tax_name1))
model.invoice().tax_rate1("{{ $account->tax_rate1 }}"); model.invoice().tax_rate1("{{ $account->tax_rate1 }}");
model.invoice().tax_name1("{!! addslashes($account->tax_name1) !!}"); model.invoice().tax_name1({!! json_encode($account->tax_name1) !!});
@endif @endif
@if (! empty($account->tax_name2)) @if (! empty($account->tax_name2))
model.invoice().tax_rate2("{{ $account->tax_rate2 }}"); model.invoice().tax_rate2("{{ $account->tax_rate2 }}");
model.invoice().tax_name2("{!! addslashes($account->tax_name2) !!}"); model.invoice().tax_name2({!! json_encode($account->tax_name2) !!});
@endif @endif
@endif @endif
@ -1169,8 +1169,8 @@
invoice.contact = _.findWhere(invoice.client.contacts, {send_invoice: true}); invoice.contact = _.findWhere(invoice.client.contacts, {send_invoice: true});
if (invoice.is_recurring) { if (invoice.is_recurring) {
invoice.invoice_number = "{!! trans('texts.assigned_when_sent') !!}"; invoice.invoice_number = {!! json_encode(trans('texts.assigned_when_sent')) !!};
invoice.due_date = "{!! trans('texts.assigned_when_sent') !!}"; invoice.due_date = {!! json_encode(trans('texts.assigned_when_sent')) !!};
if (invoice.start_date) { if (invoice.start_date) {
invoice.invoice_date = invoice.start_date; invoice.invoice_date = invoice.start_date;
} else { } else {
@ -1265,7 +1265,7 @@
var design = getDesignJavascript(); var design = getDesignJavascript();
if (!design) return; if (!design) return;
var doc = generatePDF(invoice, design, true); var doc = generatePDF(invoice, design, true);
var type = invoice.is_quote ? '{!! trans('texts.'.ENTITY_QUOTE) !!}' : '{!! trans('texts.'.ENTITY_INVOICE) !!}'; var type = invoice.is_quote ? {!! json_encode(trans('texts.'.ENTITY_QUOTE)) !!} : {!! json_encode(trans('texts.'.ENTITY_INVOICE)) !!};
doc.save(type + '-' + $('#invoice_number').val() + '.pdf'); doc.save(type + '-' + $('#invoice_number').val() + '.pdf');
} }
@ -1292,23 +1292,23 @@
function onEmailClick() { function onEmailClick() {
if (!NINJA.isRegistered) { if (!NINJA.isRegistered) {
swal("{!! trans('texts.registration_required') !!}"); swal({!! json_encode(trans('texts.registration_required')) !!});
return; return;
} }
var clientId = parseInt($('input[name=client]').val(), 10) || 0; var clientId = parseInt($('input[name=client]').val(), 10) || 0;
if (clientId == 0 ) { if (clientId == 0 ) {
swal("{!! trans('texts.no_client_selected') !!}"); swal({!! json_encode(trans('texts.no_client_selected')) !!});
return; return;
} }
if (!isContactSelected()) { if (!isContactSelected()) {
swal("{!! trans('texts.no_contact_selected') !!}"); swal({!! json_encode(trans('texts.no_contact_selected')) !!});
return; return;
} }
if (!isEmailValid()) { if (!isEmailValid()) {
swal("{!! trans('texts.provide_email') !!}"); swal({!! json_encode(trans('texts.provide_email')) !!});
return; return;
} }
@ -1344,9 +1344,9 @@
} }
@if ($account->auto_email_invoice) @if ($account->auto_email_invoice)
var title = "{!! trans("texts.confirm_recurring_email_invoice") !!}"; var title = {!! json_encode(trans("texts.confirm_recurring_email_invoice")) !!};
@else @else
var title = "{!! trans("texts.confirm_recurring_email_invoice_not_sent") !!}"; var title = {!! json_encode(trans("texts.confirm_recurring_email_invoice_not_sent")) !!};
@endif @endif
var text = '\n' + getSendToEmails(); var text = '\n' + getSendToEmails();
@ -1355,13 +1355,13 @@
// warn invoice will be emailed when saving new recurring invoice // warn invoice will be emailed when saving new recurring invoice
if (model.invoice().start_date() == "{{ Utils::fromSqlDate(date('Y-m-d')) }}") { if (model.invoice().start_date() == "{{ Utils::fromSqlDate(date('Y-m-d')) }}") {
@if ($account->auto_email_invoice) @if ($account->auto_email_invoice)
text += '\n\n' + "{!! trans("texts.confirm_recurring_timing") !!}"; text += '\n\n' + {!! json_encode(trans("texts.confirm_recurring_timing")) !!};
@else @else
text += '\n\n' + "{!! trans("texts.confirm_recurring_timing_not_sent") !!}"; text += '\n\n' + {!! json_encode(trans("texts.confirm_recurring_timing_not_sent")) !!};
@endif @endif
// check if the start date is in the future // check if the start date is in the future
} else if (startDate.isAfter(moment(), 'day')) { } else if (startDate.isAfter(moment(), 'day')) {
var message = "{!! trans("texts.email_will_be_sent_on") !!}"; var message = {!! json_encode(trans("texts.email_will_be_sent_on")) !!};
text += '\n\n' + message.replace(':date', model.invoice().start_date()); text += '\n\n' + message.replace(':date', model.invoice().start_date());
} }
@ -1380,12 +1380,12 @@
@if ($invoice->id) @if ($invoice->id)
if (model.invoice().is_recurring()) { if (model.invoice().is_recurring()) {
if (model.invoice().start_date() != model.invoice().start_date_orig()) { if (model.invoice().start_date() != model.invoice().start_date_orig()) {
var text = "{!! trans("texts.original_start_date") !!}: " + model.invoice().start_date_orig() + '\n' var text = {!! json_encode(trans("texts.original_start_date")) !!} + ': ' + model.invoice().start_date_orig() + '\n'
+ "{!! trans("texts.new_start_date") !!}: " + model.invoice().start_date(); + {!! json_encode(trans("texts.new_start_date")) !!} + ': ' + model.invoice().start_date();
@if ($account->auto_email_invoice) @if ($account->auto_email_invoice)
var title = "{!! trans("texts.warn_start_date_changed") !!}"; var title = {!! json_encode(trans("texts.warn_start_date_changed")) !!};
@else @else
var title = "{!! trans("texts.warn_start_date_changed_not_sent") !!}"; var title = {!! json_encode(trans("texts.warn_start_date_changed_not_sent")) !!};
@endif @endif
sweetConfirm(function() { sweetConfirm(function() {
submitAction(''); submitAction('');
@ -1396,7 +1396,7 @@
@endif @endif
@if (!empty($autoBillChangeWarning)) @if (!empty($autoBillChangeWarning))
var text = "{!! trans('texts.warn_change_auto_bill') !!}"; var text = {!! json_encode(trans('texts.warn_change_auto_bill')) !!};
sweetConfirm(function() { sweetConfirm(function() {
submitAction(''); submitAction('');
}, text); }, text);
@ -1444,7 +1444,7 @@
function onFormSubmit(event) { function onFormSubmit(event) {
if (window.countUploadingDocuments > 0) { if (window.countUploadingDocuments > 0) {
swal("{!! trans('texts.wait_for_upload') !!}"); swal({!! json_encode(trans('texts.wait_for_upload')) !!});
return false; return false;
} }
@ -1470,7 +1470,7 @@
var expenseCurrencyId = model.expense_currency_id(); var expenseCurrencyId = model.expense_currency_id();
var clientCurrencyId = model.invoice().client().currency_id() || {{ $account->getCurrencyId() }}; var clientCurrencyId = model.invoice().client().currency_id() || {{ $account->getCurrencyId() }};
if (expenseCurrencyId && expenseCurrencyId != clientCurrencyId) { if (expenseCurrencyId && expenseCurrencyId != clientCurrencyId) {
swal("{!! trans('texts.expense_error_mismatch_currencies') !!}"); swal({!! json_encode(trans('texts.expense_error_mismatch_currencies')) !!});
return false; return false;
} }
@ -1503,7 +1503,7 @@
if (data) { if (data) {
var error = firstJSONError(data.responseJSON) || data.statusText; var error = firstJSONError(data.responseJSON) || data.statusText;
} }
swal("{!! trans('texts.invoice_save_error') !!}", error); swal({!! json_encode(trans('texts.invoice_save_error')) !!}, error);
} }
function submitBulkAction(value) { function submitBulkAction(value) {
@ -1572,7 +1572,7 @@
@if (!empty($autoBillChangeWarning)) @if (!empty($autoBillChangeWarning))
sweetConfirm(function() { sweetConfirm(function() {
window.location = '{{ URL::to('payments/create/' . $invoice->client->public_id . '/' . $invoice->public_id ) }}'; window.location = '{{ URL::to('payments/create/' . $invoice->client->public_id . '/' . $invoice->public_id ) }}';
}, "{!! trans('texts.warn_change_auto_bill') !!}"); }, {!! json_encode(trans('texts.warn_change_auto_bill')) !!});
@else @else
window.location = '{{ URL::to('payments/create/' . $invoice->client->public_id . '/' . $invoice->public_id ) }}'; window.location = '{{ URL::to('payments/create/' . $invoice->client->public_id . '/' . $invoice->public_id ) }}';
@endif @endif

View File

@ -168,7 +168,7 @@
@if (count($paymentTypes) > 1) @if (count($paymentTypes) > 1)
{!! DropdownButton::success(trans('texts.pay_now'))->withContents($paymentTypes)->large() !!} {!! DropdownButton::success(trans('texts.pay_now'))->withContents($paymentTypes)->large() !!}
@elseif (count($paymentTypes) == 1) @elseif (count($paymentTypes) == 1)
<a href='{!! $paymentURL !!}' class="btn btn-success btn-lg">{{ trans('texts.pay_now') }} {!! $invoice->present()->gatewayFee($gatewayTypeId) !!}</a> <a href='{{ $paymentURL }}' class="btn btn-success btn-lg">{{ trans('texts.pay_now') }} {!! $invoice->present()->gatewayFee($gatewayTypeId) !!}</a>
@endif @endif
@else @else
{!! Button::normal(trans('texts.download'))->withAttributes(['onclick' => 'onDownloadClick()'])->large() !!} {!! Button::normal(trans('texts.download'))->withAttributes(['onclick' => 'onDownloadClick()'])->large() !!}

View File

@ -2,7 +2,7 @@
@section('head') @section('head')
@if (!empty($clientauth) && $fontsUrl = Utils::getAccountFontsUrl()) @if (!empty($clientauth) && $fontsUrl = Utils::getAccountFontsUrl())
<link href="{!! $fontsUrl !!}" rel="stylesheet" type="text/css"> <link href="{{ $fontsUrl }}" rel="stylesheet" type="text/css">
@endif @endif
<link href="{{ asset('css/built.public.css') }}?no_cache={{ NINJA_VERSION }}" rel="stylesheet" type="text/css"/> <link href="{{ asset('css/built.public.css') }}?no_cache={{ NINJA_VERSION }}" rel="stylesheet" type="text/css"/>
<link href="{{ asset('css/bootstrap.min.css') }}?no_cache={{ NINJA_VERSION }}" rel="stylesheet" type="text/css"/> <link href="{{ asset('css/bootstrap.min.css') }}?no_cache={{ NINJA_VERSION }}" rel="stylesheet" type="text/css"/>

View File

@ -111,14 +111,14 @@
// http://t4t5.github.io/sweetalert/ // http://t4t5.github.io/sweetalert/
function sweetConfirm(successCallback, text, title, cancelCallback) { function sweetConfirm(successCallback, text, title, cancelCallback) {
title = title || "{!! trans("texts.are_you_sure") !!}"; title = title || {!! json_encode(trans("texts.are_you_sure")) !!};
swal({ swal({
//type: "warning", //type: "warning",
//confirmButtonColor: "#DD6B55", //confirmButtonColor: "#DD6B55",
title: title, title: title,
text: text, text: text,
cancelButtonText: "{!! trans("texts.no") !!}", cancelButtonText: {!! json_encode(trans("texts.no")) !!},
confirmButtonText: "{!! trans("texts.yes") !!}", confirmButtonText: {!! json_encode(trans("texts.yes")) !!},
showCancelButton: true, showCancelButton: true,
closeOnConfirm: false, closeOnConfirm: false,
allowOutsideClick: true, allowOutsideClick: true,

View File

@ -8,14 +8,14 @@
<script type="text/javascript"> <script type="text/javascript">
function submitForm_{{ $entityType }}(action, id) { function submitForm_{{ $entityType }}(action, id) {
if (action == 'delete') { if (action == 'delete') {
if (!confirm('{!! trans("texts.are_you_sure") !!}')) { if (!confirm({!! json_encode(trans("texts.are_you_sure")) !!})) {
return; return;
} }
} }
@if (in_array($entityType, [ENTITY_ACCOUNT_GATEWAY])) @if (in_array($entityType, [ENTITY_ACCOUNT_GATEWAY]))
if (action == 'archive') { if (action == 'archive') {
if (!confirm('{!! trans("texts.are_you_sure") !!}')) { if (!confirm({!! json_encode(trans("texts.are_you_sure")) !!})) {
return; return;
} }
} }

View File

@ -11,7 +11,7 @@ window.dropzone = new Dropzone('#document-upload .dropzone', {
addRemoveLinks: true, addRemoveLinks: true,
dictRemoveFileConfirmation: "{{trans('texts.are_you_sure')}}", dictRemoveFileConfirmation: "{{trans('texts.are_you_sure')}}",
@foreach(['default_message', 'fallback_message', 'fallback_text', 'file_too_big', 'invalid_file_type', 'response_error', 'cancel_upload', 'cancel_upload_confirmation', 'remove_file'] as $key) @foreach(['default_message', 'fallback_message', 'fallback_text', 'file_too_big', 'invalid_file_type', 'response_error', 'cancel_upload', 'cancel_upload_confirmation', 'remove_file'] as $key)
"dict{{ Utils::toClassCase($key) }}" : "{!! strip_tags(addslashes(trans('texts.dropzone_'.$key))) !!}", "dict{{ Utils::toClassCase($key) }}" : {!! json_encode(trans('texts.dropzone_'.$key)) !!},
@endforeach @endforeach
maxFilesize: {{ floatval(MAX_DOCUMENT_SIZE/1000) }}, maxFilesize: {{ floatval(MAX_DOCUMENT_SIZE/1000) }},
parallelUploads: 1, parallelUploads: 1,
@ -99,5 +99,5 @@ function handleDocumentCanceled() {
function handleDocumentError(file) { function handleDocumentError(file) {
dropzone.removeFile(file); dropzone.removeFile(file);
window.countUploadingDocuments--; window.countUploadingDocuments--;
swal("{!! trans('texts.error_refresh_page') !!}"); swal({!! json_encode(trans('texts.error_refresh_page')) !!});
} }

View File

@ -6,17 +6,17 @@
} }
if (invoice && invoice.invoice_type_id == {{ INVOICE_TYPE_QUOTE }} || entityType == '{{ ENTITY_QUOTE }}') { if (invoice && invoice.invoice_type_id == {{ INVOICE_TYPE_QUOTE }} || entityType == '{{ ENTITY_QUOTE }}') {
var viewButton = '{!! Form::flatButton('view_quote', '#0b4d78') !!}$password'; var viewButton = {!! json_encode(Form::flatButton('view_quote', '#0b4d78')) !!} + '$password';
} else if (entityType == '{{ ENTITY_PROPOSAL }}') { } else if (entityType == '{{ ENTITY_PROPOSAL }}') {
var viewButton = '{!! Form::flatButton('view_proposal', '#0b4d78') !!}$password'; var viewButton = {!! json_encode(Form::flatButton('view_proposal', '#0b4d78')) !!} + '$password';
} else { } else {
var viewButton = '{!! Form::flatButton('view_invoice', '#0b4d78') !!}$password'; var viewButton = {!! json_encode(Form::flatButton('view_invoice', '#0b4d78')) !!} + '$password';
} }
var passwordHtml = "{!! $account->isPro() && $account->enable_portal_password && $account->send_portal_password?'<br/>'.trans('texts.password').': XXXXXXXXX<br/>':'' !!}"; var passwordHtml = {!! $account->isPro() && $account->enable_portal_password && $account->send_portal_password ? json_encode('<br/>' . trans('texts.password') . ': XXXXXXXXX<br/>') : json_encode('') !!};
@if ($account->isPro()) @if ($account->isPro())
var documentsHtml = "{!! trans('texts.email_documents_header').'<ul><li><a>'.trans('texts.email_documents_example_1').'</a></li><li><a>'.trans('texts.email_documents_example_2').'</a></li></ul>' !!}"; var documentsHtml = {!! json_encode(trans('texts.email_documents_header') . '<ul><li><a>' . trans('texts.email_documents_example_1') . '</a></li><li><a>' . trans('texts.email_documents_example_2') . '</a></li></ul>') !!};
@else @else
var documentsHtml = ""; var documentsHtml = "";
@endif @endif
@ -44,10 +44,10 @@
'viewLink': '{{ link_to('#', auth()->user()->account->getBaseUrl() . '/...') }}$password', 'viewLink': '{{ link_to('#', auth()->user()->account->getBaseUrl() . '/...') }}$password',
'viewButton': viewButton, 'viewButton': viewButton,
'paymentLink': '{{ link_to('#', auth()->user()->account->getBaseUrl() . '/...') }}$password', 'paymentLink': '{{ link_to('#', auth()->user()->account->getBaseUrl() . '/...') }}$password',
'paymentButton': '{!! Form::flatButton('pay_now', '#36c157') !!}$password', 'paymentButton': {!! json_encode(Form::flatButton('pay_now', '#36c157')) !!} + '$password',
'autoBill': '{{ trans('texts.auto_bill_notification_placeholder') }}', 'autoBill': '{{ trans('texts.auto_bill_notification_placeholder') }}',
'portalLink': "{{ auth()->user()->account->getBaseUrl() . '/...' }}", 'portalLink': "{{ auth()->user()->account->getBaseUrl() . '/...' }}",
'portalButton': '{!! Form::flatButton('view_portal', '#36c157') !!}', 'portalButton': {!! json_encode(Form::flatButton('view_portal', '#36c157')) !!},
'customClient1': invoice ? invoice.client.custom_value1 : 'custom value', 'customClient1': invoice ? invoice.client.custom_value1 : 'custom value',
'customClient2': invoice ? invoice.client.custom_value2 : 'custom value', 'customClient2': invoice ? invoice.client.custom_value2 : 'custom value',
'customContact1': invoice ? invoice.client.contacts[0].custom_value1 : 'custom value', 'customContact1': invoice ? invoice.client.contacts[0].custom_value1 : 'custom value',

View File

@ -234,7 +234,7 @@
'g u m' => 'user_management', 'g u m' => 'user_management',
] as $key => $val) ] as $key => $val)
Mousetrap.bind('{{ $key }}', function(e) { Mousetrap.bind('{{ $key }}', function(e) {
location.href = "{!! url('/settings/' . $val) !!}"; location.href = "{{ url('/settings/' . $val) }}";
}); });
@endforeach @endforeach

View File

@ -66,7 +66,7 @@
function showUpgradeModal() { function showUpgradeModal() {
@if ( ! Auth::check() || ! Auth::user()->registered) @if ( ! Auth::check() || ! Auth::user()->registered)
swal("{!! trans('texts.please_register') !!}"); swal({!! json_encode(trans('texts.please_register')) !!});
return; return;
@elseif ( ! Auth::check() || ! Auth::user()->confirmed) @elseif ( ! Auth::check() || ! Auth::user()->confirmed)
swal({!! json_encode(trans('texts.confirmation_required', ['link' => link_to('/resend_confirmation', trans('texts.click_here'))])) !!}); swal({!! json_encode(trans('texts.confirmation_required', ['link' => link_to('/resend_confirmation', trans('texts.click_here'))])) !!});

View File

@ -5,7 +5,7 @@
<script src="{{ asset('js/select2.min.js') }}" type="text/javascript"></script> <script src="{{ asset('js/select2.min.js') }}" type="text/javascript"></script>
<link href="{{ asset('css/select2.css') }}" rel="stylesheet" type="text/css"/> <link href="{{ asset('css/select2.css') }}" rel="stylesheet" type="text/css"/>
<script src="{!! asset('js/Chart.min.js') !!}" type="text/javascript"></script> <script src="{{ asset('js/Chart.min.js') }}" type="text/javascript"></script>
@stop @stop
@ -151,7 +151,7 @@
} }
function onDeleteClick() { function onDeleteClick() {
if (confirm("{!! trans('texts.are_you_sure') !!}")) { if (confirm({!! json_encode(trans('texts.are_you_sure')) !!})) {
$('#action').val('delete'); $('#action').val('delete');
$('.mainForm').submit(); $('.mainForm').submit();
} }

View File

@ -2,7 +2,7 @@
@section('head') @section('head')
@if (!empty($clientFontUrl)) @if (!empty($clientFontUrl))
<link href="{!! $clientFontUrl !!}" rel="stylesheet" type="text/css"> <link href="{{ $clientFontUrl }}" rel="stylesheet" type="text/css">
@endif @endif
<link href="{{ asset('css/built.public.css') }}?no_cache={{ NINJA_VERSION }}" rel="stylesheet" type="text/css"/> <link href="{{ asset('css/built.public.css') }}?no_cache={{ NINJA_VERSION }}" rel="stylesheet" type="text/css"/>
<style type="text/css">{!! !empty($account)?$account->clientViewCSS():'' !!}</style> <style type="text/css">{!! !empty($account)?$account->clientViewCSS():'' !!}</style>

View File

@ -51,14 +51,14 @@ h3 .help {
} }
header h3 { header h3 {
text-transform: uppercase; text-transform: uppercase;
} }
header h3 span { header h3 span {
display: inline-block; display: inline-block;
margin-left: 8px; margin-left: 8px;
} }
header h3 em { header h3 em {
font-style: normal; font-style: normal;
color: #eb8039; color: #eb8039;
@ -79,9 +79,9 @@ header h3 em {
<header> <header>
@if (isset($redirectTo)) @if (isset($redirectTo))
<h2>Payment Complete</h2> <h2>Payment Complete</h2>
@else @else
<h2>License Key<br/><small>{{ $message }}</small></h2> <h2>License Key<br/><small>{{ $message }}</small></h2>
@endif @endif
</header> </header>
</div> </div>
</div> </div>
@ -97,9 +97,9 @@ header h3 em {
@else @else
{{ $license }} {{ $license }}
@endif @endif
</h2> </h2>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
@ -117,7 +117,7 @@ $(function() {
@if (isset($redirectTo)) @if (isset($redirectTo))
setTimeout(function() { setTimeout(function() {
location.href = "{!! $redirectTo !!}"; location.href = {!! json_encode($redirectTo) !!};
}, 3000); }, 3000);
@endif @endif
@ -125,4 +125,4 @@ $(function() {
</script> </script>
@stop @stop

View File

@ -4,7 +4,7 @@
@parent @parent
@include('money_script') @include('money_script')
<script src="{!! asset('js/d3.min.js') !!}" type="text/javascript"></script> <script src="{{ asset('js/d3.min.js') }}" type="text/javascript"></script>
<style type="text/css"> <style type="text/css">

View File

@ -3,7 +3,7 @@
@section('head') @section('head')
@parent @parent
<script src="{!! asset('js/Chart.min.js') !!}" type="text/javascript"></script> <script src="{{ asset('js/Chart.min.js') }}" type="text/javascript"></script>
<script src="{{ asset('js/daterangepicker.min.js') }}?no_cache={{ NINJA_VERSION }}" type="text/javascript"></script> <script src="{{ asset('js/daterangepicker.min.js') }}?no_cache={{ NINJA_VERSION }}" type="text/javascript"></script>
<link href="{{ asset('css/daterangepicker.css') }}?no_cache={{ NINJA_VERSION }}" rel="stylesheet" type="text/css"/> <link href="{{ asset('css/daterangepicker.css') }}?no_cache={{ NINJA_VERSION }}" rel="stylesheet" type="text/css"/>
@stop @stop
@ -157,7 +157,7 @@
}); });
function loadData() { function loadData() {
var url = "{!! url('/reports/emails_report') !!}/" + chartStartDate.format('YYYY-MM-DD') + '/' + chartEndDate.format('YYYY-MM-DD'); var url = '{{ url('/reports/emails_report') }}/' + chartStartDate.format('YYYY-MM-DD') + '/' + chartEndDate.format('YYYY-MM-DD');
$.get(url, function(response) { $.get(url, function(response) {
loadChart(response.data); loadChart(response.data);
$('#totalSentDiv').html(response.totals['sent']); $('#totalSentDiv').html(response.totals['sent']);

View File

@ -5,7 +5,7 @@
@include('money_script') @include('money_script')
<script src="{!! asset('js/Chart.min.js') !!}" type="text/javascript"></script> <script src="{{ asset('js/Chart.min.js') }}" type="text/javascript"></script>
<script src="{{ asset('js/daterangepicker.min.js') }}?no_cache={{ NINJA_VERSION }}" type="text/javascript"></script> <script src="{{ asset('js/daterangepicker.min.js') }}?no_cache={{ NINJA_VERSION }}" type="text/javascript"></script>
<link href="{{ asset('css/daterangepicker.css') }}?no_cache={{ NINJA_VERSION }}" rel="stylesheet" type="text/css"/> <link href="{{ asset('css/daterangepicker.css') }}?no_cache={{ NINJA_VERSION }}" rel="stylesheet" type="text/css"/>

View File

@ -298,7 +298,7 @@
} }
function onDeleteClick() { function onDeleteClick() {
if (confirm('{!! trans("texts.are_you_sure") !!}')) { if (confirm({!! json_encode(trans("texts.are_you_sure")) !!})) {
submitAction('delete'); submitAction('delete');
} }
} }

View File

@ -1,13 +1,13 @@
<table id="{!! $id !!}" class="{!! $class !!}"> <table id="{{ $id }}" class="{{ $class }}">
<colgroup> <colgroup>
@for ($i = 0; $i < count($columns); $i++) @for ($i = 0; $i < count($columns); $i++)
<col class="con{!! $i !!}" /> <col class="con{{ $i }}" />
@endfor @endfor
</colgroup> </colgroup>
<thead> <thead>
<tr> <tr>
@foreach($columns as $i => $c) @foreach($columns as $i => $c)
<th align="center" valign="middle" class="head{!! $i !!}">{!! $c !!}</th> <th align="center" valign="middle" class="head{{ $i }}">{{ $c }}</th>
@endforeach @endforeach
</tr> </tr>
</thead> </thead>
@ -15,7 +15,7 @@
@foreach($data as $d) @foreach($data as $d)
<tr> <tr>
@foreach($d as $dd) @foreach($d as $dd)
<td>{!! $dd !!}</td> <td>{{ $dd }}</td>
@endforeach @endforeach
</tr> </tr>
@endforeach @endforeach

View File

@ -48,7 +48,7 @@ header("Access-Control-Allow-Headers: X-Requested-With");
if (url && url.length > 1) { if (url && url.length > 1) {
url = decodeURIComponent(url[1]); url = decodeURIComponent(url[1]);
} else { } else {
url = "{!! $urlToDocs !!}"; url = '{{ $urlToDocs }}';
} }
// Pre load translate... // Pre load translate...
@ -64,7 +64,7 @@ header("Access-Control-Allow-Headers: X-Requested-With");
log("Loaded SwaggerUI"); log("Loaded SwaggerUI");
@if (isset($requestHeaders)) @if (isset($requestHeaders))
@foreach($requestHeaders as $requestKey => $requestValue) @foreach($requestHeaders as $requestKey => $requestValue)
window.authorizations.add("{!!$requestKey!!}", new ApiKeyAuthorization("{!!$requestKey!!}", "{!!$requestValue!!}", "header")); window.authorizations.add({!! json_encode($requestKey) !!}, new ApiKeyAuthorization({!! json_encode($requestKey) !!}, {!! json_encode($requestValue) !!}, "header"));
@endforeach @endforeach
@endif @endif

View File

@ -212,7 +212,7 @@
} }
function onDeleteClick() { function onDeleteClick() {
if (confirm("{!! trans('texts.are_you_sure') !!}")) { if (confirm({!! json_encode(trans('texts.are_you_sure')) !!})) {
$('#action').val('delete'); $('#action').val('delete');
$('.mainForm').submit(); $('.mainForm').submit();
} }