1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-14 15:13:29 +01:00
invoiceninja/app/views/accounts/product.blade.php

56 lines
1.4 KiB
PHP
Raw Normal View History

2014-04-23 22:30:54 +02:00
@extends('accounts.nav')
@section('content')
@parent
2014-09-28 12:37:54 +02:00
{{ Former::open($url)->method($method)
->rules(['product_key' => 'required|max:20'])
->addClass('col-md-8 col-md-offset-2 warn-on-exit') }}
2014-04-23 22:30:54 +02:00
{{ Former::legend($title) }}
@if ($product)
{{ Former::populate($product) }}
2014-11-11 09:29:43 +01:00
{{ Former::populateField('cost', number_format($product->cost, 2, '.', '')) }}
2014-04-23 22:30:54 +02:00
@endif
2014-04-25 11:11:20 +02:00
{{ Former::text('product_key')->label('texts.product') }}
2014-04-23 23:48:09 +02:00
{{ Former::textarea('notes')->data_bind("value: wrapped_notes, valueUpdate: 'afterkeydown'") }}
2014-04-23 22:30:54 +02:00
{{ Former::text('cost') }}
{{ Former::actions(
Button::lg_success_submit(trans('texts.save'))->append_with_icon('floppy-disk'),
Button::lg_default_link('company/products', trans('texts.cancel'))->append_with_icon('remove-circle')
2014-04-23 22:30:54 +02:00
) }}
{{ Former::close() }}
2014-04-23 23:48:09 +02:00
<script type="text/javascript">
function ViewModel(data) {
var self = this;
@if ($product)
self.notes = ko.observable(wordWrapText('{{ str_replace(["\r\n","\r","\n"], '\n', addslashes($product->notes)) }}', 300));
@else
self.notes = ko.observable('');
@endif
self.wrapped_notes = ko.computed({
read: function() {
return self.notes();
},
write: function(value) {
value = wordWrapText(value, 235);
self.notes(value);
},
owner: this
});
}
window.model = new ViewModel();
ko.applyBindings(model);
</script>
2014-04-23 22:30:54 +02:00
@stop