1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-15 07:33:04 +01:00
invoiceninja/resources/views/invited/proposal.blade.php

39 lines
1.2 KiB
PHP
Raw Normal View History

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