1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-09-21 08:51:34 +02:00

Minor fixes

This commit is contained in:
Hillel Coren 2016-06-05 22:56:45 +03:00
parent d5669fdbf9
commit 44dfa56c31
7 changed files with 73 additions and 73 deletions

View File

@ -1179,7 +1179,7 @@ $LANG = array(
'preview' => 'Preview',
'list_vendors' => 'List Vendors',
'add_users_not_supported' => 'Upgrade to the Enterprise plan to add additional users to your account.',
'enterprise_plan_features' => 'The Enterprise plan adds support for multiple users and file attachments.',
'enterprise_plan_features' => 'The Enterprise plan adds support for multiple users and file attachments, :link to see the full list of features.',
'return_to_app' => 'Return to app',
'update_font_cache' => 'Please force refresh the page to update the font cache.',

View File

@ -10,16 +10,16 @@
@foreach ($account->getFontFolders() as $font)
<script src="{{ asset('js/vfs_fonts/'.$font.'.js') }}" type="text/javascript"></script>
@endforeach
<script src="{{ asset('pdf.built.js') }}" type="text/javascript"></script>
<script src="{{ asset('pdf.built.js') }}?no_cache={{ NINJA_VERSION }}" type="text/javascript"></script>
<style type="text/css">
select.form-control {
background: #FFFFFF !important;
background: #FFFFFF !important;
margin-right: 12px;
}
table {
background: #FFFFFF !important;
background: #FFFFFF !important;
}
/* http://stackoverflow.com/questions/4810841/how-can-i-pretty-print-json-using-javascript */
@ -34,13 +34,13 @@
@stop
@section('content')
@section('content')
@parent
<script>
var invoiceDesigns = {!! $invoiceDesigns !!};
var invoiceFonts = {!! $invoiceFonts !!};
var invoice = {!! json_encode($invoice) !!};
var invoice = {!! json_encode($invoice) !!};
var sections = ['content', 'styles', 'defaultStyle', 'pageMargins', 'header', 'footer'];
var customDesign = origCustomDesign = {!! $customDesign ?: 'JSON.parse(invoiceDesigns[0].javascript);' !!};
@ -66,9 +66,9 @@
function getDesignJavascript() {
var id = $('#invoice_design_id').val();
if (id == '-1') {
showMoreDesigns();
showMoreDesigns();
$('#invoice_design_id').val(1);
return invoiceDesigns[0].javascript;
return invoiceDesigns[0].javascript;
} else if (customDesign) {
return JSON.stringify(customDesign);
} else {
@ -83,12 +83,12 @@
// the function throws an error if the editor is in code view
try {
editor.expandAll();
editor.expandAll();
} catch(err) {}
}
}
function saveEditor(data)
{
{
setTimeout(function() {
customDesign[editorSection] = editor.get();
clearError();
@ -98,7 +98,7 @@
function onSelectChange()
{
var id = $('#invoice_design_id').val();
var id = $('#invoice_design_id').val();
if (parseInt(id)) {
var design = _.find(invoiceDesigns, function(design){ return design.id == id});
customDesign = JSON.parse(design.javascript);
@ -135,7 +135,7 @@
$(function() {
clearError();
var container = document.getElementById("jsoneditor");
var options = {
mode: 'form',
@ -146,7 +146,7 @@
};
window.editor = new JSONEditor(container, options);
loadEditor('content');
$('a[data-toggle="tab"]').on('shown.bs.tab', function (e) {
var target = $(e.target).attr("href") // activated tab
target = target.substring(1); // strip leading #
@ -161,13 +161,13 @@
@endif
});
</script>
</script>
<div class="row">
<div class="col-md-6">
{!! Former::open()->addClass('warn-on-exit') !!}
{!! Former::open()->addClass('warn-on-exit') !!}
{!! Former::populateField('invoice_design_id', $account->invoice_design_id) !!}
<div style="display:none">
@ -199,16 +199,16 @@
<script>
@if (!Auth::user()->hasFeature(FEATURE_CUSTOMIZE_INVOICE_DESIGN))
$(function() {
$(function() {
$('form.warn-on-exit input, .save-button').prop('disabled', true);
});
@endif
function showHelp() {
$('#helpModal').modal('show');
}
function showHelp() {
$('#helpModal').modal('show');
}
</script>
</script>
{!! Former::close() !!}
@ -231,9 +231,9 @@
</div>
<div class="modal-footer" style="margin-top: 0px">
<button type="button" class="btn btn-default" data-dismiss="modal">{{ trans('texts.close') }}</button>
<button type="button" class="btn btn-default" data-dismiss="modal">{{ trans('texts.close') }}</button>
</div>
</div>
</div>
</div>
@ -249,4 +249,4 @@
</div>
</div>
@stop
@stop

View File

@ -7,28 +7,28 @@
@foreach ($account->getFontFolders() as $font)
<script src="{{ asset('js/vfs_fonts/'.$font.'.js') }}" type="text/javascript"></script>
@endforeach
<script src="{{ asset('pdf.built.js') }}" type="text/javascript"></script>
<script src="{{ asset('pdf.built.js') }}?no_cache={{ NINJA_VERSION }}" type="text/javascript"></script>
<script src="{{ asset('js/lightbox.min.js') }}" type="text/javascript"></script>
<link href="{{ asset('css/lightbox.css') }}" rel="stylesheet" type="text/css"/>
@stop
@section('content')
@section('content')
@parent
@include('accounts.nav', ['selected' => ACCOUNT_INVOICE_DESIGN, 'advanced' => true])
<script>
var invoiceDesigns = {!! $invoiceDesigns !!};
var invoiceFonts = {!! $invoiceFonts !!};
var invoice = {!! json_encode($invoice) !!};
var invoice = {!! json_encode($invoice) !!};
function getDesignJavascript() {
var id = $('#invoice_design_id').val();
if (id == '-1') {
showMoreDesigns();
showMoreDesigns();
$('#invoice_design_id').val(1);
return invoiceDesigns[0].javascript;
} else {
} else {
var design = _.find(invoiceDesigns, function(design){ return design.id == id});
return design ? design.javascript : '';
}
@ -44,7 +44,7 @@
jQuery.getScript({!! json_encode(asset('js/vfs_fonts/%s.js')) !!}.replace('%s', fontFolder), function(){window.loadingFonts=false;ninjaLoadFontVfs();refreshPDF()})
}
}
function getPDFString(cb) {
invoice.features = {
customize_invoice_design:{{ Auth::user()->hasFeature(FEATURE_CUSTOMIZE_INVOICE_DESIGN) ? 'true' : 'false' }},
@ -56,21 +56,21 @@
invoice.account.hide_paid_to_date = $('#hide_paid_to_date').is(":checked");
invoice.invoice_design_id = $('#invoice_design_id').val();
invoice.account.page_size = $('#page_size option:selected').text();
NINJA.primaryColor = $('#primary_color').val();
NINJA.secondaryColor = $('#secondary_color').val();
NINJA.fontSize = parseInt($('#font_size').val());
NINJA.headerFont = $('#header_font_id option:selected').text();
NINJA.bodyFont = $('#body_font_id option:selected').text();
var fields = [
'item',
'description',
'unit_cost',
'quantity',
'line_total',
'terms',
'balance_due',
'item',
'description',
'unit_cost',
'quantity',
'line_total',
'terms',
'balance_due',
'partial_due'
];
invoiceLabels.old = {};
@ -88,7 +88,7 @@
generatePDF(invoice, getDesignJavascript(), true, cb);
}
$(function() {
$(function() {
var options = {
preferredFormat: 'hex',
disabled: {!! Auth::user()->hasFeature(FEATURE_CUSTOMIZE_INVOICE_DESIGN) ? 'false' : 'true' !!},
@ -102,19 +102,19 @@
$('#secondary_color').spectrum(options);
$('#header_font_id').change(function(){loadFont($('#header_font_id').val())});
$('#body_font_id').change(function(){loadFont($('#body_font_id').val())});
refreshPDF();
});
</script>
</script>
<div class="row">
<div class="col-md-12">
{!! Former::open()->addClass('warn-on-exit')->onchange('if(!window.loadingFonts)refreshPDF()') !!}
{!! Former::populateField('invoice_design_id', $account->invoice_design_id) !!}
{!! Former::populateField('body_font_id', $account->body_font_id) !!}
{!! Former::populateField('header_font_id', $account->header_font_id) !!}
@ -158,7 +158,7 @@
{!! Former::select('invoice_design_id')
->fromQuery($invoiceDesigns, 'name', 'id')
->addOption(trans('texts.more_designs') . '...', '-1') !!}
@else
@else
{!! Former::select('invoice_design_id')
->fromQuery($invoiceDesigns, 'name', 'id') !!}
@endif
@ -167,7 +167,7 @@
{!! Former::select('header_font_id')
->fromQuery($invoiceFonts, 'name', 'id') !!}
{!! Former::checkbox('live_preview')->text(trans('texts.enable')) !!}
{!! Former::checkbox('live_preview')->text(trans('texts.enable')) !!}
</div>
<div class="col-md-6">
@ -177,7 +177,7 @@
{!! Former::select('page_size')
->options($pageSizes) !!}
{!! Former::text('font_size')
->type('number')
->min('0')
@ -253,7 +253,7 @@
<br/>
{!! Former::actions(
{!! Former::actions(
Button::primary(trans('texts.customize'))
->appendIcon(Icon::create('edit'))
->asLinkTo(URL::to('/settings/customize_design'))
@ -267,10 +267,10 @@
@if (!Auth::user()->hasFeature(FEATURE_CUSTOMIZE_INVOICE_DESIGN))
<script>
$(function() {
$(function() {
$('form.warn-on-exit input, .save-button').prop('disabled', true);
});
</script>
</script>
@endif
{!! Former::close() !!}
@ -282,4 +282,4 @@
@include('invoices.pdf', ['account' => Auth::user()->account, 'pdfHeight' => 800])
@stop
@stop

View File

@ -129,7 +129,7 @@
{!! Former::select('plan_term')
->addOption(trans('texts.plan_term_yearly'), PLAN_TERM_YEARLY)
->addOption(trans('texts.plan_term_monthly'), PLAN_TERM_MONTHLY)
->inlineHelp(trans('texts.enterprise_plan_features')) !!}
->inlineHelp(trans('texts.enterprise_plan_features', ['link' => link_to(NINJA_WEB_URL . '/plans-pricing', trans('texts.click_here'), ['target' => '_blank'])])) !!}
</div>
<div class="modal-footer" style="margin-top: 0px">
<button type="button" class="btn btn-default" data-dismiss="modal">{{ trans('texts.go_back') }}</button>

View File

@ -8,7 +8,7 @@
@foreach ($account->getFontFolders() as $font)
<script src="{{ asset('js/vfs_fonts/'.$font.'.js') }}" type="text/javascript"></script>
@endforeach
<script src="{{ asset('pdf.built.js') }}" type="text/javascript"></script>
<script src="{{ asset('pdf.built.js') }}?no_cache={{ NINJA_VERSION }}" type="text/javascript"></script>
<script src="{{ asset('js/lightbox.min.js') }}" type="text/javascript"></script>
<link href="{{ asset('css/lightbox.css') }}" rel="stylesheet" type="text/css"/>

View File

@ -7,7 +7,7 @@
@foreach (Auth::user()->account->getFontFolders() as $font)
<script src="{{ asset('js/vfs_fonts/'.$font.'.js') }}" type="text/javascript"></script>
@endforeach
<script src="{{ asset('pdf.built.js') }}" type="text/javascript"></script>
<script src="{{ asset('pdf.built.js') }}?no_cache={{ NINJA_VERSION }}" type="text/javascript"></script>
<script>
@ -15,7 +15,7 @@
var invoiceFonts = {!! $invoiceFonts !!};
var currentInvoice = {!! $invoice !!};
var versionsJson = {!! $versionsJson !!};
function getPDFString(cb) {
var version = $('#version').val();
@ -34,15 +34,15 @@
if (!invoiceDesign) {
invoiceDesign = invoiceDesigns[0];
}
generatePDF(invoice, invoiceDesign.javascript, true, cb);
generatePDF(invoice, invoiceDesign.javascript, true, cb);
}
$(function() {
$(function() {
refreshPDF();
});
</script>
</script>
@stop
@ -50,13 +50,13 @@
{!! Former::open()->addClass('form-inline')->onchange('refreshPDF()') !!}
{!! Former::select('version')->options($versionsSelect)->label(trans('select_version'))->style('background-color: white !important') !!}
{!! Button::primary(trans('texts.edit_' . $invoice->getEntityType()))->asLinkTo(URL::to('/' . $invoice->getEntityType() . 's/' . $invoice->public_id . '/edit'))->withAttributes(array('class' => 'pull-right')) !!}
{!! Button::primary(trans('texts.edit_' . $invoice->getEntityType()))->asLinkTo(URL::to('/' . $invoice->getEntityType() . 's/' . $invoice->public_id . '/edit'))->withAttributes(array('class' => 'pull-right')) !!}
{!! Former::close() !!}
<br/>&nbsp;<br/>
@include('invoices.pdf', ['account' => Auth::user()->account, 'pdfHeight' => 800])
@if (Utils::hasFeature(FEATURE_DOCUMENTS) && $invoice->account->invoice_embed_documents)
@foreach ($invoice->documents as $document)
@if($document->isPDFEmbeddable())
@ -71,4 +71,4 @@
@endforeach
@endforeach
@endif
@stop
@stop

View File

@ -4,15 +4,15 @@
@parent
@include('money_script')
@foreach ($invoice->client->account->getFontFolders() as $font)
<script src="{{ asset('js/vfs_fonts/'.$font.'.js') }}" type="text/javascript"></script>
@endforeach
<script src="{{ asset('pdf.built.js') }}" type="text/javascript"></script>
<script src="{{ asset('pdf.built.js') }}?no_cache={{ NINJA_VERSION }}" type="text/javascript"></script>
<style type="text/css">
body {
background-color: #f8f8f8;
background-color: #f8f8f8;
}
</style>
@stop
@ -39,8 +39,8 @@
{!! DropdownButton::success(trans('texts.pay_now'))->withContents($paymentTypes)->large() !!}
@else
<a href='{!! $paymentURL !!}' class="btn btn-success btn-lg">{{ trans('texts.pay_now') }}</a>
@endif
@else
@endif
@else
{!! Button::normal(trans('texts.download_pdf'))->withAttributes(['onclick' => 'onDownloadClick()'])->large() !!}
@endif
</div>
@ -67,7 +67,7 @@
</ul>
</div>
@endif
@if ($account->hasFeature(FEATURE_DOCUMENTS) && $account->invoice_embed_documents)
@foreach ($invoice->documents as $document)
@if($document->isPDFEmbeddable())
@ -107,16 +107,16 @@
doc.getDataUrl(function(pdfString) {
document.write(pdfString);
document.close();
if (window.hasOwnProperty('pjsc_meta')) {
window['pjsc_meta'].remainingTasks--;
}
});
@else
@else
refreshPDF();
@endif
});
function onDownloadClick() {
var doc = generatePDF(invoice, invoice.invoice_design.javascript, true);
var fileName = invoice.is_quote ? invoiceLabels.quote : invoiceLabels.invoice;