diff --git a/app/Utils/HtmlEngine.php b/app/Utils/HtmlEngine.php index 11dcbce10247..9c1de26c88cb 100644 --- a/app/Utils/HtmlEngine.php +++ b/app/Utils/HtmlEngine.php @@ -125,9 +125,11 @@ class HtmlEngine $data['$terms'] = &$data['$entity.terms']; $data['$view_link'] = ['value' => ''.ctrans('texts.view_invoice').'', 'label' => ctrans('texts.view_invoice')]; $data['$view_url'] = ['value' => $this->invitation->getLink(), 'label' => ctrans('texts.view_invoice')]; + $data['$date'] = ['value' => $this->translateDate($this->entity->date, $this->entity->client->date_format(), $this->entity->client->locale()) ?: ' ', 'label' => ctrans('texts.invoice_date')]; - if($this->entity->project()->exists()) + if($this->entity->project()->exists()) { $data['$project.name'] = ['value' => $this->entity->project->name, 'label' => ctrans('texts.project_name')]; + } } if ($this->entity_string == 'quote') { @@ -137,6 +139,7 @@ class HtmlEngine $data['$terms'] = &$data['$entity.terms']; $data['$view_link'] = ['value' => ''.ctrans('texts.view_quote').'', 'label' => ctrans('texts.view_quote')]; $data['$view_url'] = ['value' => $this->invitation->getLink(), 'label' => ctrans('texts.view_quote')]; + $data['$date'] = ['value' => $this->translateDate($this->entity->date, $this->entity->client->date_format(), $this->entity->client->locale()) ?: ' ', 'label' => ctrans('texts.quote_date')]; } if ($this->entity_string == 'credit') { @@ -147,6 +150,7 @@ class HtmlEngine $data['$view_link'] = ['value' => ''.ctrans('texts.view_credit').'', 'label' => ctrans('texts.view_credit')]; $data['$view_url'] = ['value' => $this->invitation->getLink(), 'label' => ctrans('texts.view_credit')]; // $data['$view_link'] = ['value' => $this->invitation->getLink(), 'label' => ctrans('texts.view_credit')]; + $data['$date'] = ['value' => $this->translateDate($this->entity->date, $this->entity->client->date_format(), $this->entity->client->locale()) ?: ' ', 'label' => ctrans('texts.credit_date')]; } $data['$entity_number'] = &$data['$number']; @@ -346,7 +350,7 @@ class HtmlEngine $data['$font_size'] = ['value' => $this->settings->font_size . 'px', 'label' => '']; - $data['$invoiceninja.whitelabel'] = ['value' => 'https://raw.githubusercontent.com/invoiceninja/invoiceninja/v5-develop/public/images/created-by-invoiceninja-new.png', 'label' => '']; + $data['$invoiceninja.whitelabel'] = ['value' => 'https://raw.githubusercontent.com/invoiceninja/invoiceninja/v5-develop/public/images/new_logo.png', 'label' => '']; $data['$primary_color'] = ['value' => $this->settings->primary_color, 'label' => '']; $data['$secondary_color'] = ['value' => $this->settings->secondary_color, 'label' => '']; diff --git a/database/migrations/2021_02_16_115919_update_designs.php b/database/migrations/2021_03_02_115919_update_designs.php similarity index 100% rename from database/migrations/2021_02_16_115919_update_designs.php rename to database/migrations/2021_03_02_115919_update_designs.php diff --git a/package-lock.json b/package-lock.json index 7b77f7e2e1de..e5cc670bfe63 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2857,6 +2857,24 @@ "sha.js": "^2.4.8" } }, + "create-html-element": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/create-html-element/-/create-html-element-2.1.0.tgz", + "integrity": "sha512-ofbOpJh3GSDsyINuqppupKRUcQHnXSyvwvk0F5DlEtwKwb+thdFoJAtYczy7bIZWdsQjZfADUc38pF4gVd0o+Q==", + "requires": { + "escape-goat": "^1.3.0", + "html-tags": "^2.0.0", + "stringify-attributes": "^1.0.0", + "type-fest": "^0.3.0" + }, + "dependencies": { + "html-tags": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/html-tags/-/html-tags-2.0.0.tgz", + "integrity": "sha1-ELMKOGCF9Dzt41PMj6fLDe7qZos=" + } + } + }, "credit-card-type": { "version": "8.3.0", "resolved": "https://registry.npmjs.org/credit-card-type/-/credit-card-type-8.3.0.tgz", @@ -3730,6 +3748,11 @@ "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==" }, + "escape-goat": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/escape-goat/-/escape-goat-1.3.0.tgz", + "integrity": "sha512-E2nU1Y39N5UgfLU8qwMlK0vZrZprIwWLeVmDYN8wd/e37hMtGzu2w1DBiREts0XHfgyZEQlj/hYr0H0izF0HDQ==" + }, "escape-html": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", @@ -5721,6 +5744,14 @@ "integrity": "sha1-eZllXoZGwX8In90YfRUNMyTVRRM=", "dev": true }, + "linkify-urls": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/linkify-urls/-/linkify-urls-3.1.1.tgz", + "integrity": "sha512-sRxMSunCnLFtZ4iVkMqHhZKSJ3MC/nRAvej8Ou3pEEEPBL0iVN91mZvdFREKcGv3VNcakbT4qsfOnnWMEbA59w==", + "requires": { + "create-html-element": "^2.1.0" + } + }, "listr": { "version": "0.14.3", "resolved": "https://registry.npmjs.org/listr/-/listr-0.14.3.tgz", @@ -8882,6 +8913,14 @@ "safe-buffer": "~5.1.0" } }, + "stringify-attributes": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/stringify-attributes/-/stringify-attributes-1.0.0.tgz", + "integrity": "sha1-nosvmpRn57SAk8shJOvBwX5jgsU=", + "requires": { + "escape-goat": "^1.1.0" + } + }, "strip-ansi": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", @@ -9283,6 +9322,11 @@ "resolved": "https://registry.npmjs.org/type/-/type-1.2.0.tgz", "integrity": "sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg==" }, + "type-fest": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.3.1.tgz", + "integrity": "sha512-cUGJnCdr4STbePCgqNFbpVNCepa+kAVohJs1sLhxzdH+gnEoOd8VhbYa7pD3zZYGiURWM2xzEII3fQcRizDkYQ==" + }, "type-is": { "version": "1.6.18", "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", diff --git a/package.json b/package.json index ebe239820e64..f3c1e6a0189d 100644 --- a/package.json +++ b/package.json @@ -26,6 +26,7 @@ "cross-env": "^7.0.3", "jsignature": "^2.1.3", "laravel-mix": "^5.0.9", + "linkify-urls": "^3.1.1", "lodash": "^4.17.20", "resolve-url-loader": "^3.1.2", "sass": "^1.32.7", diff --git a/public/images/new_logo.png b/public/images/new_logo.png new file mode 100644 index 000000000000..db89c45ddace Binary files /dev/null and b/public/images/new_logo.png differ diff --git a/public/js/clients/linkify-urls.js b/public/js/clients/linkify-urls.js new file mode 100644 index 000000000000..19fb4fffc657 --- /dev/null +++ b/public/js/clients/linkify-urls.js @@ -0,0 +1,2 @@ +/*! For license information please see linkify-urls.js.LICENSE.txt */ +!function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="/",r(r.s=16)}({16:function(e,t,r){e.exports=r("cN42")},Ievl:function(e,t,r){"use strict";t.escape=e=>e.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(//g,">"),t.unescape=e=>e.replace(/>/g,">").replace(/</g,"<").replace(/'/g,"'").replace(/"/g,'"').replace(/&/g,"&"),t.escapeTag=function(e){let r=e[0];for(let n=1;n{if((e=Object.assign({name:"div",attributes:{},html:""},e)).html&&e.text)throw new Error("The `html` and `text` options are mutually exclusive");const t=e.text?a.escape(e.text):e.html;let r=`<${e.name}${n(e.attributes)}>`;return u.has(e.name)||(r+=`${t}`),r}},cN42:function(e,t,r){var n=r("jG5F");document.querySelectorAll("[data-ref=entity-terms]").forEach((function(e){e.innerHTML=n(e.innerText,{attributes:{target:"_blank",class:"text-primary"}})}))},dBjz:function(e,t,r){"use strict";const n=r("Ievl");e.exports=e=>{const t=[];for(const r of Object.keys(e)){let o=e[r];if(!1===o)continue;Array.isArray(o)&&(o=o.join(" "));let a=n.escape(r);!0!==o&&(a+=`="${n.escape(String(o))}"`),t.push(a)}return t.length>0?" "+t.join(" "):""}},jG5F:function(e,t,r){"use strict";const n=r("YIIW"),o=(e,t)=>n({name:"a",attributes:{href:"",...t.attributes,href:e},text:void 0===t.value?e:void 0,html:void 0===t.value?void 0:"function"==typeof t.value?t.value(e):t.value});e.exports=(e,t)=>{if("string"===(t={attributes:{},type:"string",...t}).type)return((e,t)=>e.replace(/((?o(e,t)))(e,t);if("dom"===t.type)return((e,t)=>{const r=document.createDocumentFragment();for(const[a,u]of Object.entries(e.split(/((?0&&r.append(u);var n;return r})(e,t);throw new Error("The type option must be either `dom` or `string`")}},sW1H:function(e){e.exports=JSON.parse('["area","base","br","col","embed","hr","img","input","link","menuitem","meta","param","source","track","wbr"]')}}); \ No newline at end of file diff --git a/public/js/clients/linkify-urls.js.LICENSE.txt b/public/js/clients/linkify-urls.js.LICENSE.txt new file mode 100644 index 000000000000..585c6ab0e4fc --- /dev/null +++ b/public/js/clients/linkify-urls.js.LICENSE.txt @@ -0,0 +1,9 @@ +/** + * Invoice Ninja (https://invoiceninja.com) + * + * @link https://github.com/invoiceninja/invoiceninja source repository + * + * @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com) + * + * @license https://opensource.org/licenses/AAL + */ diff --git a/public/mix-manifest.json b/public/mix-manifest.json index fa6f474e15b1..75d737b930db 100755 --- a/public/mix-manifest.json +++ b/public/mix-manifest.json @@ -3,6 +3,7 @@ "/css/app.css": "/css/app.css?id=58736e43b16ddde82ba9", "/js/clients/invoices/action-selectors.js": "/js/clients/invoices/action-selectors.js?id=a09bb529b8e1826f13b4", "/js/clients/invoices/payment.js": "/js/clients/invoices/payment.js?id=8ce8955ba775ea5f47d1", + "/js/clients/linkify-urls.js": "/js/clients/linkify-urls.js?id=0dc8c34010d09195d2f7", "/js/clients/payment_methods/authorize-authorize-card.js": "/js/clients/payment_methods/authorize-authorize-card.js?id=206d7de4ac97612980ff", "/js/clients/payments/authorize-credit-card-payment.js": "/js/clients/payments/authorize-credit-card-payment.js?id=a376eff2227da398b0ba", "/js/clients/payments/card-js.min.js": "/js/clients/payments/card-js.min.js?id=5469146cd629ea1b5c20", diff --git a/resources/js/clients/linkify-urls.js b/resources/js/clients/linkify-urls.js new file mode 100644 index 000000000000..b6362e1f715b --- /dev/null +++ b/resources/js/clients/linkify-urls.js @@ -0,0 +1,19 @@ +/** + * Invoice Ninja (https://invoiceninja.com) + * + * @link https://github.com/invoiceninja/invoiceninja source repository + * + * @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com) + * + * @license https://opensource.org/licenses/AAL + */ + +const linkifyUrls = require('linkify-urls'); + +document + .querySelectorAll('[data-ref=entity-terms]') + .forEach((text) => { + text.innerHTML = linkifyUrls(text.innerText, { + attributes: {target: '_blank', class: 'text-primary'} + }); + }); diff --git a/resources/lang/en/texts.php b/resources/lang/en/texts.php index 7699ff50fa1c..d669a3749807 100644 --- a/resources/lang/en/texts.php +++ b/resources/lang/en/texts.php @@ -4143,6 +4143,11 @@ $LANG = array( 'hello' => 'Hello', 'group_documents' => 'Group documents', 'quote_approval_confirmation_label' => 'Are you sure you want to approve this quote?', + + 'click_agree_to_accept_terms' => 'Click "Agree" to Accept Terms.', + 'agree' => 'Agree', + + 'pending_approval' => 'Pending Approval', ); return $LANG; diff --git a/resources/views/pdf-designs/business.html b/resources/views/pdf-designs/business.html index b1951dfec592..d8407354df23 100644 --- a/resources/views/pdf-designs/business.html +++ b/resources/views/pdf-designs/business.html @@ -41,10 +41,6 @@ color: #AAA9A9; } - #company-details > * { - margin-bottom: 0.8rem; - } - #company-address { display: flex; flex-direction: column; @@ -72,10 +68,6 @@ margin-top: 1rem; } - #client-details > * { - margin-bottom: 0.5rem; - } - #client-details > p:nth-child(1) { color: var(--primary-color); } diff --git a/resources/views/pdf-designs/hipster.html b/resources/views/pdf-designs/hipster.html index 1fe04a9b37ac..0c61a239bc49 100644 --- a/resources/views/pdf-designs/hipster.html +++ b/resources/views/pdf-designs/hipster.html @@ -65,8 +65,13 @@ margin-top: 0.8rem; } + .header-right-side-wrapper-right { + display: flex; + } + .header-wrapper .company-logo { height: 5rem; + margin-left: auto; } .entity-label { @@ -199,16 +204,18 @@
-
+

$to_label:

- +
+ +
diff --git a/resources/views/pdf-designs/modern.html b/resources/views/pdf-designs/modern.html index 1e455903de7a..d4aace1f9f36 100644 --- a/resources/views/pdf-designs/modern.html +++ b/resources/views/pdf-designs/modern.html @@ -97,6 +97,12 @@ width: 100%; } + #product-table th + th, + #delivery-note-table th + th, + #task-table th + th { + border-left: 2px solid white; + } + #product-table > thead > tr > th, #delivery-note-table > thead > tr > th, #task-table > thead > tr > th { diff --git a/resources/views/portal/ninja2020/components/livewire/credits-table.blade.php b/resources/views/portal/ninja2020/components/livewire/credits-table.blade.php index 227721279305..e2ae75bafb0f 100644 --- a/resources/views/portal/ninja2020/components/livewire/credits-table.blade.php +++ b/resources/views/portal/ninja2020/components/livewire/credits-table.blade.php @@ -15,6 +15,11 @@ + @@ -41,6 +46,9 @@ @forelse($credits as $credit) + @@ -78,4 +86,4 @@ @endif {{ $credits->links('portal/ninja2020/vendor/pagination') }} - \ No newline at end of file + diff --git a/resources/views/portal/ninja2020/components/livewire/invoices-table.blade.php b/resources/views/portal/ninja2020/components/livewire/invoices-table.blade.php index 66da6013ceb7..c828f58c5fa3 100644 --- a/resources/views/portal/ninja2020/components/livewire/invoices-table.blade.php +++ b/resources/views/portal/ninja2020/components/livewire/invoices-table.blade.php @@ -20,7 +20,7 @@
- +
diff --git a/resources/views/portal/ninja2020/components/livewire/quotes-table.blade.php b/resources/views/portal/ninja2020/components/livewire/quotes-table.blade.php index 92d165ec841e..b827cdfcc8bf 100644 --- a/resources/views/portal/ninja2020/components/livewire/quotes-table.blade.php +++ b/resources/views/portal/ninja2020/components/livewire/quotes-table.blade.php @@ -10,10 +10,6 @@
-
- - -
diff --git a/resources/views/portal/ninja2020/invoices/includes/terms.blade.php b/resources/views/portal/ninja2020/invoices/includes/terms.blade.php index 3c28674347a2..2fec680173dd 100644 --- a/resources/views/portal/ninja2020/invoices/includes/terms.blade.php +++ b/resources/views/portal/ninja2020/invoices/includes/terms.blade.php @@ -12,23 +12,23 @@
@foreach($entities as $entity)
-

