1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-14 23:22:52 +01:00
invoiceninja/resources/views/invited/proposal.blade.php
Hillel Coren cb9c418333 Proposals
2018-02-11 16:08:13 +02:00

42 lines
1.3 KiB
PHP

@extends('public.header')
@section('content')
<div class="container" style="padding: 20px;">
<div class="pull-right">
{!! Button::normal(trans('texts.download'))->asLinkTo(url("/proposal/{$proposalInvitation->invitation_key}/download"))->large() !!}
@if (! $proposal->invoice->isApproved())
{!! Button::success(trans('texts.approve'))->withAttributes(['id' => 'approveButton', 'onclick' => 'onApproveClick()'])->large() !!}
@endif
</div>
<div class="clearfix"></div><br/>
<iframe id="proposalIframe" scrolling="no" onload="resizeIframe(this)" frameborder="0" width="100%"
style="background-color:white; border: solid 1px #DDD;"></iframe>
</div>
<script type="text/javascript">
function onApproveClick() {
$('#approveButton').prop('disabled', true);
location.href = "{{ url('/approve/' . $invoiceInvitation->invitation_key) }}";
}
function resizeIframe(obj) {
obj.style.height = obj.contentWindow.document.body.scrollHeight + 'px';
}
$(function() {
var html = {!! json_encode($proposal->html) !!};
var css = {!! json_encode($proposal->css) !!};
var content = '<html><head><style>' + css + '</style></head><body>' + html + '</body></html>';
var iFrame = document.getElementById('proposalIframe').contentWindow.document;
iFrame.write(content);
iFrame.close();
})
</script>
@stop