mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
Add company setting for enabling client portal uploads
This commit is contained in:
parent
9223ff9ac8
commit
c386167762
@ -235,6 +235,7 @@ class CompanySettings extends BaseSettings
|
||||
public $client_can_register = false;
|
||||
public $client_portal_terms = '';
|
||||
public $client_portal_privacy_policy = '';
|
||||
public $client_portal_enable_uploads = false;
|
||||
|
||||
public static $casts = [
|
||||
'lock_invoices' => 'string',
|
||||
@ -402,6 +403,7 @@ class CompanySettings extends BaseSettings
|
||||
'portal_custom_css' => 'string',
|
||||
'portal_custom_footer' => 'string',
|
||||
'portal_custom_js' => 'string',
|
||||
'client_portal_enable_uploads' => 'bool',
|
||||
];
|
||||
|
||||
|
||||
|
@ -13,8 +13,7 @@ class StoreUploadRequest extends FormRequest
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
// TODO: Check for the setting to allow client uploads.
|
||||
return true;
|
||||
return (bool) auth('contact')->user()->client->getSetting('client_portal_enable_uploads');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1,4 +1,4 @@
|
||||
<div class="mt-10">
|
||||
<div>
|
||||
<div class="flex items-center justify-between">
|
||||
<div class="flex items-center">
|
||||
<span class="mr-2 text-sm hidden md:block">{{ ctrans('texts.per_page') }}</span>
|
||||
|
@ -2,7 +2,10 @@
|
||||
@section('meta_title', ctrans('texts.downloads'))
|
||||
|
||||
@section('header')
|
||||
@component('portal.ninja2020.upload.index')@endcomponent
|
||||
{{ dd(auth('contact')->user()->client) }}
|
||||
@if($client->getSetting('client_portal_enable_uploads'))
|
||||
@component('portal.ninja2020.upload.index') @endcomponent
|
||||
@endif
|
||||
@endsection
|
||||
|
||||
@section('body')
|
||||
|
@ -1,7 +1,7 @@
|
||||
<link rel="stylesheet" href="{{ asset('vendor/dropzone-5.7.0/dist/min/basic.min.css') }}">
|
||||
<script src="{{ asset('vendor/dropzone-5.7.0/dist/min/dropzone.min.js') }}"></script>
|
||||
|
||||
<div class="bg-white rounded shadow p-4">
|
||||
<div class="bg-white rounded shadow p-4 mb-10">
|
||||
<span class="text-sm mb-4 block text-gray-500">{{ ctrans('texts.allowed_file_types' )}} png,ai,svg,jpeg,tiff,pdf,gif,psd,txt,doc,xls,ppt,xlsx,docx,pptx</span>
|
||||
<form action="{{ route('client.upload.store') }}" class="dropzone" method="post" enctype="multipart/form-data">
|
||||
@csrf
|
||||
|
Loading…
x
Reference in New Issue
Block a user