{{ $entity_type }} {{ $entity->number }}:

+

{{ $entity_type }} {{ $entity->number }}:

@if($entity->terms) -

{!! $entity->terms !!}

+
{!! $entity->terms !!}
@else {{ ctrans('texts.not_specified') }} @endif
@endforeach -

{{ ctrans('texts.by_clicking_next_you_accept_terms') }}

+

{{ ctrans('texts.click_agree_to_accept_terms') }}

@@ -39,3 +39,7 @@
+ +@push('footer') + +@endpush diff --git a/resources/views/portal/ninja2020/invoices/show.blade.php b/resources/views/portal/ninja2020/invoices/show.blade.php index c86ecfd388e7..ee02248dbb31 100644 --- a/resources/views/portal/ninja2020/invoices/show.blade.php +++ b/resources/views/portal/ninja2020/invoices/show.blade.php @@ -38,12 +38,6 @@ {{ ctrans('texts.invoice_number_placeholder', ['invoice' => $invoice->number])}} - {{ ctrans('texts.unpaid') }} -
-

- {{ ctrans('texts.invoice_still_unpaid') }} - -

-
diff --git a/resources/views/portal/ninja2020/layout/payments.blade.php b/resources/views/portal/ninja2020/layout/payments.blade.php index ab3e8d4d4096..49bf823d62e0 100644 --- a/resources/views/portal/ninja2020/layout/payments.blade.php +++ b/resources/views/portal/ninja2020/layout/payments.blade.php @@ -31,6 +31,10 @@
@yield('gateway_content')
+ + + Secure 256-bit encryption +
@endsection diff --git a/resources/views/portal/ninja2020/profile/settings/general.blade.php b/resources/views/portal/ninja2020/profile/settings/general.blade.php index f8a32171d365..65e8eaa0c3b9 100644 --- a/resources/views/portal/ninja2020/profile/settings/general.blade.php +++ b/resources/views/portal/ninja2020/profile/settings/general.blade.php @@ -3,9 +3,6 @@

