Proposals

This commit is contained in:
Hillel Coren 2018-02-04 22:10:40 +02:00
parent b4bf222d5d
commit d3a891375c
3 changed files with 32 additions and 23 deletions

View File

@ -8,6 +8,7 @@ use App\Http\Requests\UpdateProposalRequest;
use App\Models\Invoice;
use App\Models\Proposal;
use App\Models\ProposalTemplate;
use App\Models\ProposalSnippet;
use App\Ninja\Datatables\ProposalDatatable;
use App\Ninja\Repositories\ProposalRepository;
use App\Services\ProposalService;
@ -63,6 +64,7 @@ class ProposalController extends BaseController
'quotes' => Invoice::scope()->with('client.contacts')->quotes()->orderBy('id')->get(),
'templates' => ProposalTemplate::whereAccountId($account->id)->orWhereNull('account_id')->orderBy('name')->get(),
'quotePublicId' => $request->quote_id,
'snippets' => ProposalSnippet::scope()->with('proposal_category')->orderBy('name')->get(),
];
return View::make('proposals.edit', $data);
@ -90,6 +92,7 @@ class ProposalController extends BaseController
'templates' => ProposalTemplate::whereAccountId($account->id)->orWhereNull('account_id')->orderBy('name')->get(),
'quotePublicId' => $proposal->quote ? $proposal->quote->public_id : null,
'templatePublicId' => $proposal->proposal_template ? $proposal->proposal_template->public_id : null,
'snippets' => ProposalSnippet::scope()->with('proposal_category')->orderBy('name')->get(),
];
return View::make('proposals.edit', $data);

View File

@ -2722,6 +2722,7 @@ $LANG = array(
'deleted_proposal_categories' => 'Successfully archived :count categories',
'restored_proposal_category' => 'Successfully restored category',
'delete_status' => 'Delete Status',
'standard' => 'Standard',
);

View File

@ -120,34 +120,39 @@
components: '{!! $proposal ? $proposal->html : '' !!}',
style: '{!! $proposal ? $proposal->css : '' !!}',
showDevices: false,
categoryLabel: 'tes',
plugins: ['gjs-preset-newsletter'],
//plugins: ['gjs-blocks-basic'],
pluginsOpts: {
'gjs-preset-newsletter': {
'categoryLabel': "{{ trans('texts.standard') }}"
}
},
storageManager: {type: 'none'},
panels: {
Xdefaults : [{
id : 'commands',
buttons : [{
id : 'smile',
className : 'fa fa-smile-o',
attributes : { title: 'Smile' }
}],
}],
}
});
/*
var blockManager = editor.BlockManager;
blockManager.add('h1-block', {
label: 'Heading',
category: 'Basic',
content: '<h1>Put your title here</h1>',
attributes: {
title: 'Insert h1 block',
class:'fa fa-smile-o'
var blockManager = grapesjsEditor.BlockManager;
@foreach ($snippets as $snippet)
blockManager.add('h1-block', {
label: '{{ $snippet->name }}',
category: '{{ $snippet->proposal_category ? $snippet->proposal_category->name : trans('texts.custom') }}',
content: '{!! $snippet->html !!}',
style: '{!! $snippet->css !!}',
attributes: {
title: '{!! $snippet->private_notes !!}',
class:'fa fa-smile-o'
}
});
@endforeach
@if (count($snippets))
var blockCategories = blockManager.getCategories();
for (var i=0; i<blockCategories.models.length; i++) {
var blockCategory = blockCategories.models[i];
blockCategory.set('open', false);
}
});
*/
})
@endif
})
</script>