1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-08 20:22:42 +01:00

Proposals

This commit is contained in:
Hillel Coren 2018-02-04 21:34:38 +02:00
parent cb54e9e8b7
commit b4bf222d5d
7 changed files with 29 additions and 11 deletions

View File

@ -27,7 +27,7 @@ class UpdateProposalRequest extends ProposalRequest
return [
'quote_id' => 'required',
'template_id' => 'required',
'proposal_template_id' => 'required',
];
}
}

View File

@ -23,6 +23,8 @@ class Proposal extends EntityModel
*/
protected $fillable = [
'private_notes',
'html',
'css',
];
/**

View File

@ -25,6 +25,8 @@ class ProposalSnippet extends EntityModel
'name',
'private_notes',
'proposal_category_id',
'html',
'css',
];
/**

View File

@ -24,6 +24,8 @@ class ProposalTemplate extends EntityModel
protected $fillable = [
'name',
'private_notes',
'html',
'css',
];
/**

View File

@ -33,6 +33,8 @@
<span style="display:none">
{!! Former::text('public_id') !!}
{!! Former::text('html') !!}
{!! Former::text('css') !!}
</span>
<div class="row">
@ -81,6 +83,8 @@
var templateMap = {};
function onSaveClick() {
$('#html').val(grapesjsEditor.getHtml());
$('#css').val(grapesjsEditor.getCss());
$('#mainForm').submit();
}
@ -111,10 +115,10 @@
setComboboxValue($('.template-select'), template.public_id, template.name);
}
var editor = grapesjs.init({
window.grapesjsEditor = grapesjs.init({
container : '#gjs',
components: '',
style: '',
components: '{!! $proposal ? $proposal->html : '' !!}',
style: '{!! $proposal ? $proposal->css : '' !!}',
showDevices: false,
plugins: ['gjs-preset-newsletter'],
//plugins: ['gjs-blocks-basic'],

View File

@ -33,6 +33,8 @@
<span style="display:none">
{!! Former::text('public_id') !!}
{!! Former::text('html') !!}
{!! Former::text('css') !!}
</span>
@ -77,6 +79,8 @@
var categoryMap = {};
function onSaveClick() {
$('#html').val(grapesjsEditor.getHtml());
$('#css').val(grapesjsEditor.getCss());
$('#mainForm').submit();
}
@ -94,10 +98,10 @@
setComboboxValue($('.category-select'), category.public_id, category.name);
}
var editor = grapesjs.init({
window.grapesjsEditor = grapesjs.init({
container : '#gjs',
components: '',
style: '',
components: '{!! $snippet ? $snippet->html : '' !!}',
style: '{!! $snippet ? $snippet->css : '' !!}',
showDevices: false,
plugins: ['gjs-preset-newsletter'],
//plugins: ['gjs-blocks-basic'],

View File

@ -32,6 +32,8 @@
<span style="display:none">
{!! Former::text('public_id') !!}
{!! Former::text('html') !!}
{!! Former::text('css') !!}
</span>
@ -44,7 +46,7 @@
{!! Former::text('name') !!}
<!--
{!! Former::select('template_id')->addOption('', '')
{!! Former::select('proposal_template_id')->addOption('', '')
->label(trans('texts.template'))
->addGroupClass('template-select') !!}
-->
@ -77,6 +79,8 @@
var templateMap = {};
function onSaveClick() {
$('#html').val(grapesjsEditor.getHtml());
$('#css').val(grapesjsEditor.getCss());
$('#mainForm').submit();
}
@ -91,10 +95,10 @@
@include('partials/entity_combobox', ['entityType' => ENTITY_PROPOSAL_TEMPLATE])
*/
var editor = grapesjs.init({
window.grapesjsEditor = grapesjs.init({
container : '#gjs',
components: '',
style: '',
components: '{!! $template ? $template->html : '' !!}',
style: '{!! $template ? $template->css : '' !!}',
showDevices: false,
plugins: ['gjs-preset-newsletter'],
//plugins: ['gjs-blocks-basic'],