{{ ctrans('texts.profile') }}

-

- {{ ctrans('texts.client_information_text') }} -

diff --git a/resources/views/portal/ninja2020/profile/settings/name-website-logo.blade.php b/resources/views/portal/ninja2020/profile/settings/name-website-logo.blade.php index 11ccba1c50a2..94b7c5c8c1f3 100644 --- a/resources/views/portal/ninja2020/profile/settings/name-website-logo.blade.php +++ b/resources/views/portal/ninja2020/profile/settings/name-website-logo.blade.php @@ -3,9 +3,6 @@

{{ ctrans('texts.name_website_logo') }}

-

- {{ ctrans('texts.make_sure_use_full_link') }} -

@@ -34,7 +31,10 @@ @enderror
- +
+ + E.g. https://invoiceninja.com +
@error('website')
diff --git a/resources/views/portal/ninja2020/profile/settings/personal-address.blade.php b/resources/views/portal/ninja2020/profile/settings/personal-address.blade.php index e76e405dff0e..53c51709a6d3 100644 --- a/resources/views/portal/ninja2020/profile/settings/personal-address.blade.php +++ b/resources/views/portal/ninja2020/profile/settings/personal-address.blade.php @@ -2,10 +2,7 @@
-

{{ ctrans('texts.personal_address') }}

