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-09 15:54:21 +02:00
parent c4f2f20049
commit 181094cbc1
3 changed files with 22 additions and 15 deletions

View File

@ -12,7 +12,7 @@
{!! Former::open($url)
->method($method)
->id('mainForm')
->onsubmit('return onFormSubmit(event)')
->rules([
'invoice_id' => 'required',
]) !!}
@ -57,7 +57,7 @@
->asLinkTo(HTMLUtils::previousUrl('/proposals')) !!}
{!! Button::success(trans("texts.save"))
->withAttributes(array('id' => 'saveButton', 'onclick' => 'onSaveClick()'))
->submit()
->appendIcon(Icon::create('floppy-disk')) !!}
</center>
@ -72,10 +72,11 @@
var templates = {!! $templates !!};
var templateMap = {};
function onSaveClick() {
function onFormSubmit() {
$('#html').val(grapesjsEditor.getHtml());
$('#css').val(grapesjsEditor.getCss());
$('#mainForm').submit();
return true;
}
function loadTemplate() {

View File

@ -11,7 +11,7 @@
{!! Former::open($url)
->method($method)
->id('mainForm')
->onsubmit('return onFormSubmit(event)')
->rules([
'name' => 'required',
]) !!}
@ -26,7 +26,6 @@
{!! Former::text('css') !!}
</span>
<div class="row">
<div class="col-lg-12">
<div class="panel panel-default">
@ -60,7 +59,7 @@
->asLinkTo(HTMLUtils::previousUrl('/proposals')) !!}
{!! Button::success(trans("texts.save"))
->withAttributes(array('id' => 'saveButton', 'onclick' => 'onSaveClick()'))
->submit()
->appendIcon(Icon::create('floppy-disk')) !!}
</center>
@ -73,10 +72,11 @@
var categories = {!! $categories !!};
var categoryMap = {};
function onSaveClick() {
function onFormSubmit() {
$('#html').val(grapesjsEditor.getHtml());
$('#css').val(grapesjsEditor.getCss());
$('#mainForm').submit();
return true;
}
$(function() {

View File

@ -11,7 +11,7 @@
{!! Former::open($url)
->method($method)
->id('mainForm')
->onsubmit('return onFormSubmit(event)')
->rules([
'name' => 'required',
]) !!}
@ -26,7 +26,6 @@
{!! Former::text('css') !!}
</span>
<div class="row">
<div class="col-lg-12">
<div class="panel panel-default">
@ -57,9 +56,15 @@
->appendIcon(Icon::create('remove-circle'))
->asLinkTo(HTMLUtils::previousUrl('/proposals')) !!}
{!! Button::success(trans("texts.save"))
->withAttributes(array('id' => 'saveButton', 'onclick' => 'onSaveClick()'))
{!! Button::success(trans('texts.save'))
->submit()
->appendIcon(Icon::create('floppy-disk')) !!}
@if ($template)
{!! Button::primary(trans('texts.new_proposal'))
->asLinkTo(url('/proposals/create/0/' . $template->public_id)) !!}
@endif
</center>
{!! Former::close() !!}
@ -70,10 +75,11 @@
var templates = {!! $templates !!};
var templateMap = {};
function onSaveClick() {
function onFormSubmit() {
$('#html').val(grapesjsEditor.getHtml());
$('#css').val(grapesjsEditor.getCss());
$('#mainForm').submit();
return true;
}
$(function() {