mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Proposals
This commit is contained in:
parent
b4bf222d5d
commit
d3a891375c
@ -8,6 +8,7 @@ use App\Http\Requests\UpdateProposalRequest;
|
|||||||
use App\Models\Invoice;
|
use App\Models\Invoice;
|
||||||
use App\Models\Proposal;
|
use App\Models\Proposal;
|
||||||
use App\Models\ProposalTemplate;
|
use App\Models\ProposalTemplate;
|
||||||
|
use App\Models\ProposalSnippet;
|
||||||
use App\Ninja\Datatables\ProposalDatatable;
|
use App\Ninja\Datatables\ProposalDatatable;
|
||||||
use App\Ninja\Repositories\ProposalRepository;
|
use App\Ninja\Repositories\ProposalRepository;
|
||||||
use App\Services\ProposalService;
|
use App\Services\ProposalService;
|
||||||
@ -63,6 +64,7 @@ class ProposalController extends BaseController
|
|||||||
'quotes' => Invoice::scope()->with('client.contacts')->quotes()->orderBy('id')->get(),
|
'quotes' => Invoice::scope()->with('client.contacts')->quotes()->orderBy('id')->get(),
|
||||||
'templates' => ProposalTemplate::whereAccountId($account->id)->orWhereNull('account_id')->orderBy('name')->get(),
|
'templates' => ProposalTemplate::whereAccountId($account->id)->orWhereNull('account_id')->orderBy('name')->get(),
|
||||||
'quotePublicId' => $request->quote_id,
|
'quotePublicId' => $request->quote_id,
|
||||||
|
'snippets' => ProposalSnippet::scope()->with('proposal_category')->orderBy('name')->get(),
|
||||||
];
|
];
|
||||||
|
|
||||||
return View::make('proposals.edit', $data);
|
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(),
|
'templates' => ProposalTemplate::whereAccountId($account->id)->orWhereNull('account_id')->orderBy('name')->get(),
|
||||||
'quotePublicId' => $proposal->quote ? $proposal->quote->public_id : null,
|
'quotePublicId' => $proposal->quote ? $proposal->quote->public_id : null,
|
||||||
'templatePublicId' => $proposal->proposal_template ? $proposal->proposal_template->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);
|
return View::make('proposals.edit', $data);
|
||||||
|
@ -2722,6 +2722,7 @@ $LANG = array(
|
|||||||
'deleted_proposal_categories' => 'Successfully archived :count categories',
|
'deleted_proposal_categories' => 'Successfully archived :count categories',
|
||||||
'restored_proposal_category' => 'Successfully restored category',
|
'restored_proposal_category' => 'Successfully restored category',
|
||||||
'delete_status' => 'Delete Status',
|
'delete_status' => 'Delete Status',
|
||||||
|
'standard' => 'Standard',
|
||||||
|
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -120,34 +120,39 @@
|
|||||||
components: '{!! $proposal ? $proposal->html : '' !!}',
|
components: '{!! $proposal ? $proposal->html : '' !!}',
|
||||||
style: '{!! $proposal ? $proposal->css : '' !!}',
|
style: '{!! $proposal ? $proposal->css : '' !!}',
|
||||||
showDevices: false,
|
showDevices: false,
|
||||||
|
categoryLabel: 'tes',
|
||||||
plugins: ['gjs-preset-newsletter'],
|
plugins: ['gjs-preset-newsletter'],
|
||||||
//plugins: ['gjs-blocks-basic'],
|
pluginsOpts: {
|
||||||
storageManager: {type: 'none'},
|
'gjs-preset-newsletter': {
|
||||||
panels: {
|
'categoryLabel': "{{ trans('texts.standard') }}"
|
||||||
Xdefaults : [{
|
|
||||||
id : 'commands',
|
|
||||||
buttons : [{
|
|
||||||
id : 'smile',
|
|
||||||
className : 'fa fa-smile-o',
|
|
||||||
attributes : { title: 'Smile' }
|
|
||||||
}],
|
|
||||||
}],
|
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
storageManager: {type: 'none'},
|
||||||
});
|
});
|
||||||
|
|
||||||
/*
|
var blockManager = grapesjsEditor.BlockManager;
|
||||||
var blockManager = editor.BlockManager;
|
|
||||||
|
@foreach ($snippets as $snippet)
|
||||||
blockManager.add('h1-block', {
|
blockManager.add('h1-block', {
|
||||||
label: 'Heading',
|
label: '{{ $snippet->name }}',
|
||||||
category: 'Basic',
|
category: '{{ $snippet->proposal_category ? $snippet->proposal_category->name : trans('texts.custom') }}',
|
||||||
content: '<h1>Put your title here</h1>',
|
content: '{!! $snippet->html !!}',
|
||||||
|
style: '{!! $snippet->css !!}',
|
||||||
attributes: {
|
attributes: {
|
||||||
title: 'Insert h1 block',
|
title: '{!! $snippet->private_notes !!}',
|
||||||
class:'fa fa-smile-o'
|
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>
|
</script>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user