-

- {{ ctrans('texts.enter_your_personal_address') }} -

+

{{ ctrans('texts.billing_address') }}

diff --git a/resources/views/portal/ninja2020/profile/settings/shipping-address.blade.php b/resources/views/portal/ninja2020/profile/settings/shipping-address.blade.php index 7255f0a208fe..9129fabddef6 100644 --- a/resources/views/portal/ninja2020/profile/settings/shipping-address.blade.php +++ b/resources/views/portal/ninja2020/profile/settings/shipping-address.blade.php @@ -3,9 +3,6 @@

{{ ctrans('texts.shipping_address') }}

-

- {{ ctrans('texts.enter_your_shipping_address') }} -

diff --git a/resources/views/portal/ninja2020/quotes/includes/actions.blade.php b/resources/views/portal/ninja2020/quotes/includes/actions.blade.php index d3c800ddc0ac..bc49946a1c29 100644 --- a/resources/views/portal/ninja2020/quotes/includes/actions.blade.php +++ b/resources/views/portal/ninja2020/quotes/includes/actions.blade.php @@ -7,16 +7,9 @@
-
-

- {{ ctrans('texts.waiting_for_approval') }} -

-
-

- {{ ctrans('texts.quote_still_not_approved') }} -

-
-
+

+ {{ ctrans('texts.pending_approval') }} +

@yield('quote-not-approved-right-side') diff --git a/webpack.mix.js b/webpack.mix.js index c5953f800f3e..ef423fb2c701 100644 --- a/webpack.mix.js +++ b/webpack.mix.js @@ -61,6 +61,10 @@ mix.js("resources/js/app.js", "public/js") .js( "resources/js/clients/shared/multiple-downloads.js", "public/js/clients/shared/multiple-downloads.js" + ) + .js( + "resources/js/clients/linkify-urls.js", + "public/js/clients/linkify-urls.js" ); mix.copyDirectory('node_modules/card-js/card-js.min.css', 'public/css/card-js.min.css');
+ + {{ ctrans('texts.credit_number') }} + + {{ ctrans('texts.amount') }} @@ -32,7 +37,7 @@ - {{ ctrans('texts.public_notes') }} + {{ ctrans('texts.notes') }}
+ {{ $credit->number }} + {{ App\Utils\Number::formatMoney($credit->amount, $credit->client) }}